?????????????????????????????
???????????? ???????[ 2012/10/8 9:58:38 ] ????????
????????????????????? ??????????????????????????????????貌???????????????????????浠�???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????伞?
????rawos?????????256??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????尾????????????蔚??????????????????????????????????????卸???????????
void caculate_time_slice() { RAW_TASK_OBJ *task_ptr; LIST *head; RAW_SR_ALLOC(); task_ptr = raw_task_active; head = &raw_ready_queue.task_ready_list[task_ptr->priority]; RAW_CRITICAL_ENTER(); if (is_list_empty(head)) { RAW_CRITICAL_EXIT(); return; } /*there is only one task on this ready list?? so do not need to caculate time slice*/ if (head->next->next == head) { RAW_CRITICAL_EXIT(); return; } if (task_ptr->time_slice) { task_ptr->time_slice--; } /*if current active task has time_slice?? just return*/ if (task_ptr->time_slice) { RAW_CRITICAL_EXIT(); return; } /*Move current active task to the end of ready list for the same priority*/ move_to_ready_list_end(&raw_ready_queue?? task_ptr); /*restore the task time slice*/ task_ptr->time_slice = task_ptr->time_total; RAW_CRITICAL_EXIT(); } |
??????????????????????????卸???????????????????????????????????????????????婊�?眉????????????????????????windows????????????????????????????????????sleep??0??????????????rawos??????????????
RAW_U16 raw_sleep(RAW_U32 dly) { RAW_U16 error_status; RAW_SR_ALLOC(); #if (RAW_TASK_FUNCTION_CHECK > 0) if (raw_int_nesting) { return RAW_NOT_CALLED_BY_ISR; } #endif RAW_CRITICAL_ENTER(); if (dly) { /*system is locked so task can not sleep just return immediately*/ if (raw_sched_lock) { RAW_CRITICAL_EXIT(); return RAW_SCHED_DISABLE; } raw_task_active->task_state = RAW_DLY; tick_list_insert(raw_task_active?? dly); remove_ready_list(&raw_ready_queue?? raw_task_active); } else { /*make current task to the end of ready list*/ move_to_ready_list_end(&raw_ready_queue?? raw_task_active); } RAW_CRITICAL_EXIT(); raw_sched(); if (dly) { /*task is timeout after sleep*/ error_status = block_state_post_process(raw_task_active?? 0); } else { error_status = RAW_SUCCESS; } return error_status; } |
??????
???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11