Skip to content

Commit 6b9eaa9

Browse files
ydamigoskartben
authored andcommitted
smartbond_timer: Use hw clock frequency for watchdog expire ticks
Use hardware clock frequency to calculate watchdog expire ticks instead of kernel's "ticks". Signed-off-by: Ioannis Damigos <[email protected]>
1 parent ecefb5d commit 6b9eaa9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/timer/smartbond_timer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ void sys_clock_set_timeout(int32_t ticks, bool idle)
120120
* RC32K maximum frequency.
121121
*/
122122
watchdog_expire_ticks = SYS_WDOG->WATCHDOG_REG *
123-
CONFIG_SYS_CLOCK_TICKS_PER_SEC / (get_rc32k_max_frequency() / 320);
123+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC /
124+
(get_rc32k_max_frequency() / 320);
124125
}
125126
if (watchdog_expire_ticks - 2 < ticks) {
126127
ticks = watchdog_expire_ticks - 2;

0 commit comments

Comments
 (0)