You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2019/05/22 19:24:34 UTC

[mynewt-core] branch master updated: hw/sensors: Reset read offset in 'read' shell cmd

This is an automated email from the ASF dual-hosted git repository.

andk 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 f96d774  hw/sensors: Reset read offset in 'read' shell cmd
f96d774 is described below

commit f96d774d18a7f2b9de304babbcc109c362392e1a
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Wed May 22 16:42:17 2019 +0200

    hw/sensors: Reset read offset in 'read' shell cmd
    
    Next read offset is never reset to 0 so after complete 'read' sequence
    next command will request 1st read operation immediately and then next
    one will be scheduled after duration of complete previous sequence
    because next read offset is still set to that duration.
    
    Need to make sure read offset is reset to 0 before 1st read operation.
---
 hw/sensor/src/sensor_shell.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/sensor/src/sensor_shell.c b/hw/sensor/src/sensor_shell.c
index 67caf04..b7d80e8 100644
--- a/hw/sensor/src/sensor_shell.c
+++ b/hw/sensor/src/sensor_shell.c
@@ -546,6 +546,7 @@ sensor_cmd_read(char **argv, int argc)
     g_spd.spd_sensor_type = type;
 
     /* Start 1st read immediately */
+    g_spd.spd_read_next_msecs_off = 0;
     g_spd.spd_read_start_ticks = os_cputime_get32();
     sensor_shell_read_timer_cb(NULL);