Skip to content

Commit b010356

Browse files
GUIDINGLIxiaoxiang781216
authored andcommitted
wdog: fix timer IRQ busy when timer list empty
when timer list empty, should return 0 to indicate we are no longer set time Signed-off-by: ligd <[email protected]>
1 parent f23fb7e commit b010356

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sched/sched/sched_timerexpiration.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static clock_t nxsched_timer_process(clock_t ticks, clock_t elapsed,
362362
tmp = nxsched_process_scheduler(ticks, elapsed, noswitches);
363363

364364
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC)
365-
if (tmp > 0 && tmp < rettime)
365+
if (tmp > 0 && (rettime == 0 || tmp < rettime))
366366
{
367367
rettime = tmp;
368368
}

sched/wdog/wd_start.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ clock_t wd_timer(clock_t ticks, bool noswitches)
402402
if (list_is_empty(&g_wdactivelist))
403403
{
404404
leave_critical_section(flags);
405-
return CLOCK_MAX;
405+
return 0;
406406
}
407407

408408
/* Notice that if noswitches, expired - g_wdtickbase

0 commit comments

Comments
 (0)