Skip to content

Commit ac7451e

Browse files
mmahadevan108kartben
authored andcommitted
drivers: timer: Move MAX_WAIT to header file
Move MAX_WAIT define to the system timer header file so system timer drivers can use this define. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 501c6ab commit ac7451e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/zephyr/drivers/timer/system_timer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
extern "C" {
2323
#endif
2424

25+
#define SYS_CLOCK_MAX_WAIT (IS_ENABLED(CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE) \
26+
? K_TICKS_FOREVER : INT_MAX)
27+
2528
/**
2629
* @brief System Clock APIs
2730
* @defgroup clock_apis System Clock APIs

kernel/timeout.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ static sys_dlist_t timeout_list = SYS_DLIST_STATIC_INIT(&timeout_list);
2222
*/
2323
static struct k_spinlock timeout_lock;
2424

25-
#define MAX_WAIT (IS_ENABLED(CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE) \
26-
? K_TICKS_FOREVER : INT_MAX)
27-
2825
/* Ticks left to process in the currently-executing sys_clock_announce() */
2926
static int announce_remaining;
3027

@@ -91,7 +88,7 @@ static int32_t next_timeout(int32_t ticks_elapsed)
9188

9289
if ((to == NULL) ||
9390
((int64_t)(to->dticks - ticks_elapsed) > (int64_t)INT_MAX)) {
94-
ret = MAX_WAIT;
91+
ret = SYS_CLOCK_MAX_WAIT;
9592
} else {
9693
ret = MAX(0, to->dticks - ticks_elapsed);
9794
}

0 commit comments

Comments
 (0)