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