oicmgr; move call to oc_main_init() to take place once OS has started.
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/3ff24288 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/3ff24288 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/3ff24288 Branch: refs/heads/develop Commit: 3ff24288ec96f33d12085ff59d9784e65790872d Parents: 297c35d Author: Marko Kiiskila <ma...@runtime.io> Authored: Tue Nov 15 20:26:31 2016 -0800 Committer: Marko Kiiskila <ma...@runtime.io> Committed: Mon Nov 21 17:15:47 2016 -0800 ---------------------------------------------------------------------- mgmt/oicmgr/src/oicmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/3ff24288/mgmt/oicmgr/src/oicmgr.c ---------------------------------------------------------------------- diff --git a/mgmt/oicmgr/src/oicmgr.c b/mgmt/oicmgr/src/oicmgr.c index 32562d9..0e631ef 100644 --- a/mgmt/oicmgr/src/oicmgr.c +++ b/mgmt/oicmgr/src/oicmgr.c @@ -247,6 +247,8 @@ static void omgr_event_start(struct os_event *ev) { struct omgr_state *o = &omgr_state; + + oc_main_init((oc_handler_t *)&omgr_oc_handler); os_eventq_ensure(&o->os_evq, NULL); o->os_event.ev_cb = omgr_process_oc_event; os_callout_init(&o->os_oc_timer, mgmt_evq_get(), omgr_process_oc_event, @@ -263,8 +265,6 @@ oicmgr_init(void) goto err; } - oc_main_init((oc_handler_t *)&omgr_oc_handler); - return (0); err: return (rc);