Skip to content

Commit

Permalink
[bsp][wch/risc-v][ch32] 1.fixed iwdt driver is not reload counter to …
Browse files Browse the repository at this point in the history
…register;
  • Loading branch information
Maihuanyi authored and mysterywolf committed Dec 9, 2024
1 parent ec900a7 commit f5b6ae4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bsp/wch/risc-v/Libraries/ch32_drivers/drv_iwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit f5b6ae4

Please sign in to comment.