a very simple shell framework

simple, clear, easy to DIY
This commit is contained in:
daishengdong
2020-01-08 13:54:56 +08:00
parent dea65a2d66
commit 72481955e2
66 changed files with 12408 additions and 240 deletions

View File

@@ -82,10 +82,6 @@ __STATIC__ void timer_takeoff(k_timer_t *tmr)
__STATIC_INLINE__ void timer_reset(k_timer_t *tmr)
{
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
knl_object_deinit(&tmr->knl_obj);
#endif
tmr->state = TIMER_STATE_UNUSED;
tmr->delay = (k_tick_t)0u;
tmr->expires = (k_tick_t)0u;
@@ -94,6 +90,8 @@ __STATIC_INLINE__ void timer_reset(k_timer_t *tmr)
tmr->cb = K_NULL;
tmr->cb_arg = K_NULL;
tos_list_init(&tmr->list);
TOS_OBJ_DEINIT(tmr);
}
__API__ k_err_t tos_timer_create(k_timer_t *tmr,
@@ -127,10 +125,6 @@ __API__ k_err_t tos_timer_create(k_timer_t *tmr,
return K_ERR_TIMER_PERIOD_FOREVER;
}
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
knl_object_init(&tmr->knl_obj, KNL_OBJ_TYPE_TIMER);
#endif
tmr->state = TIMER_STATE_STOPPED;
tmr->delay = delay;
tmr->expires = (k_tick_t)0u;
@@ -139,6 +133,9 @@ __API__ k_err_t tos_timer_create(k_timer_t *tmr,
tmr->cb = callback;
tmr->cb_arg = cb_arg;
tos_list_init(&tmr->list);
TOS_OBJ_INIT(tmr, KNL_OBJ_TYPE_TIMER);
return K_ERR_NONE;
}