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)
94
94
* start of boot process on detecting WDT reset.
95
95
*/
96
96
if (SYS_IS_WDT_RST ()) {
97
+ /* Re-unlock to highlight WDT clock setting is protected */
98
+ SYS_UnlockReg ();
99
+
97
100
/* Enable IP module clock */
98
101
CLK_EnableModuleClock (WDT_MODULE );
99
102
@@ -108,8 +111,6 @@ void mbed_sdk_init(void)
108
111
*/
109
112
NVIC_EnableIRQ (WDT_IRQn );
110
113
111
- SYS_UnlockReg ();
112
-
113
114
/* Configure/Enable WDT */
114
115
WDT -> CTL = WDT_TIMEOUT_2POW4 | // Timeout interval of 2^4 LIRC clocks
115
116
WDT_CTL_WDTEN_Msk | // Enable watchdog timer
@@ -123,6 +124,9 @@ void mbed_sdk_init(void)
123
124
124
125
CLK_PowerDown ();
125
126
127
+ /* Re-unlock for safe */
128
+ SYS_UnlockReg ();
129
+
126
130
/* Clear all flags & Disable WDT/INT/WK/RST */
127
131
WDT -> CTL = (WDT_CTL_WKF_Msk | WDT_CTL_IF_Msk | WDT_CTL_RSTF_Msk | WDT_CTL_RSTCNT_Msk );
128
132
You can’t perform that action at this time.
0 commit comments