Fix sensor framework timer issue and update sensor sample (#917)

Fix the sensor framework timer issue reported by #884 when setting
`ms_to_next_check`, and unify the type of time related args/vars to
uint32 to avoid potential type conversion issues, and fix the compile
warnings.

And update the sensor sample by creating two sensors to confirm that
the fix works correctly.
This commit is contained in:
Wenyong Huang
2021-12-28 08:44:19 +08:00
committed by GitHub
parent 635084c9b2
commit 98bacfe6bb
7 changed files with 75 additions and 41 deletions

View File

@ -526,8 +526,10 @@ iwasm_main(int argc, char *argv[])
/* sensor framework */
init_sensor_framework();
// add the sys sensor objects
add_sys_sensor("sensor_test", "This is a sensor for test", 0, 1000,
/* add the sys sensor objects */
add_sys_sensor("sensor_test1", "This is a sensor for test", 0, 1000,
read_test_sensor, config_test_sensor);
add_sys_sensor("sensor_test2", "This is a sensor for test", 0, 1000,
read_test_sensor, config_test_sensor);
start_sensor_framework();