From e261cda8dcc36cb3ef315bcafc398ad721e48d0b Mon Sep 17 00:00:00 2001 From: Marco Grella Date: Tue, 27 Oct 2015 12:12:59 +0100 Subject: [PATCH] Compilation flags update: BOARD=ids01a4/5 SENSORBOARD=iks01a1 --- .../stm32nucleo-spirit1/sensor-demo/Makefile | 2 +- .../stm32nucleo-spirit1/sensor-demo/README.md | 6 +- .../sensor-demo/sensor-demo.c | 16 ++--- platform/stm32nucleo-spirit1/Makefile.ids01a4 | 2 + platform/stm32nucleo-spirit1/Makefile.ids01a5 | 2 + platform/stm32nucleo-spirit1/Makefile.iks01a1 | 23 +++++++ .../Makefile.stm32nucleo-spirit1 | 61 ++++++------------- platform/stm32nucleo-spirit1/README.md | 12 ++-- .../contiki-spirit1-main.c | 6 +- .../dev/acceleration-sensor.c | 4 +- .../dev/gyroscope-sensor.c | 4 +- .../stm32nucleo-spirit1/dev/humidity-sensor.c | 4 +- platform/stm32nucleo-spirit1/dev/leds-arch.c | 32 +++++----- .../stm32nucleo-spirit1/dev/magneto-sensor.c | 4 +- .../stm32nucleo-spirit1/dev/pressure-sensor.c | 4 +- .../dev/temperature-sensor.c | 4 +- platform/stm32nucleo-spirit1/platform-conf.h | 4 +- platform/stm32nucleo-spirit1/st-lib.h | 4 +- platform/stm32nucleo-spirit1/stm32cube-lib | 2 +- regression-tests/Makefile.compile-test | 2 +- 20 files changed, 101 insertions(+), 97 deletions(-) create mode 100644 platform/stm32nucleo-spirit1/Makefile.ids01a4 create mode 100644 platform/stm32nucleo-spirit1/Makefile.ids01a5 create mode 100644 platform/stm32nucleo-spirit1/Makefile.iks01a1 diff --git a/examples/stm32nucleo-spirit1/sensor-demo/Makefile b/examples/stm32nucleo-spirit1/sensor-demo/Makefile index 2c980b1ec..0ec14cccd 100644 --- a/examples/stm32nucleo-spirit1/sensor-demo/Makefile +++ b/examples/stm32nucleo-spirit1/sensor-demo/Makefile @@ -2,7 +2,7 @@ CONTIKI_PROJECT = sensor-demo all: $(CONTIKI_PROJECT) TARGET=stm32nucleo-spirit1 -USE_SENSOR_BOARD=1 +SENSORBOARD=iks01a1 CONTIKI = ../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/stm32nucleo-spirit1/sensor-demo/README.md b/examples/stm32nucleo-spirit1/sensor-demo/README.md index 2ed16ddb7..b9cdc9caf 100644 --- a/examples/stm32nucleo-spirit1/sensor-demo/README.md +++ b/examples/stm32nucleo-spirit1/sensor-demo/README.md @@ -9,9 +9,9 @@ must be used. It needs to be connected on top of the NUCLEO-L152RE (MCU) and the To build the example type: - make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4 USE_SENSOR_BOARD=1 + make TARGET=stm32nucleo-spirit1 BOARD=ids01a4 SENSORBOARD=iks01a1 or - make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A5 USE_SENSOR_BOARD=1 + make TARGET=stm32nucleo-spirit1 BOARD=ids01a5 SENSORBOARD=iks01a1 -depending on the sub GHz board you have. +depending on the X-NUCLEO-IDS01Ax expansion board for sub GHz radio connectivity you have. diff --git a/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c b/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c index 18fa9e308..18bea17bf 100644 --- a/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c +++ b/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c @@ -44,14 +44,14 @@ #include "st-lib.h" -#ifdef COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 #include "dev/temperature-sensor.h" #include "dev/humidity-sensor.h" #include "dev/pressure-sensor.h" #include "dev/magneto-sensor.h" #include "dev/acceleration-sensor.h" #include "dev/gyroscope-sensor.h" -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ #define DEBUG DEBUG_PRINT #include "net/ip/uip-debug.h" @@ -75,14 +75,14 @@ PROCESS_THREAD(sensor_demo_process, ev, data) SENSORS_ACTIVATE(radio_sensor); -#ifdef COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 SENSORS_ACTIVATE(temperature_sensor); SENSORS_ACTIVATE(humidity_sensor); SENSORS_ACTIVATE(pressure_sensor); SENSORS_ACTIVATE(magneto_sensor); SENSORS_ACTIVATE(acceleration_sensor); SENSORS_ACTIVATE(gyroscope_sensor); -#endif +#endif /*X_NUCLEO_IKS01A1*/ while(1) { etimer_set(&etimer, PRINT_INTERVAL); @@ -98,17 +98,17 @@ PROCESS_THREAD(sensor_demo_process, ev, data) printf("Button state:\t%s (pressed %lu times)\n", button_sensor.value(0) ? "Released" : "Pressed", _button_pressed); -#ifdef COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 printf("LEDs status:\tRED:n/a GREEN:%s\n", leds_get() & LEDS_GREEN ? "on" : "off"); #else printf("LEDs status:\tRED:%s GREEN:%s\n", leds_get() & LEDS_RED ? "on" : "off", leds_get() & LEDS_GREEN ? "on" : "off"); -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ sensor_value = radio_sensor.value(RADIO_SENSOR_LAST_PACKET); printf("Radio (RSSI):\t%d.%d dBm\n", sensor_value / 10, ABS_VALUE(sensor_value) % 10); printf("Radio (LQI):\t%d\n", radio_sensor.value(RADIO_SENSOR_LAST_VALUE)); -#ifdef COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 sensor_value = temperature_sensor.value(0); printf("Temperature:\t%d.%d C\n", sensor_value / 10, ABS_VALUE(sensor_value) % 10); @@ -134,7 +134,7 @@ PROCESS_THREAD(sensor_demo_process, ev, data) printf("Gyroscope:\t%d/%d/%d (X/Y/Z) mdps\n", gyroscope_sensor.value(X_AXIS), gyroscope_sensor.value(Y_AXIS), gyroscope_sensor.value(Z_AXIS)); -#endif +#endif /*X_NUCLEO_IKS01A1*/ printf("\n"); } diff --git a/platform/stm32nucleo-spirit1/Makefile.ids01a4 b/platform/stm32nucleo-spirit1/Makefile.ids01a4 new file mode 100644 index 000000000..ef2dfb9ac --- /dev/null +++ b/platform/stm32nucleo-spirit1/Makefile.ids01a4 @@ -0,0 +1,2 @@ +#Simply set the correct flag +CFLAGS += -DX_NUCLEO_IDS01A4 diff --git a/platform/stm32nucleo-spirit1/Makefile.ids01a5 b/platform/stm32nucleo-spirit1/Makefile.ids01a5 new file mode 100644 index 000000000..b696c713c --- /dev/null +++ b/platform/stm32nucleo-spirit1/Makefile.ids01a5 @@ -0,0 +1,2 @@ +#Simply set the correct flag +CFLAGS += -DX_NUCLEO_IDS01A5 diff --git a/platform/stm32nucleo-spirit1/Makefile.iks01a1 b/platform/stm32nucleo-spirit1/Makefile.iks01a1 new file mode 100644 index 000000000..c36138a69 --- /dev/null +++ b/platform/stm32nucleo-spirit1/Makefile.iks01a1 @@ -0,0 +1,23 @@ +CFLAGS += -DX_NUCLEO_IKS01A1 + +CONTIKI_TARGET_DIRS += stm32cube-lib/drivers/x_nucleo_iks01a1 +CONTIKI_TARGET_DIRS += stm32cube-lib/drivers/sensors/hts221 stm32cube-lib/drivers/sensors/lps25h stm32cube-lib/drivers/sensors/lps25hb\ + stm32cube-lib/drivers/sensors/lsm6ds0 stm32cube-lib/drivers/sensors/lsm6ds3 stm32cube-lib/drivers/sensors/lis3mdl + +ARCH_DEV_SENSORS = temperature-sensor.c humidity-sensor.c pressure-sensor.c magneto-sensor.c acceleration-sensor.c gyroscope-sensor.c + +ARCH_DRIVERS_IKS01A1 = x_nucleo_iks01a1.c x_nucleo_iks01a1_hum_temp.c x_nucleo_iks01a1_imu_6axes.c \ + x_nucleo_iks01a1_magneto.c x_nucleo_iks01a1_pressure.c + + +ARCH_DRIVERS_SENSORS = hts221.c \ + lis3mdl.c \ + lps25h.c \ + lps25hb.c \ + lsm6ds0.c \ + lsm6ds3.c + +ARCH+=$(ARCH_DEV_SENSORS) +ARCH+=$(ARCH_DRIVERS_IKS01A1) +ARCH+=$(ARCH_DRIVERS_SENSORS) + diff --git a/platform/stm32nucleo-spirit1/Makefile.stm32nucleo-spirit1 b/platform/stm32nucleo-spirit1/Makefile.stm32nucleo-spirit1 index c24b0b4c2..27cc1f6d2 100644 --- a/platform/stm32nucleo-spirit1/Makefile.stm32nucleo-spirit1 +++ b/platform/stm32nucleo-spirit1/Makefile.stm32nucleo-spirit1 @@ -1,30 +1,32 @@ CONTIKI_TARGET_DIRS = . - -ifeq ($(USE_SENSOR_BOARD),1) - COMPILE_SENSORS=TRUE - CFLAGS += -DCOMPILE_SENSORS - ${info Compiling with Sensor Files} -else - COMPILE_SENSORS=FALSE - ${info NOT compiling Sensor Files} -endif - - -ifeq ($(USE_SUBGHZ_BOARD),IDS01A4) - CFLAGS += -DX_NUCLEO_IDS01A4 +ifeq ($(BOARD),ids01a4) ${info Using 868 MHz SPIRIT1 Board} -else ifeq ($(USE_SUBGHZ_BOARD),IDS01A5) - CFLAGS += -DX_NUCLEO_IDS01A5 +else ifeq ($(BOARD),ids01a5) ${info Using 915 MHz SPIRIT1 Board} else ${info You must specify which SPIRIT1 board you use:} - ${info make USE_SUBGHZ_BOARD=IDS01A4 for 868 MHz} - ${info make USE_SUBGHZ_BOARD=IDS01A5 for 915 MHz} + ${info make BOARD=ids01a4 for X-NUCLEO-IDS01A4 (868 MHz)} + ${info make BOARD=ids01a5 for X-NUCLEO-IDS01A5 (915 MHz)} ${error } endif +### Include the board-specific makefile +PLATFORM_ROOT_DIR = $(CONTIKI)/platform/$(TARGET) +-include $(PLATFORM_ROOT_DIR)/Makefile.$(BOARD) + +ifeq ($(SENSORBOARD),iks01a1) + ${info Compiling with X-NUCLEO-IKS01A1 sensors files} + -include $(PLATFORM_ROOT_DIR)/Makefile.$(SENSORBOARD) +else ifeq ($(SENSORBOARD),) + ${info NOT compiling files for any sensors expansion board} +else + ${info Error: SENSORBOARD can be: iks01a1} + ${error } +endif + + #Currently we support only GCC GCC=1 @@ -41,17 +43,8 @@ CONTIKI_TARGET_DIRS += stm32cube-lib/drivers/STM32L1xx_HAL_Driver/Src CONTIKI_TARGET_DIRS += stm32cube-lib/drivers/STM32L1xx_HAL_Driver/Inc -ifeq ($(COMPILE_SENSORS),TRUE) -CONTIKI_TARGET_DIRS += stm32cube-lib/drivers/x_nucleo_iks01a1 -CONTIKI_TARGET_DIRS += stm32cube-lib/drivers/sensors/hts221 stm32cube-lib/drivers/sensors/lps25h stm32cube-lib/drivers/sensors/lps25hb\ - stm32cube-lib/drivers/sensors/lsm6ds0 stm32cube-lib/drivers/sensors/lsm6ds3 stm32cube-lib/drivers/sensors/lis3mdl -endif - - ARCH_DEV = button-sensor.c leds-arch.c radio-sensor.c -ARCH_DEV_SENSORS = temperature-sensor.c humidity-sensor.c pressure-sensor.c magneto-sensor.c acceleration-sensor.c gyroscope-sensor.c - ARCH_NUCLEOSPIRIT1 = contiki-spirit1-main.c uart-msg.c spirit1-arch.c spirit1.c node-id.c ARCH_NUCLEOSPIRIT1_STM32CUBEHAL = spirit1_appli.c stm32l1xx_hal_msp.c stm32l1xx_it.c stm32cube_hal_init.c @@ -81,16 +74,6 @@ ARCH_DRIVERS_SPIRIT1 = \ SPIRIT_Timer.c \ SPIRIT_Types.c -ARCH_DRIVERS_IKS01A1 = x_nucleo_iks01a1.c x_nucleo_iks01a1_hum_temp.c x_nucleo_iks01a1_imu_6axes.c \ - x_nucleo_iks01a1_magneto.c x_nucleo_iks01a1_pressure.c - -ARCH_DRIVERS_SENSORS = hts221.c \ - lis3mdl.c \ - lps25h.c \ - lps25hb.c \ - lsm6ds0.c \ - lsm6ds3.c - STM32L1XX_HAL =\ stm32l1xx_hal.c\ stm32l1xx_hal_adc_ex.c\ @@ -144,12 +127,6 @@ ARCH+=$(ARCH_DRIVERS_IDS01AX) ARCH+=$(ARCH_DRIVERS_SPIRIT1) ARCH+=$(STM32L1XX_HAL) -ifeq ($(COMPILE_SENSORS),TRUE) - ARCH+=$(ARCH_DEV_SENSORS) - ARCH+=$(ARCH_DRIVERS_IKS01A1) - ARCH+=$(ARCH_DRIVERS_SENSORS) -endif - CFLAGS += -DUSE_STM32L152_EVAL \ -DSTM32L152xE \ -DUSE_STM32L1XX_NUCLEO \ diff --git a/platform/stm32nucleo-spirit1/README.md b/platform/stm32nucleo-spirit1/README.md index d94771eca..4641c8be3 100644 --- a/platform/stm32nucleo-spirit1/README.md +++ b/platform/stm32nucleo-spirit1/README.md @@ -7,7 +7,7 @@ Port Feature ============ The port supports the following boards from ST: -- NUCLEO-L152RE board, based on the STM32L152RET6 ultra-low power microcontroller +- NUCLEO-L152RE board, based on the STM32L152RET6 ultra-low power microcontroller - X-NUCLEO-IDS01A4 based on sub-1GHz SPSGRF-868 SPIRIT1 module (operating at 868 MHz) - X-NUCLEO-IDS01A5 based on sub-1GHz SPSGRF-915 SPIRIT1 module (operating at 915 MHz) - X-NUCLEO-IKS01A1 featuring motion MEMS and environmental sensors (optional) @@ -102,13 +102,13 @@ For example, go to examples/ipv6/simple-udp-rpl directory. If the X-NUCLEO-IDS01A4 sub-1GHz RF expansion board is used, the following must be run: - make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4 clean - make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4 + make TARGET=stm32nucleo-spirit1 BOARD=ids01a4 clean + make TARGET=stm32nucleo-spirit1 BOARD=ids01a4 If the X-NUCLEO-IDS01A5 sub-1GHz RF expansion board is used, the following must be run: - make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A5 clean - make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A5 + make TARGET=stm32nucleo-spirit1 BOARD=ids01a5 clean + make TARGET=stm32nucleo-spirit1 BOARD=ids01a5 This will create executables for UDP sender and receiver nodes. @@ -125,7 +125,7 @@ In case you need to build an example that uses the additional sensors expansion (for example, considering a system made of NUCLEO-L152RE, X-NUCLEO-IDS01A4 and X-NUCLEO-IKS01A1) then the command to be run would be: - make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4 USE_SENSOR_BOARD=1 + make TARGET=stm32nucleo-spirit1 BOARD=ids01a4 SENSORBOARD=iks01a1 System setup ============ diff --git a/platform/stm32nucleo-spirit1/contiki-spirit1-main.c b/platform/stm32nucleo-spirit1/contiki-spirit1-main.c index 2342e8254..5d5e5413e 100644 --- a/platform/stm32nucleo-spirit1/contiki-spirit1-main.c +++ b/platform/stm32nucleo-spirit1/contiki-spirit1-main.c @@ -68,7 +68,7 @@ #include "net/ipv6/uip-ds6.h" #endif /*NETSTACK_CONF_WITH_IPV6*/ /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 extern const struct sensors_sensor temperature_sensor; extern const struct sensors_sensor humidity_sensor; extern const struct sensors_sensor pressure_sensor; @@ -83,10 +83,10 @@ SENSORS(&button_sensor, &magneto_sensor, &acceleration_sensor, &gyroscope_sensor); -#else /*COMPILE_SENSORS*/ +#else /*X_NUCLEO_IKS01A1*/ SENSORS(&button_sensor, &radio_sensor); -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ extern unsigned char node_mac[8]; /*---------------------------------------------------------------------------*/ diff --git a/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c b/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c index 3b6e5bc56..104cfe8b8 100644 --- a/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c @@ -37,7 +37,7 @@ * Driver for the stm32nucleo-spirit1 Temperature sensor (on expansion board) */ /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 /*---------------------------------------------------------------------------*/ #include "lib/sensors.h" #include "acceleration-sensor.h" @@ -137,6 +137,6 @@ status(int type) SENSORS_SENSOR(acceleration_sensor, ACCELERATION_SENSOR, value, configure, status); /*---------------------------------------------------------------------------*/ -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ /** @} */ diff --git a/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c b/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c index 31b79085f..cfa699827 100644 --- a/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c @@ -37,7 +37,7 @@ * Driver for the stm32nucleo-spirit1 Gyroscope sensor (on expansion board) */ /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 /*---------------------------------------------------------------------------*/ #include "lib/sensors.h" #include "gyroscope-sensor.h" @@ -136,6 +136,6 @@ status(int type) /*---------------------------------------------------------------------------*/ SENSORS_SENSOR(gyroscope_sensor, GYROSCOPE_SENSOR, value, configure, status); /*---------------------------------------------------------------------------*/ -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ /** @} */ diff --git a/platform/stm32nucleo-spirit1/dev/humidity-sensor.c b/platform/stm32nucleo-spirit1/dev/humidity-sensor.c index 76f22656a..843b35a91 100644 --- a/platform/stm32nucleo-spirit1/dev/humidity-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/humidity-sensor.c @@ -37,7 +37,7 @@ * Driver for the stm32nucleo-spirit1 Humidity sensor (on expansion board) */ /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 /*---------------------------------------------------------------------------*/ #include "lib/sensors.h" #include "humidity-sensor.h" @@ -117,6 +117,6 @@ status(int type) /*---------------------------------------------------------------------------*/ SENSORS_SENSOR(humidity_sensor, HUMIDITY_SENSOR, value, configure, status); /*---------------------------------------------------------------------------*/ -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ /** @} */ diff --git a/platform/stm32nucleo-spirit1/dev/leds-arch.c b/platform/stm32nucleo-spirit1/dev/leds-arch.c index 6fadf21bd..7c9b198fe 100644 --- a/platform/stm32nucleo-spirit1/dev/leds-arch.c +++ b/platform/stm32nucleo-spirit1/dev/leds-arch.c @@ -41,13 +41,13 @@ #include "dev/leds.h" #include "st-lib.h" /*---------------------------------------------------------------------------*/ -#ifndef COMPILE_SENSORS -/* The Red LED (on SPIRIT1 exp board) is exposed only if the sensor board is NOT - * used, becasue of a pin conflict. +#ifndef X_NUCLEO_IKS01A1 +/* The Red LED (on SPIRIT1 exp board) is exposed only if the + * X-NUCLEO-IKS01A1 sensor board is NOT used, becasue of a pin conflict. */ extern st_lib_gpio_typedef *st_lib_a_led_gpio_port[]; extern const uint16_t st_lib_a_led_gpio_pin[]; -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ extern st_lib_gpio_typedef *st_lib_gpio_port[]; extern const uint16_t st_lib_gpio_pin[]; @@ -59,13 +59,13 @@ leds_arch_init(void) st_lib_bsp_led_init(LED2); st_lib_bsp_led_off(LED2); -#ifndef COMPILE_SENSORS -/* The Red LED (on SPIRIT1 exp board) is exposed only if the sensor board is NOT - * used, becasue of a pin conflict. +#ifndef X_NUCLEO_IKS01A1 +/* The Red LED (on SPIRIT1 exp board) is exposed only if the + * X-NUCLEO-IKS01A1 sensor board is NOT used, becasue of a pin conflict. */ st_lib_radio_shield_led_init(RADIO_SHIELD_LED); st_lib_radio_shield_led_off(RADIO_SHIELD_LED); -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ } /*---------------------------------------------------------------------------*/ unsigned char @@ -76,15 +76,15 @@ leds_arch_get(void) ret |= LEDS_GREEN; } -#ifndef COMPILE_SENSORS -/* The Red LED (on SPIRIT1 exp board) is exposed only if the sensor board is NOT - * used, becasue of a pin conflict. +#ifndef X_NUCLEO_IKS01A1 +/* The Red LED (on SPIRIT1 exp board) is exposed only if the + * X-NUCLEO-IKS01A1 sensor board is NOT used, becasue of a pin conflict. */ if(st_lib_hal_gpio_read_pin(st_lib_a_led_gpio_port[RADIO_SHIELD_LED], st_lib_a_led_gpio_pin[RADIO_SHIELD_LED])) { ret |= LEDS_RED; } -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ return ret; } @@ -98,16 +98,16 @@ leds_arch_set(unsigned char leds) st_lib_bsp_led_off(LED2); } -#ifndef COMPILE_SENSORS -/* The Red LED (on SPIRIT1 exp board) is exposed only if the sensor board is NOT - * used, becasue of a pin conflict. +#ifndef X_NUCLEO_IKS01A1 +/* The Red LED (on SPIRIT1 exp board) is exposed only if the + * X-NUCLEO-IKS01A1 sensor board is NOT used, becasue of a pin conflict. */ if(leds & LEDS_RED) { st_lib_radio_shield_led_on(RADIO_SHIELD_LED); } else { st_lib_radio_shield_led_off(RADIO_SHIELD_LED); } -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ } /*---------------------------------------------------------------------------*/ /** @} */ diff --git a/platform/stm32nucleo-spirit1/dev/magneto-sensor.c b/platform/stm32nucleo-spirit1/dev/magneto-sensor.c index d57668c33..753bfba33 100644 --- a/platform/stm32nucleo-spirit1/dev/magneto-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/magneto-sensor.c @@ -37,7 +37,7 @@ * Driver for the stm32nucleo-spirit1 Magneto sensor (on expansion board) */ /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 /*---------------------------------------------------------------------------*/ #include "lib/sensors.h" #include "magneto-sensor.h" @@ -132,6 +132,6 @@ status(int type) /*---------------------------------------------------------------------------*/ SENSORS_SENSOR(magneto_sensor, MAGNETO_SENSOR, value, configure, status); /*---------------------------------------------------------------------------*/ -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ /** @} */ diff --git a/platform/stm32nucleo-spirit1/dev/pressure-sensor.c b/platform/stm32nucleo-spirit1/dev/pressure-sensor.c index 8f92b01bc..a7cce6621 100644 --- a/platform/stm32nucleo-spirit1/dev/pressure-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/pressure-sensor.c @@ -37,7 +37,7 @@ * Driver for the stm32nucleo-spirit1 Pressure sensor (on expansion board) */ /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 /*---------------------------------------------------------------------------*/ #include "lib/sensors.h" #include "pressure-sensor.h" @@ -114,5 +114,5 @@ status(int type) /*---------------------------------------------------------------------------*/ SENSORS_SENSOR(pressure_sensor, PRESSURE_SENSOR, value, configure, status); /*---------------------------------------------------------------------------*/ -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /** @} */ diff --git a/platform/stm32nucleo-spirit1/dev/temperature-sensor.c b/platform/stm32nucleo-spirit1/dev/temperature-sensor.c index 29e82e069..87a75b983 100644 --- a/platform/stm32nucleo-spirit1/dev/temperature-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/temperature-sensor.c @@ -37,7 +37,7 @@ * Driver for the stm32nucleo-spirit1 Temperature sensor (on expansion board) */ /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 /*---------------------------------------------------------------------------*/ #include "lib/sensors.h" #include "temperature-sensor.h" @@ -116,6 +116,6 @@ status(int type) /*---------------------------------------------------------------------------*/ SENSORS_SENSOR(temperature_sensor, TEMPERATURE_SENSOR, value, configure, status); -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ /** @} */ diff --git a/platform/stm32nucleo-spirit1/platform-conf.h b/platform/stm32nucleo-spirit1/platform-conf.h index ea32741ea..dede0bdeb 100644 --- a/platform/stm32nucleo-spirit1/platform-conf.h +++ b/platform/stm32nucleo-spirit1/platform-conf.h @@ -55,11 +55,11 @@ #define LEDS_GREEN 1 /*Nucleo LED*/ #define LEDS_RED 2 /*SPIRIT1 LED*/ -#ifdef COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 #define LEDS_CONF_ALL 1 /*Can't use SPIRIT1 LED in this case*/ #else #define LEDS_CONF_ALL 3 /*No sensors -> we can use SPIRIT1 LED in this case*/ -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ #define F_CPU 32000000ul #define RTIMER_ARCH_SECOND 32768 diff --git a/platform/stm32nucleo-spirit1/st-lib.h b/platform/stm32nucleo-spirit1/st-lib.h index d49b810b5..6a7e2ee0f 100644 --- a/platform/stm32nucleo-spirit1/st-lib.h +++ b/platform/stm32nucleo-spirit1/st-lib.h @@ -297,7 +297,7 @@ #define st_lib_hal_gpio_write_pin(...) HAL_GPIO_WritePin(__VA_ARGS__) /*---------------------------------------------------------------------------*/ -#if COMPILE_SENSORS +#ifdef X_NUCLEO_IKS01A1 /*---------------------------------------------------------------------------*/ /* x_nucleo_iks01a1.h */ #include "x_nucleo_iks01a1.h" @@ -340,7 +340,7 @@ #define st_lib_bsp_pressure_get_pressure(...) BSP_PRESSURE_GetPressure(__VA_ARGS__) /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -#endif /*COMPILE_SENSORS*/ +#endif /*X_NUCLEO_IKS01A1*/ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ #endif /*ST_LIB_H_*/ diff --git a/platform/stm32nucleo-spirit1/stm32cube-lib b/platform/stm32nucleo-spirit1/stm32cube-lib index 6ff4221d0..66b672b5c 160000 --- a/platform/stm32nucleo-spirit1/stm32cube-lib +++ b/platform/stm32nucleo-spirit1/stm32cube-lib @@ -1 +1 @@ -Subproject commit 6ff4221d03963844364616e6499e9401c0321c28 +Subproject commit 66b672b5cc25fabc853510cd8ae4db40357d748e diff --git a/regression-tests/Makefile.compile-test b/regression-tests/Makefile.compile-test index c32705434..10b01cf7e 100644 --- a/regression-tests/Makefile.compile-test +++ b/regression-tests/Makefile.compile-test @@ -41,7 +41,7 @@ define dooneexample @echo Building example $(3): $(1) for target $(2) @((cd $(EXAMPLESDIR)/$(1); \ export STM32W_CPUREV=CC; \ - export USE_SUBGHZ_BOARD=IDS01A5; \ + export BOARD=ids01a5; \ make TARGET=$(2) clean && make TARGET=$(2)) > \ $(3)-$(subst /,-,$(1))$(2).report 2>&1 && \ (echo $(1) $(2): OK | tee $(3)-$(subst /,-,$(1))$(2).summary) || \