You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2019/06/19 22:31:10 UTC
[mynewt-core] branch master updated: sensor_shell: Fix infinite read
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 4d0a9c1 sensor_shell: Fix infinite read
4d0a9c1 is described below
commit 4d0a9c1371fb708fd81bc15a69bef3b36202530d
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Jun 11 13:49:40 2019 +0200
sensor_shell: Fix infinite read
sensor read without count/interval/duration is supposed to read just
one value (set of values).
If read was executed before with interval specified next execution
without arguments ends up in infinite reading loop due to complex
condition.
Now count/interval/duration are reset before parsing arguments so
code is more deterministic.
---
hw/sensor/src/sensor_shell.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/sensor/src/sensor_shell.c b/hw/sensor/src/sensor_shell.c
index adf8927..7549a97 100644
--- a/hw/sensor/src/sensor_shell.c
+++ b/hw/sensor/src/sensor_shell.c
@@ -489,6 +489,10 @@ sensor_cmd_read(char **argv, int argc)
goto usage;
}
+ g_spd.spd_nsamples = 0;
+ g_spd.spd_poll_itvl = 0;
+ g_spd.spd_poll_duration = 0;
+
sensor_name = argv[0];
type = strtol(argv[1], NULL, 0);