I'm building an application where I must generate several signals with quite precise timing (about 1us resolution). As I have too many signals to generate I can't use PWM channels. So I decided to generate the signals in a timer interrupt. That works OK, but I found out my interrupts had some jitters, and noticed this jitter was caused by FreeRTOS disabling interrupts.
The solution I found was to transform the port code, from this:
#define portDISABLE_INTERRUPTS() DISABLE_ALL_INTERRUPTS() #define portENABLE_INTERRUPTS() ENABLE_ALL_INTERRUPTS()
#define portDISABLE_INTERRUPTS() DISABLE_INT_LEVEL(0) #define portENABLE_INTERRUPTS() ENABLE_INT_LEVEL(0)
I configured a higher priority for my timer interrupt, and now FreeRTOS is not disturbing it.
So here comes my question : do you think it's safe to just disable the lowest level of interrupt? May that break something if an interrupt occurs in an OS critical section?