Does the NFC library globally disable interrupts at any point? We're trying to track down an issue where our code occasionally misses an I2C event during NFC read/write.
Does the NFC library globally disable interrupts at any point? We're trying to track down an issue where our code occasionally misses an I2C event during NFC read/write.
Yes, the NFC library can globally disable interrupts through nrf_drv_clock module, look for CRITICAL_REGION_ENTER()
and CRITICAL_REGION_EXIT()
macros (using critical sections for RMW operations on driver's state variables). The nrf_drv_clock is used for controlling oscillators. NFC can only be enabled when a high precession crystal oscillator is running.
But even if IRQs are disabled, the I2C events should be set as pending and should fire when the interrupts are enabled again.
Thanks for the update. Turns out our problem was not related to the NFC Library disabling / enabling interrupts. It was caused by a timing problem in our code. Good to know about the NFC interrupts, though.
To answer my own question: No, the NFC Type 4 library does not globally disable interrupts.