Skip to content

Commit aa7faae

Browse files
committed
libtock: sensors: Convert rainfall to um
Signed-off-by: Alistair Francis <[email protected]>
1 parent 8daa16f commit aa7faae

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/sensors/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static void alarm_cb(__attribute__ ((unused)) uint32_t now,
5959
if (proximity) printf("Proximity: %u\n", prox_reading);
6060
if (sound_pressure) printf("Sound Pressure: %u\n", sound_pressure_reading);
6161
if (moisture) printf("Moisture: %d%%\n", mois/100);
62-
if (rainfall) printf("Rainfall: %lumm\n", rain);
62+
if (rainfall) printf("Rainfall: %lumm\n", rain / 1000);
6363

6464
/* *INDENT-ON* */
6565

libtock-sync/sensors/rainfall.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ extern "C" {
1111
//
1212
// ## Arguments
1313
//
14-
// - `rainfall`: Set to the mms of rainfall in the specified number of hours.
15-
// - `hours`: The number of hours to get the rainfall data from. 1 to 24 hours
16-
// are valid values.
14+
// - `rainfall`: Set to the ums of rainfall in the specified number of hours.
15+
// - `hours`: The number of hours to get the rainfall data from. 1 to 24
16+
// hours are valid values.
1717
//
1818
// ## Return Value
1919
//

libtock/sensors/rainfall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern "C" {
1010
// Function signature for rainfall data callback.
1111
//
1212
// - `arg1` (`int`): Returncode indicating status from sampling the sensor.
13-
// - `arg2` (`uint32_t`): the number of mm of rain in the time period specified
13+
// - `arg2` (`uint32_t`): the number of um of rain in the time period specified
1414
typedef void (*libtock_rainfall_callback)(returncode_t, uint32_t);
1515

1616
// Start a rainfall measurement. The reading will be provided via the callback.

0 commit comments

Comments
 (0)