1
0
Fork 0
forked from nuttx/nuttx-update

sensors/bmi160: fix compilation errors

fix compilation errors about undefined reference to `bmi160_configspi'
This commit is contained in:
raiden00pl 2024-02-27 08:50:25 +01:00 committed by Alin Jerpelea
parent 07ec18f088
commit 547342ca50
3 changed files with 25 additions and 19 deletions

View file

@ -137,8 +137,13 @@ if(CONFIG_SENSORS)
endif()
if(CONFIG_SENSORS_BMI160)
list(APPEND SRCS bmi160_base.c)
if(CONFIG_SENSORS_BMI160_UORB)
list(APPEND SRCS bmi160_uorb.c)
else()
list(APPEND SRCS bmi160.c)
endif()
endif()
if(CONFIG_SENSORS_BMP180)
list(APPEND SRCS bmp180.c)

View file

@ -38,6 +38,25 @@
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: bmi160_configspi
*
* Description:
*
****************************************************************************/
#ifdef CONFIG_SENSORS_BMI160_SPI
static void bmi160_configspi(FAR struct spi_dev_s *spi)
{
/* Configure SPI for the BMI160 */
SPI_SETMODE(spi, SPIDEV_MODE0);
SPI_SETBITS(spi, 8);
SPI_HWFEATURES(spi, 0);
SPI_SETFREQUENCY(spi, BMI160_SPI_MAXFREQUENCY);
}
#endif
/****************************************************************************
* Private Data
****************************************************************************/

View file

@ -240,22 +240,4 @@ void bmi160_getregs(FAR struct bmi160_dev_s *priv, uint8_t regaddr,
int bmi160_checkid(FAR struct bmi160_dev_s *priv);
/****************************************************************************
* Name: bmi160_configspi
*
* Description:
*
****************************************************************************/
#ifdef CONFIG_SENSORS_BMI160_SPI
inline void bmi160_configspi(FAR struct spi_dev_s *spi)
{
/* Configure SPI for the BMI160 */
SPI_SETMODE(spi, SPIDEV_MODE0);
SPI_SETBITS(spi, 8);
SPI_HWFEATURES(spi, 0);
SPI_SETFREQUENCY(spi, BMI160_SPI_MAXFREQUENCY);
}
#endif
#endif /* __INCLUDE_NUTTX_SENSORS_BMI160_COMMOM_H */