Is it generally a bad idea to disable all interrupts, just temporarily, in an application that also uses the radio queue library?
For example, after receiving a radio packet I’m trying to measure how long something takes using the timer. I want this to be accurate, so I disable all interrupts. When I’m done, I enable them again. Here’s some simplified pseudocode.
while (1) {
if (rxPacket = radioQueueRxCurrentPacket()) {
// do stuff with rxPacket here
radioQueueRxDoneWithPacket();
EA = 0;
// start Timer 1
// do some timing-sensitive stuff during which we want no interrupts
// ...
// stop Timer 1
// we're done, enable interrupts again
EA = 1;
}
}
The problem is that the Wixel eventually locks up (within 10 or 20 seconds of starting up) and stops receiving packets. Just for reference, I’ve got a transmitter Wixel sending packets every 50ms.
Is what I’m trying to do just a bad idea? In other words, is there an obvious concurrency issue with the radio library that could be causing this?