Skip to content

Commit 48e6919

Browse files
committed
erase uicr if not correct
Revert "erase uicr if not correct" This reverts commit c2138f5. set regout0 if possible
1 parent 3a92db8 commit 48e6919

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/boards/boards.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void board_init(void) {
111111
// #define UICR_REGOUT0_VALUE UICR_REGOUT0_VOUT_3V3
112112
// in board.h when using that power configuration.
113113
#ifdef UICR_REGOUT0_VALUE
114-
if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) == (UICR_REGOUT0_VOUT_DEFAULT << UICR_REGOUT0_VOUT_Pos)){
114+
if (((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) != (UICR_REGOUT0_VALUE << UICR_REGOUT0_VOUT_Pos)) && (((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) & (UICR_REGOUT0_VALUE << UICR_REGOUT0_VOUT_Pos)) == (UICR_REGOUT0_VALUE << UICR_REGOUT0_VOUT_Pos))){ // cant write regout0 if any bits need to change to 1
115115
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
116116
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
117117
NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |

0 commit comments

Comments
 (0)