diff --git a/cpu/arm/stm32l152/clock.c b/cpu/arm/stm32l152/clock.c index 57ed8eba4..d45b054ff 100644 --- a/cpu/arm/stm32l152/clock.c +++ b/cpu/arm/stm32l152/clock.c @@ -92,9 +92,7 @@ void clock_delay(unsigned int i) } } /*---------------------------------------------------------------------------*/ -/** - * Wait for a multiple of clock ticks (7.8 ms at 128 Hz). - */ +/* Wait for a multiple of clock ticks (7.8 ms at 128 Hz). */ void clock_wait(clock_time_t t) { clock_time_t start; diff --git a/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c b/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c index 49ff705f9..0884e3da8 100644 --- a/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c +++ b/examples/stm32nucleo-spirit1/sensor-demo/sensor-demo.c @@ -131,6 +131,11 @@ PROCESS_THREAD(sensor_demo_process, ev, data) sensor_value = pressure_sensor.value(0); printf("Pressure:\t%d.%d mbar\n", sensor_value/10, ABS_VALUE(sensor_value)%10); + /* NOTE: this demo uses the mapping of ST Nucleo sensors on Contiki sensor API. + * For a real use case of sensors like acceleration, magneto and gyroscope, + * it is better to directly call the ST lib to get the three value (X/Y/Z) + * at once. + */ printf("Magneto:\t%d/%d/%d (X/Y/Z) mgauss\n", magneto_sensor.value(X_AXIS), magneto_sensor.value(Y_AXIS), magneto_sensor.value(Z_AXIS)); diff --git a/platform/stm32nucleo-spirit1/README.md b/platform/stm32nucleo-spirit1/README.md index e81672a69..f004b32d2 100644 --- a/platform/stm32nucleo-spirit1/README.md +++ b/platform/stm32nucleo-spirit1/README.md @@ -63,15 +63,16 @@ Software Requirements The following software are needed: * ST port of Contiki for STM32 Nucleo and expansion boards. - >The port is installed automatically when both the Contiki and the submodule repository are cloned: the former hosts the Contiki distribution and the ST platform interface, the latter hosts the actual library. + >The port is automatically installed when both the Contiki and the submodule repository are cloned: the former hosts the Contiki distribution and the ST platform interface, the latter hosts the actual library. The following commands are needed to download the full porting: - git clone https://github.com/STclab/contiki.git (*) + git clone https://github.com/STclab/contiki.git cd contiki/ - git checkout stm32nucleo-spirit1 (*) + git checkout stm32nucleo-spirit1 git submodule init git submodule update -(*): required only if using the STclab GitHub repository, these steps won't be needed once the Pull Request will be accepted + +Note: the first and third steps are required only if using the STclab GitHub repository, they won't be needed any more once the Pull Request is accepted. The platform name is: stm32nucleo-spirit1 diff --git a/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c b/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c index 288faab98..e41761dea 100644 --- a/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/acceleration-sensor.c @@ -80,6 +80,11 @@ static int value(int type) int32_t ret_val = 0; volatile st_lib_axes_raw_typedef axes_raw_data; + /* NOTE: this is a demo of mapping ST Nucleo sensors on Contiki sensor API. + * For a real use case of sensors like acceleration, magneto and gyroscope, + * it is better to directly call the ST lib to get the three value (X/Y/Z) + * at once. + */ st_lib_bsp_imu_6axes_x_get_axes_raw(&axes_raw_data); switch (type) { diff --git a/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c b/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c index 34ea00139..485a98120 100644 --- a/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/gyroscope-sensor.c @@ -80,6 +80,11 @@ static int value(int type) int32_t ret_val = 0; volatile st_lib_axes_raw_typedef axes_raw_data; + /* NOTE: this is a demo of mapping ST Nucleo sensors on Contiki sensor API. + * For a real use case of sensors like acceleration, magneto and gyroscope, + * it is better to directly call the ST lib to get the three value (X/Y/Z) + * at once. + */ st_lib_bsp_imu_6axes_g_get_axes_raw(&axes_raw_data); switch (type) { diff --git a/platform/stm32nucleo-spirit1/dev/magneto-sensor.c b/platform/stm32nucleo-spirit1/dev/magneto-sensor.c index 6535b37b4..deda61954 100644 --- a/platform/stm32nucleo-spirit1/dev/magneto-sensor.c +++ b/platform/stm32nucleo-spirit1/dev/magneto-sensor.c @@ -76,6 +76,11 @@ static int value(int type) int32_t ret_val = 0; volatile st_lib_axes_raw_typedef axes_raw_data; + /* NOTE: this is a demo of mapping ST Nucleo sensors on Contiki sensor API. + * For a real use case of sensors like acceleration, magneto and gyroscope, + * it is better to directly call the ST lib to get the three value (X/Y/Z) + * at once. + */ st_lib_bsp_magneto_m_get_axes_raw(&axes_raw_data); switch (type) {