Comments and documentation fixes.

This commit is contained in:
Marco Grella 2015-09-10 14:28:08 +02:00
parent b7459a12c1
commit 87970a88a4
6 changed files with 26 additions and 7 deletions

View file

@ -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;

View file

@ -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));

View file

@ -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

View file

@ -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) {

View file

@ -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) {

View file

@ -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) {