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

@ -16,10 +16,10 @@ uint32
wasm_sensor_open(const char *name, int instance);
bool
wasm_sensor_config(uint32 sensor, int interval, int bit_cfg, int delay);
wasm_sensor_config(uint32 sensor, uint32 interval, int bit_cfg, uint32 delay);
bool
wasm_sensor_config_with_attr_container(uint32 sensor, char *buffer, int len);
wasm_sensor_config_with_attr_container(uint32 sensor, char *buffer, uint32 len);
bool
wasm_sensor_close(uint32 sensor);