Skip to content

Commit

Permalink
nrf: nvm: assume sd is not enabled if interrupts are off
Browse files Browse the repository at this point in the history
If interrupts are disabled, then calling sd_* functions will hardfault.
Instead, assume that it's safe to write if interrupts are disabled.

Signed-off-by: Sean Cross <sean@xobs.io>
  • Loading branch information
xobs committed May 8, 2020
1 parent 1788da2 commit b41606c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ports/nrf/peripherals/nrf/nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

STATIC bool sd_is_enabled(void) {
uint8_t sd_en = 0;
if (__get_PRIMASK())
return false;
(void) sd_softdevice_is_enabled(&sd_en);
return sd_en;
}
Expand Down

0 comments on commit b41606c

Please sign in to comment.