File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -94,11 +94,13 @@ void board_init(void)
94
94
// #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3
95
95
// in board.h when using that power configuration.
96
96
#ifdef UICR_REGOUT0_VALUE
97
- if (NRF_UICR -> REGOUT0 != UICR_REGOUT0_VALUE )
97
+ if ((NRF_UICR -> REGOUT0 & UICR_REGOUT0_VOUT_Msk ) !=
98
+ (UICR_REGOUT0_VALUE << UICR_REGOUT0_VOUT_Pos ))
98
99
{
99
100
NRF_NVMC -> CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos ;
100
101
while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
101
- NRF_UICR -> REGOUT0 = UICR_REGOUT0_VALUE ;
102
+ NRF_UICR -> REGOUT0 = (NRF_UICR -> REGOUT0 & ~((uint32_t )UICR_REGOUT0_VOUT_Msk )) |
103
+ (UICR_REGOUT0_VALUE << UICR_REGOUT0_VOUT_Pos );
102
104
103
105
NRF_NVMC -> CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos ;
104
106
while (NRF_NVMC -> READY == NVMC_READY_READY_Busy ){}
You can’t perform that action at this time.
0 commit comments