/* ************************************************************************************************************************ * Timer tick function * * Description: This function is called by timer interrupt if CONFIG_RAW_TASK_0 is enabled. * * Arguments :None * * * * * Returns None * * Note(s) Called by your own system timer interrupt. * * ************************************************************************************************************************ */ RAW_OS_ERROR task_0_tick_post(void) { RAW_OS_ERROR ret; ret = raw_task_0_post(&task_0_event_handler, raw_task_active->priority, 0); return ret; }
RAW_OS_ERROR int_msg_post(RAW_U8 type, void *p_obj, void *p_void, MSG_SIZE_TYPE msg_size, RAW_U32 flags, RAW_U8 opt) { OBJECT_INT_MSG *msg_data; RAW_OS_ERROR task_0_post_ret; RAW_SR_ALLOC(); RAW_CPU_DISABLE(); if (free_object_int_msg == 0) { int_msg_full++; RAW_CPU_ENABLE(); TRACE_INT_MSG_EXHAUSTED(); return RAW_INT_MSG_EXHAUSTED; } msg_data = free_object_int_msg; free_object_int_msg->type = type; free_object_int_msg->object = p_obj; free_object_int_msg->msg = p_void; free_object_int_msg->msg_size = msg_size; free_object_int_msg->event_flags = flags; free_object_int_msg->opt = opt; free_object_int_msg = free_object_int_msg->next; RAW_CPU_ENABLE(); /*raw_task_0_post may fail here due to full task0 events*/ task_0_post_ret = raw_task_0_post(&msg_event_handler, type, msg_data); if (task_0_post_ret == RAW_SUCCESS) { TRACE_INT_MSG_POST(type, p_obj, p_void, msg_size, flags, opt); } else { /*if raw_task_0_post fail, free_object_int_msg will be taken back*/ RAW_CPU_DISABLE(); msg_data->next = free_object_int_msg; free_object_int_msg = msg_data; RAW_CPU_ENABLE(); } return task_0_post_ret; }
void post_event() { raw_task_0_post(&p11, 1, 0); raw_task_0_post(&p22, 2, 0); }