nrf51: Add command to enable flash protection
Add braces for the while loop
This commit is contained in:
parent
6ae846ae24
commit
1b8e522e87
|
@ -288,16 +288,18 @@ static bool nrf51_cmd_protect_flash(target *t, int argc, const char **argv)
|
|||
target_mem_write32(t, NRF51_NVMC_CONFIG, NRF51_NVMC_CONFIG_WEN);
|
||||
|
||||
/* Poll for NVMC_READY */
|
||||
while (target_mem_read32(t, NRF51_NVMC_READY) == 0)
|
||||
while (target_mem_read32(t, NRF51_NVMC_READY) == 0) {
|
||||
if(target_check_error(t))
|
||||
return false;
|
||||
}
|
||||
|
||||
target_mem_write32(t, NRF51_APPROTECT, 0xFFFFFF00);
|
||||
|
||||
/* Poll for NVMC_READY */
|
||||
while (target_mem_read32(t, NRF51_NVMC_READY) == 0)
|
||||
while (target_mem_read32(t, NRF51_NVMC_READY) == 0) {
|
||||
if(target_check_error(t))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue