From c755f88f8c6862ef1497375df2d09454c99a0632 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Fri, 13 Dec 2024 17:36:53 -0500 Subject: Gather macros into libmisc/macro.h --- libhw/rp2040_hwtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libhw/rp2040_hwtimer.c') 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; -- cgit v1.2.3-2-g168b