STM32 SPI: Disable SPI before modifying CR1

This commit is contained in:
Gregory Nutt 2014-02-18 13:42:20 -06:00
parent 26777e9145
commit bbb65432d9
1 changed files with 2 additions and 0 deletions

View File

@ -1110,7 +1110,9 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
return; return;
} }
spi_modifycr1(priv, 0, SPI_CR1_SPE);
spi_modifycr1(priv, setbits, clrbits); spi_modifycr1(priv, setbits, clrbits);
spi_modifycr1(priv, SPI_CR1_SPE, 0);
/* Save the mode so that subsequent re-configurations will be faster */ /* Save the mode so that subsequent re-configurations will be faster */