From 2930d000ffd7088e5df8b9290ebce276f692966b Mon Sep 17 00:00:00 2001 From: Vincent Wan Date: Fri, 13 Sep 2019 16:32:27 -0700 Subject: [PATCH] tests/kernel/sleep: relax upper bound for TI CC13X2/CC26X2 RTC The RTC on TI CC13X2/CC26X2 is a 32 KHz clock for which the minimum compare delay is 3 ticks. When using it as the system clock, we need to relax the upper bound to ensure the test succeeds. Signed-off-by: Vincent Wan --- tests/kernel/sleep/src/usleep.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/kernel/sleep/src/usleep.c b/tests/kernel/sleep/src/usleep.c index 70fbd63f162..169698879f6 100644 --- a/tests/kernel/sleep/src/usleep.c +++ b/tests/kernel/sleep/src/usleep.c @@ -26,6 +26,14 @@ #if defined(CONFIG_NRF_RTC_TIMER) && (CONFIG_SYS_CLOCK_TICKS_PER_SEC > 16384) #define MAXIMUM_SHORTEST_TICKS 3 +/* + * Similar situation for TI CC13X2/CC26X2 RTC due to the limitation + * that a value too close to the current time cannot be loaded to + * its comparator. + */ +#elif defined(CONFIG_CC13X2_CC26X2_RTC_TIMER) && \ + (CONFIG_SYS_CLOCK_TICKS_PER_SEC > 16384) +#define MAXIMUM_SHORTEST_TICKS 3 #else #define MAXIMUM_SHORTEST_TICKS 1 #endif