summaryrefslogtreecommitdiff
path: root/libhw/rp2040_hwtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhw/rp2040_hwtimer.c')
-rw-r--r--libhw/rp2040_hwtimer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libhw/rp2040_hwtimer.c b/libhw/rp2040_hwtimer.c
index 9af499a..4499642 100644
--- a/libhw/rp2040_hwtimer.c
+++ b/libhw/rp2040_hwtimer.c
@@ -87,7 +87,8 @@ static void rp2040_hwtimer_intrhandler(void) {
trigger->prev = NULL;
}
- hw_clear_bits(&timer_hw->intf, 1 << alarm_num);
+ hw_clear_bits(&timer_hw->intf, 1 << alarm_num); /* Clear "force"ing the interrupt. */
+ hw_clear_bits(&timer_hw->intr, 1 << alarm_num); /* Clear natural firing of the alarm. */
if (alarmclock->queue)
timer_hw->alarm[alarm_num] = (uint32_t)NS_TO_US_ROUNDUP(alarmclock->queue->fire_at_ns);
}
@@ -132,7 +133,7 @@ static bool rp2040_hwtimer_add_trigger(implements_alarmclock *_alarmclock,
alarmclock->initialized = true;
}
if (alarmclock->queue == trigger) {
- /* Force the interrupt handler to trigger as soon as
+ /* "Force" the interrupt handler to trigger as soon as
* we enable interrupts. This handles the case of
* when fire_at_ns is before when we called
* cr_save_and_disable_interrupts(). We could check