Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 749430af2 -> 2f02640bd
oicmgr; get it to compile with new syscfg. 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/1b0fa3a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1b0fa3a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1b0fa3a2 Branch: refs/heads/develop Commit: 1b0fa3a2c113fd5a752192d74bb5531401cc0704 Parents: 749430a Author: Marko Kiiskila <ma...@runtime.io> Authored: Tue Oct 4 18:50:25 2016 -0700 Committer: Marko Kiiskila <ma...@runtime.io> Committed: Tue Oct 4 18:50:25 2016 -0700 ---------------------------------------------------------------------- mgmt/oicmgr/include/newtmgr/newtmgr.h | 1 - mgmt/oicmgr/pkg.yml | 6 +++--- mgmt/oicmgr/src/newtmgr.c | 13 +++++++++--- mgmt/oicmgr/syscfg.yml | 33 ++++++++++++++++++++++-------- 4 files changed, 37 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1b0fa3a2/mgmt/oicmgr/include/newtmgr/newtmgr.h ---------------------------------------------------------------------- diff --git a/mgmt/oicmgr/include/newtmgr/newtmgr.h b/mgmt/oicmgr/include/newtmgr/newtmgr.h index 32d16e5..30be98f 100644 --- a/mgmt/oicmgr/include/newtmgr/newtmgr.h +++ b/mgmt/oicmgr/include/newtmgr/newtmgr.h @@ -110,7 +110,6 @@ struct nmgr_group { (__group)->ng_handlers_count = (sizeof((__handlers)) / \ sizeof(struct nmgr_handler)); -int nmgr_oic_init(uint8_t, os_stack_t *, uint16_t); int nmgr_group_register(struct nmgr_group *group); #ifdef __cplusplus http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1b0fa3a2/mgmt/oicmgr/pkg.yml ---------------------------------------------------------------------- diff --git a/mgmt/oicmgr/pkg.yml b/mgmt/oicmgr/pkg.yml index 5458034..06caa21 100644 --- a/mgmt/oicmgr/pkg.yml +++ b/mgmt/oicmgr/pkg.yml @@ -33,8 +33,8 @@ pkg.deps: - sys/shell - sys/reboot -pkg.cflags: - - -DOC_SERVER - pkg.apis: - newtmgr + +pkg.init_function: oicmgr_init +pkg.init_stage: 5 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1b0fa3a2/mgmt/oicmgr/src/newtmgr.c ---------------------------------------------------------------------- diff --git a/mgmt/oicmgr/src/newtmgr.c b/mgmt/oicmgr/src/newtmgr.c index 136545f..769f806 100644 --- a/mgmt/oicmgr/src/newtmgr.c +++ b/mgmt/oicmgr/src/newtmgr.c @@ -17,6 +17,9 @@ * under the License. */ +#include <syscfg/syscfg.h> +#include <sysinit/sysinit.h> + #include <os/os.h> #include <os/endian.h> @@ -30,6 +33,7 @@ #define NMGR_OC_EVENT (OS_EVENT_T_PERUSER) #define NMGR_OC_TIMER (OS_EVENT_T_PERUSER + 1) +#define OICMGR_STACK_SZ OS_STACK_ALIGN(MYNEWT_VAL(OICMGR_STACK_SIZE)) struct nmgr_state { struct os_mutex ns_group_lock; @@ -49,6 +53,8 @@ static struct nmgr_state nmgr_state = { .ns_oc_timer.c_evq = &nmgr_state.ns_evq }; +static os_stack_t oicmgr_stack[OICMGR_STACK_SZ]; + static void nmgr_oic_get(oc_request_t *request, oc_interface_mask_t interface); static void nmgr_oic_put(oc_request_t *request, oc_interface_mask_t interface); @@ -476,15 +482,16 @@ nmgr_oic_task(void *arg) } int -nmgr_oic_init(uint8_t prio, os_stack_t *stack_ptr, uint16_t stack_len) +oicmgr_init(void) { struct nmgr_state *ns = &nmgr_state; int rc; os_eventq_init(&ns->ns_evq); - rc = os_task_init(&ns->ns_task, "newtmgr_oic", nmgr_oic_task, NULL, prio, - OS_WAIT_FOREVER, stack_ptr, stack_len); + rc = os_task_init(&ns->ns_task, "newtmgr_oic", nmgr_oic_task, NULL, + MYNEWT_VAL(OICMGR_TASK_PRIO), OS_WAIT_FOREVER, + oicmgr_stack, OICMGR_STACK_SZ); if (rc != 0) { goto err; } http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1b0fa3a2/mgmt/oicmgr/syscfg.yml ---------------------------------------------------------------------- diff --git a/mgmt/oicmgr/syscfg.yml b/mgmt/oicmgr/syscfg.yml index 5bf2332..eca2da7 100644 --- a/mgmt/oicmgr/syscfg.yml +++ b/mgmt/oicmgr/syscfg.yml @@ -1,10 +1,25 @@ -# Package: mgmt/newtmgr_oic - +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# syscfg.defs: - ### These should be renamed with a proper prefix. - NEWTMGR: - description: 'TBD' - value: 1 - OC_SERVER: - description: 'TBD' - value: 1 + OICMGR_TASK_PRIO: + type: 'task_priority' + value: 'any' + OICMGR_STACK_SIZE: + value: 512 +