forked from nuttx/nuttx-update
sensors/bmi160: fix compilation errors
fix compilation errors about undefined reference to `bmi160_configspi'
This commit is contained in:
parent
07ec18f088
commit
547342ca50
3 changed files with 25 additions and 19 deletions
|
@ -137,7 +137,12 @@ if(CONFIG_SENSORS)
|
|||
endif()
|
||||
|
||||
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()
|
||||
|
||||
if(CONFIG_SENSORS_BMP180)
|
||||
|
|
|
@ -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
|
||||
****************************************************************************/
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue