You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/04/11 23:25:35 UTC

[05/28] incubator-mynewt-core git commit: Add API for the system ticker to initialize the drift. This should include the drift of the underlying physical clock source as well as the "drift" due to the finite granularity of each tick.

Add API for the system ticker to initialize the drift. This should include
the drift of the underlying physical clock source as well as the "drift"
due to the finite granularity of each tick.


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/bb403e72
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/bb403e72
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/bb403e72

Branch: refs/heads/develop
Commit: bb403e72daab5eb4b31a3439a64e2d6572e1ab4e
Parents: e4185fd
Author: Neel Natu <ne...@nahannisys.com>
Authored: Mon Mar 21 16:37:38 2016 -0700
Committer: Neel Natu <ne...@nahannisys.com>
Committed: Mon Mar 21 16:37:38 2016 -0700

----------------------------------------------------------------------
 libs/os/include/os/os_callout.h |  2 ++
 libs/os/src/os_callout.c        | 14 ++++++++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bb403e72/libs/os/include/os/os_callout.h
----------------------------------------------------------------------
diff --git a/libs/os/include/os/os_callout.h b/libs/os/include/os/os_callout.h
index ce85855..7aab7c9 100644
--- a/libs/os/include/os/os_callout.h
+++ b/libs/os/include/os/os_callout.h
@@ -45,6 +45,8 @@ void os_callout_stop(struct os_callout *);
 int os_callout_reset(struct os_callout *, int32_t);
 void os_callout_tick(void);
 os_time_t os_callout_wakeup_ticks(os_time_t now);
+void os_callout_drift_set(int drift);
+int os_callout_drift_get(void);
 
 static inline int
 os_callout_queued(struct os_callout *c)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/bb403e72/libs/os/src/os_callout.c
----------------------------------------------------------------------
diff --git a/libs/os/src/os_callout.c b/libs/os/src/os_callout.c
index cd4a436..d8dbf61 100644
--- a/libs/os/src/os_callout.c
+++ b/libs/os/src/os_callout.c
@@ -25,6 +25,20 @@
 TAILQ_HEAD(, os_callout) g_callout_list =
   TAILQ_HEAD_INITIALIZER(g_callout_list);
 
+static int callout_drift;
+
+void
+callout_drift_set(int drift)
+{
+    callout_drift = drift;
+}
+
+int
+callout_drift_get(void)
+{
+    return (callout_drift);
+}
+
 void
 os_callout_init(struct os_callout *c, struct os_eventq *evq, void *ev_arg)
 {