From dabed3c7fbeb64d4657c235b2346899c15344f02 Mon Sep 17 00:00:00 2001 From: ligd Date: Tue, 26 Dec 2023 18:24:03 +0800 Subject: [PATCH] armv7-a/r: correct maxdelay calculating Signed-off-by: ligd --- arch/arm/src/armv7-a/arm_timer.c | 2 +- arch/arm/src/armv7-r/arm_timer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/armv7-a/arm_timer.c b/arch/arm/src/armv7-a/arm_timer.c index 54d53a300f..07a2f9988c 100644 --- a/arch/arm/src/armv7-a/arm_timer.c +++ b/arch/arm/src/armv7-a/arm_timer.c @@ -150,7 +150,7 @@ static int arm_timer_maxdelay(struct oneshot_lowerhalf_s *lower_, struct arm_timer_lowerhalf_s *lower = (struct arm_timer_lowerhalf_s *)lower_; - uint64_t maxnsec = nsec_from_count(UINT32_MAX, lower->freq); + uint64_t maxnsec = nsec_from_count(UINT64_MAX, lower->freq); ts->tv_sec = maxnsec / NSEC_PER_SEC; ts->tv_nsec = maxnsec % NSEC_PER_SEC; diff --git a/arch/arm/src/armv7-r/arm_timer.c b/arch/arm/src/armv7-r/arm_timer.c index fafcbf98c0..0d6a01bd6b 100644 --- a/arch/arm/src/armv7-r/arm_timer.c +++ b/arch/arm/src/armv7-r/arm_timer.c @@ -150,7 +150,7 @@ static int arm_timer_maxdelay(struct oneshot_lowerhalf_s *lower_, struct arm_timer_lowerhalf_s *lower = (struct arm_timer_lowerhalf_s *)lower_; - uint64_t maxnsec = nsec_from_count(UINT32_MAX, lower->freq); + uint64_t maxnsec = nsec_from_count(UINT64_MAX, lower->freq); ts->tv_sec = maxnsec / NSEC_PER_SEC; ts->tv_nsec = maxnsec % NSEC_PER_SEC;