I’ve run into a problem caused by my calling from an ISR a function that, ultimately, calls portENTER_CRITICAL(), or more to the point, portEXIT_CRITICAL(), with the well-discussed effect that interrupts get enabled while still in the ISR. Fine, I understand the problem.
My solution, for which I guess I’m seeking validation, was simply to increment uxCriticalNesting from within the FreeRTOS interrupt_handler, after its original value has been saved. When interrupt_handler finally unwinds, it restores uxCriticalNesting to its original value, and no one is the wiser, except that my code doesn’t crash.
It seems to me that this is a legitimate use of uxCriticalNesting, and I can’t see any drawbacks, but then I didn’t write the Microblaze port, and I don’t like second-guessing published code.
Am I all wet? Do I just not understand the point of uxCriticalNesting? I appreciate any thoughts on the subject.
Xilinx Spartan 6
Xilinx EDK 14.5