From f5b6ae427c8035afe757b2a9ceec13f7f005a62b Mon Sep 17 00:00:00 2001 From: Chasel Date: Mon, 9 Dec 2024 11:47:24 +0800 Subject: [PATCH] [bsp][wch/risc-v][ch32] 1.fixed iwdt driver is not reload counter to register; --- bsp/wch/risc-v/Libraries/ch32_drivers/drv_iwdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/wch/risc-v/Libraries/ch32_drivers/drv_iwdt.c b/bsp/wch/risc-v/Libraries/ch32_drivers/drv_iwdt.c index a74a37d0cb..1497632cda 100644 --- a/bsp/wch/risc-v/Libraries/ch32_drivers/drv_iwdt.c +++ b/bsp/wch/risc-v/Libraries/ch32_drivers/drv_iwdt.c @@ -71,7 +71,7 @@ static rt_err_t ch32_wdt_control(rt_watchdog_t *wdt, int cmd, void *arg) IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); IWDG_SetPrescaler(wdt_dev->prescaler); IWDG_SetReload(wdt_dev->reload); - IWDG_WriteAccessCmd(IWDG_WriteAccess_Disable); + IWDG_ReloadCounter(); IWDG_Enable(); } break; @@ -89,7 +89,7 @@ static rt_err_t ch32_wdt_control(rt_watchdog_t *wdt, int cmd, void *arg) IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); IWDG_SetPrescaler(wdt_dev->prescaler); IWDG_SetReload(wdt_dev->reload); - IWDG_WriteAccessCmd(IWDG_WriteAccess_Disable); + IWDG_ReloadCounter(); IWDG_Enable(); wdt_dev->is_start = 1; break;