You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/04/07 18:44:58 UTC

[24/50] [abbrv] incubator-mynewt-core git commit: MYNEWT-703 SensorAPI: Add cputime timestamps

MYNEWT-703 SensorAPI: Add cputime timestamps

- Change callout timeout to be 2000 seconds instead of 2146.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/d416d551
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/d416d551
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/d416d551

Branch: refs/heads/master
Commit: d416d551565b02e9ba8b58c4290a38ddc148544e
Parents: bd1d076
Author: Vipul Rahane <vi...@apache.org>
Authored: Mon Apr 3 12:07:35 2017 -0700
Committer: Vipul Rahane <vi...@apache.org>
Committed: Mon Apr 3 12:13:56 2017 -0700

----------------------------------------------------------------------
 hw/sensor/src/sensor.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/d416d551/hw/sensor/src/sensor.c
----------------------------------------------------------------------
diff --git a/hw/sensor/src/sensor.c b/hw/sensor/src/sensor.c
index cad73a6..eb7df6a 100644
--- a/hw/sensor/src/sensor.c
+++ b/hw/sensor/src/sensor.c
@@ -262,9 +262,10 @@ sensor_base_ts_update_event(struct os_event *ev)
      * hence the hardcoded value of 3600 seconds, We want to make
      * sure that the cputime never gets wrapped more than once.
      * os_timeval usecs value gets wrapped in 2147 secs since it is int32_t.
-     * Hence, we take 2146 secs so that we update before it gets wrapped.
+     * Hence, we take 2000 secs so that we update before it gets wrapped
+     * without cutting it too close.
      */
-    ticks += OS_TICKS_PER_SEC * 2146;
+    ticks += OS_TICKS_PER_SEC * 2000;
 
     sensor_base_ts.st_ostv = ostv;
     sensor_base_ts.st_ostz = ostz;