nrf: nvm: assume sd is not enabled if interrupts are off

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>
This commit is contained in:
Sean Cross 2020-05-08 16:59:39 +08:00
parent fd4ef233c6
commit 67cf005ee5
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}