File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ watchdog_status_t hal_watchdog_init(const watchdog_config_t *config)
9999 if (! wdt_hw_inited ) {
100100 wdt_hw_inited = 1 ;
101101
102+ SYS_UnlockReg ();
103+
102104 /* Enable IP module clock */
103105 CLK_EnableModuleClock (WDT_MODULE );
104106
@@ -109,6 +111,8 @@ watchdog_status_t hal_watchdog_init(const watchdog_config_t *config)
109111 CLK_SetModuleClock (WDT_MODULE , CLK_CLKSEL1_WDTSEL_LIRC , 0 );
110112#endif
111113
114+ SYS_LockReg ();
115+
112116 /* Set up IP interrupt */
113117 NVIC_SetVector (WDT_IRQn , (uint32_t ) WDT_IRQHandler );
114118 NVIC_EnableIRQ (WDT_IRQn );
Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ watchdog_status_t hal_watchdog_init(const watchdog_config_t *config)
9898 if (! wdt_hw_inited ) {
9999 wdt_hw_inited = 1 ;
100100
101+ SYS_UnlockReg ();
102+
101103 /* Enable IP module clock */
102104 CLK_EnableModuleClock (WDT_MODULE );
103105
@@ -108,6 +110,8 @@ watchdog_status_t hal_watchdog_init(const watchdog_config_t *config)
108110 CLK_SetModuleClock (WDT_MODULE , CLK_CLKSEL1_WDTSEL_LIRC , 0 );
109111#endif
110112
113+ SYS_LockReg ();
114+
111115 /* Set up IP interrupt */
112116 NVIC_SetVector (WDT_IRQn , (uint32_t ) WDT_IRQHandler );
113117 NVIC_EnableIRQ (WDT_IRQn );
Original file line number Diff line number Diff line change @@ -101,12 +101,16 @@ watchdog_status_t hal_watchdog_init(const watchdog_config_t *config)
101101 if (! wdt_hw_inited ) {
102102 wdt_hw_inited = 1 ;
103103
104+ SYS_UnlockReg ();
105+
104106 /* Enable IP module clock */
105107 CLK_EnableModuleClock (WDT_MODULE );
106108
107109 /* Select IP clock source */
108110 CLK_SetModuleClock (WDT_MODULE , 0 , 0 );
109111
112+ SYS_LockReg ();
113+
110114 /* Set up IP interrupt */
111115 NVIC_SetVector (WDT_IRQn , (uint32_t ) WDT_IRQHandler );
112116 NVIC_EnableIRQ (WDT_IRQn );
Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ watchdog_status_t hal_watchdog_init(const watchdog_config_t *config)
9898 if (! wdt_hw_inited ) {
9999 wdt_hw_inited = 1 ;
100100
101+ SYS_UnlockReg ();
102+
101103 /* Enable IP module clock */
102104 CLK_EnableModuleClock (WDT_MODULE );
103105
@@ -108,6 +110,8 @@ watchdog_status_t hal_watchdog_init(const watchdog_config_t *config)
108110 CLK_SetModuleClock (WDT_MODULE , CLK_CLKSEL1_WDTSEL_LIRC , 0 );
109111#endif
110112
113+ SYS_LockReg ();
114+
111115 /* Set up IP interrupt */
112116 NVIC_SetVector (WDT_IRQn , (uint32_t ) WDT_IRQHandler );
113117 NVIC_EnableIRQ (WDT_IRQn );
You can’t perform that action at this time.
0 commit comments