Skip to content

Commit 05d33b0

Browse files
committed
Remove unnecessary low power ticker rescheduling
Schedule the next OS tick inside of the ticker interrupt rather than in the systick interrupt. Scheduling this while the ticker is dispatching prevents an unnecissary rescheduling since this rescheduling is done anyway when dispatching is finished. This is particularly useful for the low power ticker on devices with LPTICKER_DELAY_TICKS set to a non-zero value. This is because the low power ticker cannot be reschduled immediately and needs to fall back onto the microsecond ticker which temporarily locks deep sleep. Note - the optimization in this commit is made possible by the commit: "Don't reschedule ticker while dispatching"
1 parent e69ecaa commit 05d33b0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

rtos/TARGET_CORTEX/SysTimer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ void SysTimer::handler()
178178
} else {
179179
_set_irq_pending();
180180
_increment_tick();
181+
schedule_tick();
181182
}
182183

183184
core_util_critical_section_exit();

rtos/TARGET_CORTEX/mbed_rtx_idle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void OS_Tick_Disable (void)
6363
/// Acknowledge System Timer IRQ.
6464
void OS_Tick_AcknowledgeIRQ (void)
6565
{
66-
os_timer->schedule_tick();
66+
6767
}
6868

6969
/// Get System Timer count.

0 commit comments

Comments
 (0)