a bugfix for mail queue and printf clipping switch
1. add TOS_CFG_LIBC_PRINTF_EN 1: enable printf to implement tos_kprintf when you call tos_kprintf(actually currently it's a MACRO rather than a function) , the libc will be invloved into the image, most of the time it means a larger image size. 0: disable printf, means tos_kprintf is defined as an empty MACRO most of the time, means you will not get a log output from the uart(currently we donnot have a console yet) but a smaller image size. 2. fix a bug of tos_mail_q and tos_priority_mail_q if we are post-ing a mail and there is[are] task[s] just pend-ing for the mail queue, the mail delivered to the pend-er will be a pointer, and probably it's a pointer to the local variable on the stack. Actually we should do a memcpy rather than a pointer assignment. for more details, see the patch.
This commit is contained in:
@@ -71,21 +71,10 @@ __STATIC__ void tick_task_takeoff(k_task_t *task)
|
||||
TOS_CPU_INT_ENABLE();
|
||||
}
|
||||
|
||||
__KERNEL__ k_err_t tick_list_add(k_task_t *task, k_tick_t timeout)
|
||||
__KERNEL__ void tick_list_add(k_task_t *task, k_tick_t timeout)
|
||||
{
|
||||
if (timeout == TOS_TIME_NOWAIT) {
|
||||
return K_ERR_DELAY_ZERO;
|
||||
}
|
||||
|
||||
if (timeout == TOS_TIME_FOREVER) {
|
||||
return K_ERR_DELAY_FOREVER;
|
||||
}
|
||||
|
||||
task->tick_expires = timeout;
|
||||
|
||||
tick_task_place(task, timeout);
|
||||
task_state_set_sleeping(task);
|
||||
return K_ERR_NONE;
|
||||
}
|
||||
|
||||
__KERNEL__ void tick_list_remove(k_task_t *task)
|
||||
|
Reference in New Issue
Block a user