Skip to content

Commit bd12455

Browse files
authored
Merge pull request #344 from fanoush/fix-regout0-bootloop
fix reboot loop - set REGOUT0 only when value is erased to default
2 parents 3a2708b + fb557b2 commit bd12455

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_VALUE << UICR_REGOUT0_VOUT_Pos)){
114+
if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) == (UICR_REGOUT0_VOUT_DEFAULT << UICR_REGOUT0_VOUT_Pos)){
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)