update System/os_handler.c.

Signed-off-by: 零中断延迟的RTOS <cosyos@139.com>
This commit is contained in:
零中断延迟的RTOS
2024-12-30 07:30:52 +00:00
committed by Gitee
parent 5880821702
commit bd22da0d02
+23 -18
View File
@@ -3,8 +3,8 @@
* @file os_handler.c
* @brief OS_SysTick_Handler and sPendSV_Handler
* @author 迟凯峰
* @version V3.3.0
* @date 2024.12.25
* @version V3.3.1
* @date 2024.12.30
******************************************************************************/
#include "os_link.h"
@@ -25,7 +25,6 @@ static s_tasknode_tsp _SYS_MEM_ task_node[3] = {OS_NULL};
void OS_SysTick_Handler(void) MCUCFG_SYSTICK_ATTRIBUTE
{
s_u8_t _SYS_REG_ i;
s_tasknode_tsp _SYS_REG_ node_curr;
#if SYSCFG_SYSTICKTIME_COUNT == __ENABLED__
static m_tick_t tick_temp;
#endif
@@ -201,16 +200,29 @@ void OS_SysTick_Handler(void) MCUCFG_SYSTICK_ATTRIBUTE
#endif
/* 延时定时器 */
i = task_queue_len - 1;
node_curr = node_head;
while(true){
if(node_curr->status <= OS_STATUS_BLOCKED){
if(node_curr->timer && node_curr->timer < (s_delay_t)~0){
node_curr->timer--;
if(true){
s_tasknode_tsp _SYS_REG_ node_curr = node_head;
i = task_queue_len;
while(true){
if(node_curr->status == OS_STATUS_BLOCKED){
if(node_curr->timer && node_curr->timer < (s_delay_t)~0){
node_curr->timer--;
}
}
if(!--i) break;
move_backward;
}
if(s_sign_schedule_forbid){
if(s_task_current->timer && s_task_current->timer < (s_delay_t)~0){
s_task_current->timer--;
}
}
if(!--i) break;
move_backward;
/* 定时调度(触发完整调度)*/
else{
mPendSV_Set;
}
s_sign_schedule_all = true;
s_sign_schedule = true;
}
/* 时间片计数 */
@@ -243,13 +255,6 @@ void OS_SysTick_Handler(void) MCUCFG_SYSTICK_ATTRIBUTE
#endif
}
#endif
/* 定时调度(触发完整调度)*/
s_sign_schedule_all = true;
s_sign_schedule = true;
if(!s_sign_schedule_forbid){
mPendSV_Set;
}
}
/* 移除节点(从任务队列中移除当前节点)*/