I am trying to properly understand how portYIELD_FROM_ISR() works. I am having some funny behavior in my code.
Let consider the following
1.Premeption is enabled
2.I have a highest priority task waiting on a semaphore to be given. A context switch may or have occured
2.The ISR runs and portYIELD_FROM_ISR() is called because a highest prioirty task was waiting
At what point does the RTOS tell the highest priority task to run.
- Does the highest priority task know it has to run before the next premetive context switch
- Does it have to wait until another premeption event occours before the context switch can occour. Which would make it run
**Additional information **
The reason I am asking this is because my RTOS tick is 200Hz, but the interrupt that drive one of my task is 1kHz. So this task must run at 1kHz rate no exceptions.
But that task also has to wait another semaphore to be release by DMA receive interrupt. The DMA RX semaphore has timeouts but these timeouts are obvoisly reference againts the 200Hz tick interrupt. So if a context switch can only occur when a prempetion event occurs (i.e 200Hz) that means portYIELD_FROM_ISR() does not do what I intend it to do.
Some other notes
- The DMA RX interrupt will always run before the next 1kHz interrupt. This is guaranteed
- Interrupt prioirty are setup so that the RX DMA interrupt has a higher prioirty than the 1Khz interrupt…