sensors/bmi160: fix compilation errors
fix compilation errors about undefined reference to `bmi160_configspi'
This commit is contained in:
parent
07ec18f088
commit
547342ca50
@ -137,7 +137,12 @@ if(CONFIG_SENSORS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_SENSORS_BMI160)
|
if(CONFIG_SENSORS_BMI160)
|
||||||
list(APPEND SRCS bmi160.c)
|
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()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_SENSORS_BMP180)
|
if(CONFIG_SENSORS_BMP180)
|
||||||
|
@ -38,6 +38,25 @@
|
|||||||
* Private Functions
|
* 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
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -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);
|
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 */
|
#endif /* __INCLUDE_NUTTX_SENSORS_BMI160_COMMOM_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user