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 <ioannis.damigos.uj@renesas.com>
This commit is contained in:
Ioannis Damigos 2025-01-07 12:39:16 +02:00 committed by Benjamin Cabé
parent ecefb5de5d
commit 6b9eaa9f47

View file

@ -120,7 +120,8 @@ void sys_clock_set_timeout(int32_t ticks, bool idle)
* RC32K maximum frequency.
*/
watchdog_expire_ticks = SYS_WDOG->WATCHDOG_REG *
CONFIG_SYS_CLOCK_TICKS_PER_SEC / (get_rc32k_max_frequency() / 320);
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC /
(get_rc32k_max_frequency() / 320);
}
if (watchdog_expire_ticks - 2 < ticks) {
ticks = watchdog_expire_ticks - 2;