File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,21 @@ void init( void )
4444 NRF_RTC1 -> INTENSET = RTC_INTENSET_OVRFLW_Msk ;
4545 NRF_RTC1 -> EVTENSET = RTC_EVTEN_OVRFLW_Msk ;
4646 NRF_RTC1 -> TASKS_START = 1 ;
47+
48+ #if defined(RESET_PIN )
49+ if (((NRF_UICR -> PSELRESET [0 ] & UICR_PSELRESET_CONNECT_Msk ) != (UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos )) ||
50+ ((NRF_UICR -> PSELRESET [1 ] & UICR_PSELRESET_CONNECT_Msk ) != (UICR_PSELRESET_CONNECT_Connected << UICR_PSELRESET_CONNECT_Pos ))){
51+ NRF_NVMC -> CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos ;
52+ while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
53+ NRF_UICR -> PSELRESET [0 ] = RESET_PIN ;
54+ while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
55+ NRF_UICR -> PSELRESET [1 ] = RESET_PIN ;
56+ while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
57+ NRF_NVMC -> CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos ;
58+ while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
59+ NVIC_SystemReset ();
60+ }
61+ #endif
4762}
4863
4964#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments