summaryrefslogtreecommitdiff
path: root/libhw/rp2040_hwtimer.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-13 18:49:15 -0500
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-13 18:49:15 -0500
commitc578a300c7d0d46662fcd0bdce69af95a821bc18 (patch)
treea99de333f2812d7c018820f39d78b8c4e744f705 /libhw/rp2040_hwtimer.c
parent6a719c63ecb83a850c317ea94b8932aa0c857770 (diff)
parent57cc0523f600575feda09bd9fae13f685ce85b0f (diff)
Merge commit '57cc0523f600575feda09bd9fae13f685ce85b0f'
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;