nrfx: improve nRF91 anomaly 7 workaround in the NVMC driver

Now the interrupts are disabled to make sure
no context switch happens when workaround is applied.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
This commit is contained in:
Adam Wojasinski 2023-09-22 11:39:20 +02:00 committed by Andrzej Głąbek
parent 6d5c69ce9b
commit 568a5e90b8
1 changed files with 12 additions and 0 deletions

View File

@ -328,10 +328,22 @@ NRFX_STATIC_INLINE bool nrfx_nvmc_write_done_check(void)
NRFX_STATIC_INLINE uint32_t nrfx_nvmc_uicr_word_read(uint32_t const volatile *address)
{
#if NRF91_ERRATA_7_ENABLE_WORKAROUND
bool irq_disabled = __get_PRIMASK() == 1;
if (!irq_disabled)
{
__disable_irq();
}
#endif
uint32_t value = nrf_nvmc_word_read((uint32_t)address);
#if NRF91_ERRATA_7_ENABLE_WORKAROUND
__DSB();
if (!irq_disabled)
{
__enable_irq();
}
#endif
return value;