mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
ADXL345: Don't select device if only change SPI settings
This commit is contained in:
@@ -417,11 +417,9 @@ ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_dev_s *dev,
|
||||
#ifdef CONFIG_SPI_OWNBUS
|
||||
/* Configure SPI for the ADXL345 */
|
||||
|
||||
SPI_SELECT(priv->spi, SPIDEV_GSENSOR, true);
|
||||
SPI_SETMODE(priv->spi, SPIDEV_MODE3);
|
||||
SPI_SETBITS(priv->spi, 8);
|
||||
SPI_SETFREQUENCY(priv->spi, ADXL345_SPI_MAXFREQUENCY);
|
||||
SPI_SELECT(priv->spi, SPIDEV_GSENSOR, false);
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
@@ -68,11 +68,9 @@ static inline void adxl345_configspi(FAR struct spi_dev_s *spi)
|
||||
{
|
||||
/* Configure SPI for the ADXL345 */
|
||||
|
||||
SPI_SELECT(spi, SPIDEV_GSENSOR, true);
|
||||
SPI_SETMODE(spi, SPIDEV_MODE3);
|
||||
SPI_SETBITS(spi, 8);
|
||||
SPI_SETFREQUENCY(spi, ADXL345_SPI_MAXFREQUENCY);
|
||||
SPI_SELECT(spi, SPIDEV_GSENSOR, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user