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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libhw/rp2040_hwtimer.c b/libhw/rp2040_hwtimer.c
index 4499642..c8c281e 100644
--- a/libhw/rp2040_hwtimer.c
+++ b/libhw/rp2040_hwtimer.c
@@ -68,7 +68,7 @@ static uint64_t rp2040_hwtimer_get_time_ns(implements_alarmclock *) {
return timer_time_us_64(timer_hw) * (NS_PER_S/US_PER_S);
}
-#define NS_TO_US_ROUNDUP(x) ( ( (x) + (NS_PER_S/US_PER_S)-1) / (NS_PER_S/US_PER_S) )
+#define NS_TO_US_ROUNDUP(x) LM_CEILDIV(x, NS_PER_S/US_PER_S)
static void rp2040_hwtimer_intrhandler(void) {
uint irq_num = __get_current_exception() - VTABLE_FIRST_IRQ;