Skip to content

Commit 98d2d2f

Browse files
martinjaegernashif
authored andcommitted
task_wdt: fix overflow in current_ticks making wdt get stuck
The task_wdt was getting stuck after approx. 36 hours on e.g. nRF52840, which has a SysTick with 32768 Hz. This corresponds to an overflow of the uint32_t current_ticks in schedule_next_timeout. This commit fixes the accidentally introduced narrowing conversion. Fixes #40152 Signed-off-by: Martin Jäger <[email protected]>
1 parent 1123b80 commit 98d2d2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/task_wdt/task_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int hw_wdt_channel;
5050
static bool hw_wdt_started;
5151
#endif
5252

53-
static void schedule_next_timeout(uint32_t current_ticks)
53+
static void schedule_next_timeout(int64_t current_ticks)
5454
{
5555
int next_channel_id; /* channel which will time out next */
5656
int64_t next_timeout; /* timeout in absolute ticks of this channel */

0 commit comments

Comments
 (0)