File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
targets/TARGET_NUVOTON/TARGET_M480 Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ void mbed_sdk_init(void)
9494 * start of boot process on detecting WDT reset.
9595 */
9696 if (SYS_IS_WDT_RST ()) {
97+ /* Re-unlock to highlight WDT clock setting is protected */
98+ SYS_UnlockReg ();
99+
97100 /* Enable IP module clock */
98101 CLK_EnableModuleClock (WDT_MODULE );
99102
@@ -108,8 +111,6 @@ void mbed_sdk_init(void)
108111 */
109112 NVIC_EnableIRQ (WDT_IRQn );
110113
111- SYS_UnlockReg ();
112-
113114 /* Configure/Enable WDT */
114115 WDT -> CTL = WDT_TIMEOUT_2POW4 | // Timeout interval of 2^4 LIRC clocks
115116 WDT_CTL_WDTEN_Msk | // Enable watchdog timer
@@ -123,6 +124,9 @@ void mbed_sdk_init(void)
123124
124125 CLK_PowerDown ();
125126
127+ /* Re-unlock for safe */
128+ SYS_UnlockReg ();
129+
126130 /* Clear all flags & Disable WDT/INT/WK/RST */
127131 WDT -> CTL = (WDT_CTL_WKF_Msk | WDT_CTL_IF_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_RSTCNT_Msk );
128132
You can’t perform that action at this time.
0 commit comments