From 33fef46dacbefdc4ef4684eb97d3575fbf021146 Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Sun, 27 Jan 2019 14:59:38 +0000 Subject: [PATCH] Updated testes/STM32/STM32F4xx demos for STM32F4 Discovery to be compliant with new project organization/makefile mechanisms Batch review of *_USE_ADVANCED macros git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12618 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/ex/ST/l3gd20.c | 8 +- os/ex/ST/l3gd20.h | 13 +- os/ex/ST/lis302dl.h | 11 +- os/ex/ST/lis3dsh.h | 13 +- os/ex/ST/lis3mdl.c | 8 +- os/ex/ST/lis3mdl.h | 10 +- os/ex/ST/lps22hb.h | 9 +- os/ex/ST/lps25h.h | 7 +- os/ex/ST/lsm303agr.c | 6 +- os/ex/ST/lsm303agr.h | 25 +--- os/ex/ST/lsm303dlhc.c | 6 +- os/ex/ST/lsm303dlhc.h | 25 +--- os/ex/ST/lsm6ds0.c | 6 +- os/ex/ST/lsm6ds0.h | 32 +---- os/ex/ST/lsm6dsl.c | 8 +- os/ex/ST/lsm6dsl.h | 32 +---- testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c | 4 +- testex/STM32/STM32F3xx/SPI-L3GD20/main.c | 2 +- testex/STM32/STM32F4xx/I2C-LIS3MDL/main.c | 2 +- testex/STM32/STM32F4xx/I2C-LSM303AGR/main.c | 4 +- testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c | 4 +- testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c | 6 +- testex/STM32/STM32F4xx/I2C-LSM6DSL/main.c | 6 +- testex/STM32/STM32F4xx/SPI-L3GD20/main.c | 2 +- testex/STM32/STM32F4xx/SPI-LIS302DL/Makefile | 138 +++++++------------ testex/STM32/STM32F4xx/SPI-LIS3DSH/Makefile | 138 +++++++------------ testex/STM32/STM32L4xx/SPI-L3GD20/main.c | 4 +- 27 files changed, 189 insertions(+), 340 deletions(-) diff --git a/os/ex/ST/l3gd20.c b/os/ex/ST/l3gd20.c index 9fa670260..fc8aff074 100644 --- a/os/ex/ST/l3gd20.c +++ b/os/ex/ST/l3gd20.c @@ -502,14 +502,14 @@ void l3gd20Start(L3GD20Driver *devp, const L3GD20Config *config) { cr[0] = L3GD20_CTRL_REG1_XEN | L3GD20_CTRL_REG1_YEN | L3GD20_CTRL_REG1_ZEN | L3GD20_CTRL_REG1_PD | devp->config->gyrooutputdatarate; -#if L3GD20_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) cr[0] |= devp->config->gyrobandwidth; #endif } /* Control register 2 configuration block.*/ { -#if L3GD20_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) if(devp->config->gyrohpmode != L3GD20_HPM_BYPASSED) cr[1] = devp->config->gyrohpmode | devp->config->gyrohpconfiguration; #endif @@ -518,7 +518,7 @@ void l3gd20Start(L3GD20Driver *devp, const L3GD20Config *config) { /* Control register 4 configuration block.*/ { cr[3] = devp->config->gyrofullscale; -#if L3GD20_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) cr[3] |= devp->config->gyroblockdataupdate | devp->config->gyroendianness; #endif @@ -526,7 +526,7 @@ void l3gd20Start(L3GD20Driver *devp, const L3GD20Config *config) { /* Control register 5 configuration block.*/ { -#if L3GD20_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) if((devp->config->gyrohpmode != L3GD20_HPM_BYPASSED)) { cr[4] = L3GD20_CTRL_REG5_HPEN; if(devp->config->gyrolp2mode != L3GD20_LP2M_BYPASSED) { diff --git a/os/ex/ST/l3gd20.h b/os/ex/ST/l3gd20.h index bea56432c..35d615f32 100644 --- a/os/ex/ST/l3gd20.h +++ b/os/ex/ST/l3gd20.h @@ -42,7 +42,7 @@ /** * @brief L3GD20 driver version string. */ -#define EX_L3GD20_VERSION "1.1.1" +#define EX_L3GD20_VERSION "1.1.2" /** * @brief L3GD20 driver version major number. @@ -57,7 +57,7 @@ /** * @brief L3GD20 driver version patch number. */ -#define EX_L3GD20_PATCH 1 +#define EX_L3GD20_PATCH 2 /** @} */ /** @@ -271,13 +271,12 @@ #endif /** - * @brief L3GD20 accelerometer subsystem advanced configurations - * switch. + * @brief L3GD20 advanced configurations switch. * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ -#if !defined(L3GD20_GYRO_USE_ADVANCED) || defined(__DOXYGEN__) -#define L3GD20_GYRO_USE_ADVANCED FALSE +#if !defined(L3GD20_USE_ADVANCED) || defined(__DOXYGEN__) +#define L3GD20_USE_ADVANCED FALSE #endif /** @@ -472,7 +471,7 @@ typedef struct { * @brief L3GD20 gyroscope system output data rate selection. */ l3gd20_odr_t gyrooutputdatarate; -#if L3GD20_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if L3GD20_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief L3GD20 gyroscope system block data update. */ diff --git a/os/ex/ST/lis302dl.h b/os/ex/ST/lis302dl.h index 6c8fa864e..e61957da7 100644 --- a/os/ex/ST/lis302dl.h +++ b/os/ex/ST/lis302dl.h @@ -43,7 +43,7 @@ /** * @brief LIS302DL driver version string. */ -#define EX_LIS302DL_VERSION "1.1.0" +#define EX_LIS302DL_VERSION "1.1.1" /** * @brief LIS302DL driver version major number. @@ -58,7 +58,7 @@ /** * @brief LIS302DL driver version patch number. */ -#define EX_LIS302DL_PATCH 0 +#define EX_LIS302DL_PATCH 1 /** @} */ /** @@ -214,13 +214,12 @@ #endif /** - * @brief LIS302DL accelerometer subsystem advanced configurations - * switch. + * @brief LIS302DL advanced configurations switch. * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ -#if !defined(LIS302DL_ACC_USE_ADVANCED) || defined(__DOXYGEN__) -#define LIS302DL_ACC_USE_ADVANCED FALSE +#if !defined(LIS302DL_USE_ADVANCED) || defined(__DOXYGEN__) +#define LIS302DL_USE_ADVANCED FALSE #endif /** @} */ diff --git a/os/ex/ST/lis3dsh.h b/os/ex/ST/lis3dsh.h index 26dafcd38..80973e897 100644 --- a/os/ex/ST/lis3dsh.h +++ b/os/ex/ST/lis3dsh.h @@ -43,7 +43,7 @@ /** * @brief LIS3DSH driver version string. */ -#define EX_LIS3DSH_VERSION "1.1.1" +#define EX_LIS3DSH_VERSION "1.1.2" /** * @brief LIS3DSH driver version major number. @@ -58,7 +58,7 @@ /** * @brief LIS3DSH driver version patch number. */ -#define EX_LIS3DSH_PATCH 1 +#define EX_LIS3DSH_PATCH 2 /** @} */ /** @@ -333,13 +333,12 @@ #endif /** - * @brief LIS3DSH accelerometer subsystem advanced configurations - * switch. + * @brief LIS3DSH advanced configurations switch. * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ -#if !defined(LIS3DSH_ACC_USE_ADVANCED) || defined(__DOXYGEN__) -#define LIS3DSH_ACC_USE_ADVANCED FALSE +#if !defined(LIS3DSH_USE_ADVANCED) || defined(__DOXYGEN__) +#define LIS3DSH_USE_ADVANCED FALSE #endif /** @} */ @@ -482,7 +481,7 @@ typedef struct { * @brief LIS3DSH output data rate selection. */ lis3dsh_acc_odr_t accoutputdatarate; -#if LIS3DSH_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LIS3DSH_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LIS3DSH anti-aliasing bandwidth. */ diff --git a/os/ex/ST/lis3mdl.c b/os/ex/ST/lis3mdl.c index 559564744..796cc2486 100644 --- a/os/ex/ST/lis3mdl.c +++ b/os/ex/ST/lis3mdl.c @@ -476,7 +476,7 @@ void lis3mdlStart(LIS3MDLDriver *devp, const LIS3MDLConfig *config) { { cr[0] = LIS3MDL_AD_CTRL_REG1; cr[1] = devp->config->compoutputdatarate; -#if LIS3MDL_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LIS3MDL_USE_ADVANCED || defined(__DOXYGEN__) cr[1] |= devp->config->compoperationmodexy; #else cr[1] |= LIS3MDL_CTRL_REG1_OM0 | LIS3MDL_CTRL_REG1_OM1; @@ -491,7 +491,7 @@ void lis3mdlStart(LIS3MDLDriver *devp, const LIS3MDLConfig *config) { /* Control register 3 configuration block.*/ { cr[3] = 0; -#if LIS3MDL_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LIS3MDL_USE_ADVANCED || defined(__DOXYGEN__) cr[3] = devp->config->compconversionmode; #endif } @@ -499,7 +499,7 @@ void lis3mdlStart(LIS3MDLDriver *devp, const LIS3MDLConfig *config) { /* Control register 4 configuration block.*/ { cr[4] = 0; -#if LIS3MDL_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LIS3MDL_USE_ADVANCED || defined(__DOXYGEN__) cr[4] = devp->config->compoperationmodez | devp->config->endianness; #endif } @@ -507,7 +507,7 @@ void lis3mdlStart(LIS3MDLDriver *devp, const LIS3MDLConfig *config) { /* Control register 5 configuration block.*/ { cr[5] = 0; -#if LIS3MDL_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LIS3MDL_USE_ADVANCED || defined(__DOXYGEN__) cr[5] = devp->config->blockdataupdate; #endif } diff --git a/os/ex/ST/lis3mdl.h b/os/ex/ST/lis3mdl.h index 96def428d..3a5d62017 100644 --- a/os/ex/ST/lis3mdl.h +++ b/os/ex/ST/lis3mdl.h @@ -42,7 +42,7 @@ /** * @brief LIS3MDL driver version string. */ -#define EX_LIS3MDL_VERSION "1.1.1" +#define EX_LIS3MDL_VERSION "1.1.2" /** * @brief LIS3MDL driver version major number. @@ -57,7 +57,7 @@ /** * @brief LIS3MDL driver version patch number. */ -#define EX_LIS3MDL_PATCH 1 +#define EX_LIS3MDL_PATCH 2 /** @} */ /** @@ -229,8 +229,8 @@ * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ -#if !defined(LIS3MDL_COMP_USE_ADVANCED) || defined(__DOXYGEN__) -#define LIS3MDL_COMP_USE_ADVANCED FALSE +#if !defined(LIS3MDL_USE_ADVANCED) || defined(__DOXYGEN__) +#define LIS3MDL_USE_ADVANCED FALSE #endif /** @} */ @@ -428,7 +428,7 @@ typedef struct { * @brief LIS3MDL compass subsystem output data rate. */ lis3mdl_comp_odr_t compoutputdatarate; -#if LIS3MDL_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LIS3MDL_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LIS3MDL compass subsystem low power mode configuration. */ diff --git a/os/ex/ST/lps22hb.h b/os/ex/ST/lps22hb.h index bbeae4c0f..dee503d09 100644 --- a/os/ex/ST/lps22hb.h +++ b/os/ex/ST/lps22hb.h @@ -43,7 +43,7 @@ /** * @brief LPS22HB driver version string. */ -#define EX_LPS22HB_VERSION "1.0.0" +#define EX_LPS22HB_VERSION "1.0.1" /** * @brief LPS22HB driver version major number. @@ -58,7 +58,7 @@ /** * @brief LPS22HB driver version patch number. */ -#define EX_LPS22HB_PATCH 0 +#define EX_LPS22HB_PATCH 1 /** @} */ /** @@ -247,8 +247,7 @@ #endif /** - * @brief LPS22HB accelerometer subsystem advanced configurations - * switch. + * @brief LPS22HB advanced configurations switch. * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ @@ -402,7 +401,7 @@ typedef struct { */ lps22hb_bdu_t blockdataupdate; /** - * @brief LPS22HB barometer subsystem resolution. + * @brief LPS22HB barometer subsystem resolution. */ lps22hb_lp_t lowpass_filter; #endif diff --git a/os/ex/ST/lps25h.h b/os/ex/ST/lps25h.h index ffc894cbb..eb1f3a9e2 100644 --- a/os/ex/ST/lps25h.h +++ b/os/ex/ST/lps25h.h @@ -43,7 +43,7 @@ /** * @brief LPS25H driver version string. */ -#define EX_LPS25H_VERSION "1.1.1" +#define EX_LPS25H_VERSION "1.1.2" /** * @brief LPS25H driver version major number. @@ -58,7 +58,7 @@ /** * @brief LPS25H driver version patch number. */ -#define EX_LPS25H_PATCH 1 +#define EX_LPS25H_PATCH 2 /** @} */ /** @@ -249,8 +249,7 @@ #endif /** - * @brief LPS25H accelerometer subsystem advanced configurations - * switch. + * @brief LPS25H advanced configurations switch. * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ diff --git a/os/ex/ST/lsm303agr.c b/os/ex/ST/lsm303agr.c index 415364d03..73e57a84d 100644 --- a/os/ex/ST/lsm303agr.c +++ b/os/ex/ST/lsm303agr.c @@ -727,7 +727,7 @@ void lsm303agrStart(LSM303AGRDriver *devp, const LSM303AGRConfig *config) { /* Control register 1 configuration block.*/ { cr[1] = LSM303AGR_ACC_AE_XYZ | devp->config->accoutdatarate; -#if LSM303AGR_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303AGR_USE_ADVANCED || defined(__DOXYGEN__) if(devp->config->accmode == LSM303AGR_ACC_MODE_LPOW) cr[1] |= LSM303AGR_CTRL_REG1_A_LPEN; #endif @@ -746,7 +746,7 @@ void lsm303agrStart(LSM303AGRDriver *devp, const LSM303AGRConfig *config) { /* Control register 4 configuration block.*/ { cr[4] = devp->config->accfullscale; -#if LSM303AGR_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303AGR_USE_ADVANCED || defined(__DOXYGEN__) cr[4] |= devp->config->accendianess | devp->config->accblockdataupdate; if(devp->config->accmode == LSM303AGR_ACC_MODE_HRES) @@ -820,7 +820,7 @@ void lsm303agrStart(LSM303AGRDriver *devp, const LSM303AGRConfig *config) { /* Control register A configuration block.*/ { cr[1] = devp->config->compoutputdatarate; -#if LSM303AGR_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303AGR_USE_ADVANCED || defined(__DOXYGEN__) cr[1] |= devp->config->compmode | devp->config->complp; #endif } diff --git a/os/ex/ST/lsm303agr.h b/os/ex/ST/lsm303agr.h index 7e532ab92..89eb552f9 100644 --- a/os/ex/ST/lsm303agr.h +++ b/os/ex/ST/lsm303agr.h @@ -43,7 +43,7 @@ /** * @brief LSM303AGR driver version string. */ -#define EX_LSM303AGR_VERSION "1.0.0" +#define EX_LSM303AGR_VERSION "1.0.1" /** * @brief LSM303AGR driver version major number. @@ -58,7 +58,7 @@ /** * @brief LSM303AGR driver version patch number. */ -#define EX_LSM303AGR_PATCH 0 +#define EX_LSM303AGR_PATCH 1 /** @} */ /** @@ -348,23 +348,12 @@ #endif /** - * @brief LSM303AGR accelerometer subsystem advanced configurations - * switch. + * @brief LSM303AGR advanced configurations switch. * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ -#if !defined(LSM303AGR_ACC_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM303AGR_ACC_USE_ADVANCED FALSE -#endif - -/** - * @brief LSM303AGR compass subsystem advanced configurations - * switch. - * @details If set to @p TRUE more configurations are available. - * @note The default is @p FALSE. - */ -#if !defined(LSM303AGR_COMP_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM303AGR_COMP_USE_ADVANCED FALSE +#if !defined(LSM303AGR_USE_ADVANCED) || defined(__DOXYGEN__) +#define LSM303AGR_USE_ADVANCED FALSE #endif /** @} */ @@ -549,7 +538,7 @@ typedef struct { * @brief LSM303AGR accelerometer subsystem output data rate. */ lsm303agr_acc_odr_t accoutdatarate; -#if LSM303AGR_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303AGR_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM303AGR accelerometer subsystem mode. */ @@ -575,7 +564,7 @@ typedef struct { * @brief LSM303AGR compass subsystem output data rate. */ lsm303agr_comp_odr_t compoutputdatarate; -#if LSM303AGR_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303AGR_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM303AGR compass subsystem working mode. */ diff --git a/os/ex/ST/lsm303dlhc.c b/os/ex/ST/lsm303dlhc.c index 8fa988ab7..abf5fcbbd 100644 --- a/os/ex/ST/lsm303dlhc.c +++ b/os/ex/ST/lsm303dlhc.c @@ -885,7 +885,7 @@ void lsm303dlhcStart(LSM303DLHCDriver *devp, const LSM303DLHCConfig *config) { { cr[1] = LSM303DLHC_CTRL_REG1_A_XEN | LSM303DLHC_CTRL_REG1_A_YEN | LSM303DLHC_CTRL_REG1_A_ZEN | devp->config->accoutdatarate; -#if LSM303DLHC_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303DLHC_USE_ADVANCED || defined(__DOXYGEN__) cr[1] |= devp->config->acclowpower; #endif } @@ -903,7 +903,7 @@ void lsm303dlhcStart(LSM303DLHCDriver *devp, const LSM303DLHCConfig *config) { /* Control register 4 configuration block.*/ { cr[4] = devp->config->accfullscale; -#if LSM303DLHC_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303DLHC_USE_ADVANCED || defined(__DOXYGEN__) cr[4] |= devp->config->accendianess | devp->config->accblockdataupdate | devp->config->acchighresmode; @@ -986,7 +986,7 @@ void lsm303dlhcStart(LSM303DLHCDriver *devp, const LSM303DLHCConfig *config) { /* Mode register configuration block.*/ { cr[3] = 0; -#if LSM303DLHC_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303DLHC_USE_ADVANCED || defined(__DOXYGEN__) cr[3] |= devp->config->compmode; #endif } diff --git a/os/ex/ST/lsm303dlhc.h b/os/ex/ST/lsm303dlhc.h index 626ea1383..9eb320e87 100644 --- a/os/ex/ST/lsm303dlhc.h +++ b/os/ex/ST/lsm303dlhc.h @@ -43,7 +43,7 @@ /** * @brief LSM303DLHC driver version string. */ -#define EX_LSM303DLHC_VERSION "1.1.1" +#define EX_LSM303DLHC_VERSION "1.1.2" /** * @brief LSM303DLHC driver version major number. @@ -58,7 +58,7 @@ /** * @brief LSM303DLHC driver version patch number. */ -#define EX_LSM303DLHC_PATCH 1 +#define EX_LSM303DLHC_PATCH 2 /** @} */ /** @@ -343,23 +343,12 @@ #endif /** - * @brief LSM303DLHC accelerometer subsystem advanced configurations - * switch. + * @brief LSM303DLHC advanced configurations switch. * @details If set to @p TRUE more configurations are available. * @note The default is @p FALSE. */ -#if !defined(LSM303DLHC_ACC_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM303DLHC_ACC_USE_ADVANCED FALSE -#endif - -/** - * @brief LSM303DLHC compass subsystem advanced configurations - * switch. - * @details If set to @p TRUE more configurations are available. - * @note The default is @p FALSE. - */ -#if !defined(LSM303DLHC_COMP_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM303DLHC_COMP_USE_ADVANCED FALSE +#if !defined(LSM303DLHC_USE_ADVANCED) || defined(__DOXYGEN__) +#define LSM303DLHC_USE_ADVANCED FALSE #endif /** @} */ @@ -560,7 +549,7 @@ typedef struct { * @brief LSM303DLHC accelerometer subsystem output data rate. */ lsm303dlhc_acc_odr_t accoutdatarate; -#if LSM303DLHC_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303DLHC_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM303DLHC accelerometer subsystem low power mode. */ @@ -594,7 +583,7 @@ typedef struct { * @brief LSM303DLHC compass subsystem output data rate. */ lsm303dlhc_comp_odr_t compoutputdatarate; -#if LSM303DLHC_COMP_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM303DLHC_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM303DLHC compass subsystem working mode. */ diff --git a/os/ex/ST/lsm6ds0.c b/os/ex/ST/lsm6ds0.c index 144af65fc..a4ca75f3a 100644 --- a/os/ex/ST/lsm6ds0.c +++ b/os/ex/ST/lsm6ds0.c @@ -881,7 +881,7 @@ void lsm6ds0Start(LSM6DS0Driver *devp, const LSM6DS0Config *config) { { cr[1] = LSM6DS0_CTRL_REG5_XL_XEN_XL | LSM6DS0_CTRL_REG5_XL_YEN_XL | LSM6DS0_CTRL_REG5_XL_ZEN_XL; -#if LSM6DS0_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__) cr[1] |= devp->config->accdecmode; #endif } @@ -967,7 +967,7 @@ void lsm6ds0Start(LSM6DS0Driver *devp, const LSM6DS0Config *config) { /* Control register 2 configuration block.*/ { cr[2] = 0; -#if LSM6DS0_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__) cr[2] |= devp->config->gyrooutsel; #endif } @@ -975,7 +975,7 @@ void lsm6ds0Start(LSM6DS0Driver *devp, const LSM6DS0Config *config) { /* Control register 3 configuration block.*/ { cr[3] = 0; -#if LSM6DS0_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__) cr[3] |= devp->config->gyrohpfenable | devp->config->gyrolowmodecfg | devp->config->gyrohpcfg; diff --git a/os/ex/ST/lsm6ds0.h b/os/ex/ST/lsm6ds0.h index 0f8fdabd1..30ac7665c 100644 --- a/os/ex/ST/lsm6ds0.h +++ b/os/ex/ST/lsm6ds0.h @@ -43,7 +43,7 @@ /** * @brief LSM6DS0 driver version string. */ -#define EX_LSM6DS0_VERSION "1.1.1" +#define EX_LSM6DS0_VERSION "1.1.2" /** * @brief LSM6DS0 driver version major number. @@ -58,7 +58,7 @@ /** * @brief LSM6DS0 driver version patch number. */ -#define EX_LSM6DS0_PATCH 1 +#define EX_LSM6DS0_PATCH 2 /** @} */ /** @@ -354,26 +354,6 @@ #define LSM6DS0_USE_ADVANCED FALSE #endif -/** - * @brief LSM6DS0 accelerometer subsystem advanced configurations - * switch. - * @details If set to @p TRUE more configurations are available. - * @note The default is @p FALSE. - */ -#if !defined(LSM6DS0_ACC_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM6DS0_ACC_USE_ADVANCED FALSE -#endif - -/** - * @brief LSM6DS0 gyroscope subsystem advanced configurations - * switch. - * @details If set to @p TRUE more configurations are available. - * @note The default is @p FALSE. - */ -#if !defined(LSM6DS0_GYRO_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM6DS0_GYRO_USE_ADVANCED FALSE -#endif - /** * @brief Number of acquisitions for gyroscope bias removal. * @details This is the number of acquisitions performed to compute the @@ -622,12 +602,12 @@ typedef struct { * @brief LSM6DS0 accelerometer subsystem output data rate. */ lsm6ds0_acc_odr_t accoutdatarate; -#if LSM6DS0_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM6DS0 accelerometer subsystem decimation mode. */ lsm6ds0_acc_dec_t accdecmode; -#endif /* LSM6DS0_ACC_USE_ADVANCED */ +#endif /* LSM6DS0_USE_ADVANCED */ /** * @brief LSM6DS0 gyroscope subsystem initial sensitivity. */ @@ -644,7 +624,7 @@ typedef struct { * @brief LSM6DS0 gyroscope subsystem output data rate. */ lsm6ds0_gyro_odr_t gyrooutdatarate; -#if LSM6DS0_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM6DS0 gyroscope subsystem low mode configuration. */ @@ -661,8 +641,6 @@ typedef struct { * @brief LSM6DS0 gyroscope subsystem high pass filter configuration. */ lsm6ds0_gyro_hpcf_t gyrohpcfg; - #endif /* LSM6DS0_GYRO_USE_ADVANCED */ -#if (LSM6DS0_USE_ADVANCED) || defined(__DOXYGEN__) /** * @brief LSM6DS0 block data update */ diff --git a/os/ex/ST/lsm6dsl.c b/os/ex/ST/lsm6dsl.c index c8d22ab8b..be1aef848 100644 --- a/os/ex/ST/lsm6dsl.c +++ b/os/ex/ST/lsm6dsl.c @@ -903,7 +903,7 @@ void lsm6dslStart(LSM6DSLDriver *devp, const LSM6DSLConfig *config) { /* Control register 4 configuration block.*/ { cr[4] = 0; -#if LSM6DSL_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DSL_USE_ADVANCED || defined(__DOXYGEN__) if(devp->config->gyrolowpassfilter != LSM6DSL_GYRO_LPF_DISABLED) { cr[4] |= LSMDSL_CTRL4_C_LPF1_SEL_G; } @@ -919,11 +919,11 @@ void lsm6dslStart(LSM6DSLDriver *devp, const LSM6DSLConfig *config) { /* Control register 6 configuration block.*/ { cr[6] = 0; -#if LSM6DSL_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DSL_USE_ADVANCED || defined(__DOXYGEN__) cr[6] |= devp->config->acclpmode; #endif -#if LSM6DSL_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DSL_USE_ADVANCED || defined(__DOXYGEN__) if(devp->config->gyrolowpassfilter != LSM6DSL_GYRO_LPF_DISABLED) { cr[6] |= devp->config->gyrolowpassfilter; } @@ -935,7 +935,7 @@ void lsm6dslStart(LSM6DSLDriver *devp, const LSM6DSLConfig *config) { /* Control register 7 configuration block.*/ { cr[7] = 0; -#if LSM6DSL_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DSL_USE_ADVANCED || defined(__DOXYGEN__) cr[7] |= devp->config->gyrolpmode; #endif diff --git a/os/ex/ST/lsm6dsl.h b/os/ex/ST/lsm6dsl.h index 0ad2d4143..9ed1ac70e 100644 --- a/os/ex/ST/lsm6dsl.h +++ b/os/ex/ST/lsm6dsl.h @@ -43,7 +43,7 @@ /** * @brief LSM6DSL driver version string. */ -#define EX_LSM6DSL_VERSION "1.0.0" +#define EX_LSM6DSL_VERSION "1.0.1" /** * @brief LSM6DSL driver version major number. @@ -58,7 +58,7 @@ /** * @brief LSM6DSL driver version patch number. */ -#define EX_LSM6DSL_PATCH 0 +#define EX_LSM6DSL_PATCH 1 /** @} */ /** @@ -407,26 +407,6 @@ #define LSM6DSL_USE_ADVANCED FALSE #endif -/** - * @brief LSM6DSL accelerometer subsystem advanced configurations - * switch. - * @details If set to @p TRUE more configurations are available. - * @note The default is @p FALSE. - */ -#if !defined(LSM6DSL_ACC_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM6DSL_ACC_USE_ADVANCED FALSE -#endif - -/** - * @brief LSM6DSL gyroscope subsystem advanced configurations - * switch. - * @details If set to @p TRUE more configurations are available. - * @note The default is @p FALSE. - */ -#if !defined(LSM6DSL_GYRO_USE_ADVANCED) || defined(__DOXYGEN__) -#define LSM6DSL_GYRO_USE_ADVANCED FALSE -#endif - /** * @brief Number of acquisitions for gyroscope bias removal. * @details This is the number of acquisitions performed to compute the @@ -651,12 +631,12 @@ typedef struct { * @brief LSM6DSL accelerometer subsystem output data rate. */ lsm6dsl_acc_odr_t accoutdatarate; -#if LSM6DSL_ACC_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DSL_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM6DSL accelerometer subsystem low power mode. */ lsm6dsl_acc_lp_t acclpmode; -#endif /* LSM6DSL_ACC_USE_ADVANCED */ +#endif /* LSM6DSL_USE_ADVANCED */ /** * @brief LSM6DSL gyroscope subsystem initial sensitivity. */ @@ -673,7 +653,7 @@ typedef struct { * @brief LSM6DSL gyroscope subsystem output data rate. */ lsm6dsl_gyro_odr_t gyrooutdatarate; -#if LSM6DSL_GYRO_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DSL_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LSM6DSL gyroscope subsystem low mode configuration. */ @@ -682,8 +662,6 @@ typedef struct { * @brief LSM6DSL gyroscope subsystem low pass filter configuration. */ lsm6dsl_gyro_lpf_t gyrolowpassfilter; -#endif /* LSM6DSL_GYRO_USE_ADVANCED */ -#if (LSM6DSL_USE_ADVANCED) || defined(__DOXYGEN__) /** * @brief LSM6DSL block data update */ diff --git a/testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c b/testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c index 5720547c5..9b4ec074b 100644 --- a/testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c +++ b/testex/STM32/STM32F3xx/I2C-LSM303DLHC/main.c @@ -53,7 +53,7 @@ static const LSM303DLHCConfig lsm303dlhccfg = { NULL, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_ODR_100Hz, -#if LSM303DLHC_ACC_USE_ADVANCED +#if LSM303DLHC_USE_ADVANCED LSM303DLHC_ACC_LP_DISABLED, LSM303DLHC_ACC_HR_DISABLED, LSM303DLHC_ACC_BDU_BLOCK, @@ -63,7 +63,7 @@ static const LSM303DLHCConfig lsm303dlhccfg = { NULL, LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_ODR_30HZ, -#if LSM303DLHC_COMP_USE_ADVANCED +#if LSM303DLHC_USE_ADVANCED LSM303DLHC_COMP_MD_BLOCK #endif }; diff --git a/testex/STM32/STM32F3xx/SPI-L3GD20/main.c b/testex/STM32/STM32F3xx/SPI-L3GD20/main.c index 79baaa44d..31379de73 100644 --- a/testex/STM32/STM32F3xx/SPI-L3GD20/main.c +++ b/testex/STM32/STM32F3xx/SPI-L3GD20/main.c @@ -51,7 +51,7 @@ static L3GD20Config l3gd20cfg = { NULL, L3GD20_FS_250DPS, L3GD20_ODR_760HZ, -#if L3GD20_GYRO_USE_ADVANCED +#if L3GD20_USE_ADVANCED L3GD20_BDU_CONTINUOUS, L3GD20_END_LITTLE, L3GD20_BW3, diff --git a/testex/STM32/STM32F4xx/I2C-LIS3MDL/main.c b/testex/STM32/STM32F4xx/I2C-LIS3MDL/main.c index a80a8b0a5..4689d15ec 100644 --- a/testex/STM32/STM32F4xx/I2C-LIS3MDL/main.c +++ b/testex/STM32/STM32F4xx/I2C-LIS3MDL/main.c @@ -49,7 +49,7 @@ static LIS3MDLConfig lis3mdlcfg = { NULL, LIS3MDL_COMP_FS_4GA, LIS3MDL_COMP_ODR_40HZ, -#if LIS3MDL_COMP_USE_ADVANCED +#if LIS3MDL_USE_ADVANCED LIS3MDL_COMP_LP_ENABLED, LIS3MDL_COMP_MD_CONTINUOUS, LIS3MDL_COMP_OMXY_LP, diff --git a/testex/STM32/STM32F4xx/I2C-LSM303AGR/main.c b/testex/STM32/STM32F4xx/I2C-LSM303AGR/main.c index d2c7d6b01..e042c2eeb 100644 --- a/testex/STM32/STM32F4xx/I2C-LSM303AGR/main.c +++ b/testex/STM32/STM32F4xx/I2C-LSM303AGR/main.c @@ -51,7 +51,7 @@ static const LSM303AGRConfig lsm303agrcfg = { NULL, LSM303AGR_ACC_FS_4G, LSM303AGR_ACC_ODR_100Hz, -#if LSM303AGR_ACC_USE_ADVANCED +#if LSM303AGR_USE_ADVANCED LSM303AGR_ACC_MODE_LPOW, LSM303AGR_ACC_BDU_BLOCK, LSM303AGR_ACC_END_LITTLE, @@ -59,7 +59,7 @@ static const LSM303AGRConfig lsm303agrcfg = { NULL, NULL, LSM303AGR_COMP_ODR_50HZ, -#if LSM303AGR_COMP_USE_ADVANCED +#if LSM303AGR_USE_ADVANCED LSM303AGR_COMP_MODE_NORM, LSM303AGR_COMP_LPOW_EN #endif diff --git a/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c index 15b530064..723d4be3d 100644 --- a/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c +++ b/testex/STM32/STM32F4xx/I2C-LSM303DLHC/main.c @@ -52,7 +52,7 @@ static const LSM303DLHCConfig lsm303dlhccfg = { NULL, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_ODR_100Hz, -#if LSM303DLHC_ACC_USE_ADVANCED +#if LSM303DLHC_USE_ADVANCED LSM303DLHC_ACC_LP_DISABLED, LSM303DLHC_ACC_HR_DISABLED, LSM303DLHC_ACC_BDU_BLOCK, @@ -62,7 +62,7 @@ static const LSM303DLHCConfig lsm303dlhccfg = { NULL, LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_ODR_30HZ, -#if LSM303DLHC_COMP_USE_ADVANCED +#if LSM303DLHC_USE_ADVANCED LSM303DLHC_COMP_MD_BLOCK #endif }; diff --git a/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c b/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c index 48345bb57..51327a5c4 100644 --- a/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c +++ b/testex/STM32/STM32F4xx/I2C-LSM6DS0/main.c @@ -52,20 +52,20 @@ static const LSM6DS0Config lsm6ds0cfg = { NULL, LSM6DS0_ACC_FS_2G, LSM6DS0_ACC_ODR_50Hz, -#if LSM6DS0_ACC_USE_ADVANCED +#if LSM6DS0_USE_ADVANCED LSM6DS0_ACC_DEC_X4, #endif NULL, NULL, LSM6DS0_GYRO_FS_245DPS, LSM6DS0_GYRO_ODR_119HZ_FC_31, -#if LSM6DS0_GYRO_USE_ADVANCED +#if LSM6DS0_USE_ADVANCED LSM6DS0_GYRO_LP_DISABLED, LSM6DS0_GYRO_OUT_SEL_0, LSM6DS0_GYRO_HP_DISABLED, LSM6DS0_GYRO_HPCF_0, #endif -#if LSM6DS0_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DS0_USE_ADVANCED LSM6DS0_BDU_BLOCKED, LSM6DS0_END_LITTLE #endif diff --git a/testex/STM32/STM32F4xx/I2C-LSM6DSL/main.c b/testex/STM32/STM32F4xx/I2C-LSM6DSL/main.c index 9cb9000b1..c96b1c0ec 100644 --- a/testex/STM32/STM32F4xx/I2C-LSM6DSL/main.c +++ b/testex/STM32/STM32F4xx/I2C-LSM6DSL/main.c @@ -52,18 +52,18 @@ static const LSM6DSLConfig lsm6dslcfg = { NULL, LSM6DSL_ACC_FS_2G, LSM6DSL_GYRO_ODR_52Hz, -#if LSM6DSL_ACC_USE_ADVANCED +#if LSM6DSL_USE_ADVANCED LSM6DSL_ACC_LP_ENABLED, #endif NULL, NULL, LSM6DSL_GYRO_FS_250DPS, LSM6DSL_GYRO_ODR_104Hz, -#if LSM6DSL_GYRO_USE_ADVANCED +#if LSM6DSL_USE_ADVANCED LSM6DSL_GYRO_LP_ENABLED, LSM6DSL_GYRO_LPF_FTYPE1, #endif -#if LSM6DSL_USE_ADVANCED || defined(__DOXYGEN__) +#if LSM6DSL_USE_ADVANCED LSM6DSL_BDU_BLOCKED, LSM6DSL_END_LITTLE #endif diff --git a/testex/STM32/STM32F4xx/SPI-L3GD20/main.c b/testex/STM32/STM32F4xx/SPI-L3GD20/main.c index c6860e828..08e0dadbb 100644 --- a/testex/STM32/STM32F4xx/SPI-L3GD20/main.c +++ b/testex/STM32/STM32F4xx/SPI-L3GD20/main.c @@ -52,7 +52,7 @@ static L3GD20Config l3gd20cfg = { NULL, L3GD20_FS_250DPS, L3GD20_ODR_760HZ, -#if L3GD20_GYRO_USE_ADVANCED +#if L3GD20_USE_ADVANCED L3GD20_BDU_CONTINUOUS, L3GD20_END_LITTLE, L3GD20_BW3, diff --git a/testex/STM32/STM32F4xx/SPI-LIS302DL/Makefile b/testex/STM32/STM32F4xx/SPI-LIS302DL/Makefile index 904918942..1f3736156 100644 --- a/testex/STM32/STM32F4xx/SPI-LIS302DL/Makefile +++ b/testex/STM32/STM32F4xx/SPI-LIS302DL/Makefile @@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),) USE_CPPOPT = -fno-rtti endif -# Enable this if you want the linker to remove unused code and data +# Enable this if you want the linker to remove unused code and data. ifeq ($(USE_LINK_GC),) USE_LINK_GC = yes endif @@ -28,16 +28,11 @@ ifeq ($(USE_LDOPT),) USE_LDOPT = endif -# Enable this if you want link time optimizations (LTO) +# Enable this if you want link time optimizations (LTO). ifeq ($(USE_LTO),) USE_LTO = yes endif -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - # Enable this if you want to see the full log while compiling. ifeq ($(USE_VERBOSE_COMPILE),) USE_VERBOSE_COMPILE = no @@ -71,7 +66,12 @@ endif # Enables the use of FPU (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = no + USE_FPU = hard +endif + +# FPU-related options. +ifeq ($(USE_FPU_OPT),) + USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 endif # @@ -79,14 +79,20 @@ endif ############################################################################## ############################################################################## -# Project, sources and paths +# Project, target, sources and paths # # Define project name here PROJECT = ch -# Imported source files and paths -CHIBIOS = ../../../.. +# Target settings. +MCU = cortex-m4 + +# Imported source files and paths. +CHIBIOS := ../../../.. +CONFDIR := ./cfg +BUILDDIR := ./build +DEPDIR := ./.dep # Licensing files. include $(CHIBIOS)/os/license/license.mk @@ -100,105 +106,43 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk -# EX files (optional).. +# EX files (optional). include $(CHIBIOS)/os/ex/ST/lis302dl.mk +# Auto-build files in ./source recursively. +include $(CHIBIOS)/tools/mk/autobuild.mk # Other files (optional). include $(CHIBIOS)/os/hal/lib/streams/streams.mk # Define linker script file here LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(LIS3DSHSRC) \ - $(STREAMSSRC) \ - $(SHELLSRC) \ - usbcfg.c main.c - # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ $(TESTSRC) \ - usbcfg.c main.c + main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. CPPSRC = $(ALLCPPSRC) -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = +# List ASM source files here. +ASMSRC = $(ALLASMSRC) -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = +# List ASM with preprocessor source files here. +ASMXSRC = $(ALLXASMSRC) -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = +# Inclusion directories. +INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) - -INCDIR = $(ALLINC) $(TESTINC) - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m4 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -AR = $(TRGT)ar -OD = $(TRGT)objdump -SZ = $(TRGT)size -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here +# Define C warning options here. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -# Define C++ warning options here +# Define C++ warning options here. CPPWARN = -Wall -Wextra -Wundef # -# Compiler settings +# Project, target, sources and paths ############################################################################## ############################################################################## @@ -206,8 +150,7 @@ CPPWARN = -Wall -Wextra -Wundef # # List all user C define here, like -D_DEBUG=1 -UDEFS = -DCHPRINTF_USE_FLOAT=1 \ - -DLIS302DL_USE_ADVANCED=0 -DLIS302DL_SHARED_SPI=0 +UDEFS = -DCHPRINTF_USE_FLOAT=1 # Define ASM defines here UADEFS = @@ -222,8 +165,25 @@ ULIBDIR = ULIBS = # -# End of user defines +# End of user section ############################################################################## +############################################################################## +# Common rules +# + RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk +include $(RULESPATH)/arm-none-eabi.mk include $(RULESPATH)/rules.mk + +# +# Common rules +############################################################################## + +############################################################################## +# Custom rules +# + +# +# Custom rules +############################################################################## diff --git a/testex/STM32/STM32F4xx/SPI-LIS3DSH/Makefile b/testex/STM32/STM32F4xx/SPI-LIS3DSH/Makefile index f8d25b5fd..293f302ab 100644 --- a/testex/STM32/STM32F4xx/SPI-LIS3DSH/Makefile +++ b/testex/STM32/STM32F4xx/SPI-LIS3DSH/Makefile @@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),) USE_CPPOPT = -fno-rtti endif -# Enable this if you want the linker to remove unused code and data +# Enable this if you want the linker to remove unused code and data. ifeq ($(USE_LINK_GC),) USE_LINK_GC = yes endif @@ -28,16 +28,11 @@ ifeq ($(USE_LDOPT),) USE_LDOPT = endif -# Enable this if you want link time optimizations (LTO) +# Enable this if you want link time optimizations (LTO). ifeq ($(USE_LTO),) USE_LTO = yes endif -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - # Enable this if you want to see the full log while compiling. ifeq ($(USE_VERBOSE_COMPILE),) USE_VERBOSE_COMPILE = no @@ -71,7 +66,12 @@ endif # Enables the use of FPU (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = no + USE_FPU = hard +endif + +# FPU-related options. +ifeq ($(USE_FPU_OPT),) + USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 endif # @@ -79,14 +79,20 @@ endif ############################################################################## ############################################################################## -# Project, sources and paths +# Project, target, sources and paths # # Define project name here PROJECT = ch -# Imported source files and paths -CHIBIOS = ../../../.. +# Target settings. +MCU = cortex-m4 + +# Imported source files and paths. +CHIBIOS := ../../../.. +CONFDIR := ./cfg +BUILDDIR := ./build +DEPDIR := ./.dep # Licensing files. include $(CHIBIOS)/os/license/license.mk @@ -100,105 +106,43 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk -# EX files (optional).. +# EX files (optional). include $(CHIBIOS)/os/ex/ST/lis3dsh.mk +# Auto-build files in ./source recursively. +include $(CHIBIOS)/tools/mk/autobuild.mk # Other files (optional). include $(CHIBIOS)/os/hal/lib/streams/streams.mk # Define linker script file here LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(LIS3DSHSRC) \ - $(STREAMSSRC) \ - $(SHELLSRC) \ - usbcfg.c main.c - # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ $(TESTSRC) \ - usbcfg.c main.c + main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. CPPSRC = $(ALLCPPSRC) -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = +# List ASM source files here. +ASMSRC = $(ALLASMSRC) -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = +# List ASM with preprocessor source files here. +ASMXSRC = $(ALLXASMSRC) -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = +# Inclusion directories. +INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) - -INCDIR = $(ALLINC) $(TESTINC) - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m4 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -AR = $(TRGT)ar -OD = $(TRGT)objdump -SZ = $(TRGT)size -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here +# Define C warning options here. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -# Define C++ warning options here +# Define C++ warning options here. CPPWARN = -Wall -Wextra -Wundef # -# Compiler settings +# Project, target, sources and paths ############################################################################## ############################################################################## @@ -206,8 +150,7 @@ CPPWARN = -Wall -Wextra -Wundef # # List all user C define here, like -D_DEBUG=1 -UDEFS = -DCHPRINTF_USE_FLOAT=1 \ - -DLIS3DSH_USE_ADVANCED=0 -DLIS3DSH_SHARED_SPI=0 +UDEFS = -DCHPRINTF_USE_FLOAT=1 # Define ASM defines here UADEFS = @@ -222,8 +165,25 @@ ULIBDIR = ULIBS = # -# End of user defines +# End of user section ############################################################################## +############################################################################## +# Common rules +# + RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk +include $(RULESPATH)/arm-none-eabi.mk include $(RULESPATH)/rules.mk + +# +# Common rules +############################################################################## + +############################################################################## +# Custom rules +# + +# +# Custom rules +############################################################################## diff --git a/testex/STM32/STM32L4xx/SPI-L3GD20/main.c b/testex/STM32/STM32L4xx/SPI-L3GD20/main.c index 693e0f0f7..168c9cffb 100644 --- a/testex/STM32/STM32L4xx/SPI-L3GD20/main.c +++ b/testex/STM32/STM32L4xx/SPI-L3GD20/main.c @@ -51,7 +51,7 @@ static L3GD20Config l3gd20cfg = { NULL, L3GD20_FS_250DPS, L3GD20_ODR_760HZ, -#if L3GD20_GYRO_USE_ADVANCED +#if L3GD20_USE_ADVANCED L3GD20_BDU_CONTINUOUS, L3GD20_END_LITTLE, L3GD20_BW3, @@ -125,4 +125,4 @@ int main(void) { cls(chp); } l3gd20Stop(&L3GD20D1); -} \ No newline at end of file +}