Skip to content

Commit 7204858

Browse files
committed
NANO130: Enlarge timeout in CLK_WaitClockReady(...)
Most code doesn't check return code of CLK_WaitClockReady(...). Enlarge timeout to meet most cases. lp_ticker initialization fails with this issue. Steps for reproducing: 1. System runs in tickless from lp_ticker mode. 2. Arm WDT reset. 3. In next reset cycle, lp_ticker initialization fails (active flag doesn't become active).
1 parent e71ab0d commit 7204858

File tree

1 file changed

+1
-1
lines changed
  • targets/TARGET_NUVOTON/TARGET_NANO100/device/StdDriver

1 file changed

+1
-1
lines changed

targets/TARGET_NUVOTON/TARGET_NANO100/device/StdDriver/nano100_clk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ uint32_t CLK_WaitClockReady(uint32_t u32ClkMask)
613613
{
614614
int32_t i32TimeOutCnt;
615615

616-
i32TimeOutCnt = __HSI / 200; /* About 5ms */
616+
i32TimeOutCnt = __HSI / 20; /* About 50ms */
617617

618618
while((CLK->CLKSTATUS & u32ClkMask) != u32ClkMask) {
619619
if(i32TimeOutCnt-- <= 0)

0 commit comments

Comments
 (0)