From a3728946f8a57b3f4bbc1642d082866517f8038b Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Thu, 29 Sep 2016 15:02:05 +0000 Subject: Improved LSM303DLHC driver and related demos: improved bias and sensitivity handling. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9823 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/STM32F4xx/I2C-LSM303DLHC/Makefile | 4 ++-- testhal/STM32/STM32F4xx/I2C-LSM303DLHC/main.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'testhal/STM32/STM32F4xx') diff --git a/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/Makefile b/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/Makefile index 266c918db..37305ed89 100644 --- a/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/Makefile +++ b/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/Makefile @@ -201,8 +201,8 @@ CPPWARN = -Wall -Wextra -Wundef # List all user C define here, like -D_DEBUG=1 UDEFS = -DCHPRINTF_USE_FLOAT=1 -DSHELL_CMD_TEST_ENABLED=0 \ - -DLSM303DLHC_ACC_USE_ADVANCED=0 -DLSM303DLHC_COMP_USE_ADVANCED=0 - + -DLSM303DLHC_ACC_USE_ADVANCED=0 -DLSM303DLHC_COMP_USE_ADVANCED=0 \ + -DLSM303DLHC_SHARED_I2C=0 # Define ASM defines here UADEFS = diff --git a/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/main.c b/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/main.c index fb3adc819..b7fa1a455 100644 --- a/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/main.c +++ b/testhal/STM32/STM32F4xx/I2C-LSM303DLHC/main.c @@ -46,8 +46,8 @@ static const I2CConfig i2ccfg = { }; static const LSM303DLHCAccConfig lsm303dlhcacccfg = { - {0, 0, 0}, /* Use default sensitivity.*/ - {0, 0, 0}, /* Use default bias.*/ + NULL, /* Use default sensitivity.*/ + NULL, /* Use default bias.*/ LSM303DLHC_ACC_FS_4G, /* Full scale value 2g.*/ LSM303DLHC_ACC_ODR_100Hz, /* Output data rate 100 Hz.*/ #if LSM303DLHC_ACC_USE_ADVANCED || defined(__DOXYGEN__) @@ -59,6 +59,8 @@ static const LSM303DLHCAccConfig lsm303dlhcacccfg = { }; static const LSM303DLHCCompConfig lsm303dlhccompcfg = { + NULL, /* Use default sensitivity.*/ + NULL, /* Use default bias.*/ LSM303DLHC_COMP_FS_1P3GA, /* Full scale value 1.3 Gauss.*/ LSM303DLHC_COMP_ODR_30HZ, /* Output data rate 30 Hz.*/ #if LSM303DLHC_COMP_USE_ADVANCED || defined(__DOXYGEN__) -- cgit v1.2.3