Repository: incubator-mynewt-core Updated Branches: refs/heads/master 702dc23e8 -> 4f89ca820
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/master Commit: 4dfbd54ba3a9360573de12fc69e7a28ad877c56d Parents: 702dc23 Author: wesley <wes...@wolinke.com> Authored: Mon May 1 16:15:45 2017 +0800 Committer: wesley <wes...@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; }