You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2017/05/08 14:32:21 UTC
[26/40] incubator-mynewt-core git commit: os_callout: directly call
callback function in tick interrupt context if have't event queue
os_callout: directly call callback function in tick interrupt context if have't event queue
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/4dfbd54b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/4dfbd54b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/4dfbd54b
Branch: refs/heads/bluetooth5
Commit: 4dfbd54ba3a9360573de12fc69e7a28ad877c56d
Parents: 702dc23
Author: wesley <we...@wolinke.com>
Authored: Mon May 1 16:15:45 2017 +0800
Committer: wesley <we...@wolinke.com>
Committed: Mon May 1 16:15:45 2017 +0800
----------------------------------------------------------------------
kernel/os/src/os_callout.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4dfbd54b/kernel/os/src/os_callout.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/os_callout.c b/kernel/os/src/os_callout.c
index bc152fd..2e29826 100644
--- a/kernel/os/src/os_callout.c
+++ b/kernel/os/src/os_callout.c
@@ -160,7 +160,11 @@ os_callout_tick(void)
OS_EXIT_CRITICAL(sr);
if (c) {
- os_eventq_put(c->c_evq, &c->c_ev);
+ if (c->c_evq) {
+ os_eventq_put(c->c_evq, &c->c_ev);
+ } else {
+ c->c_ev.ev_cb(&c->c_ev);
+ }
} else {
break;
}