yuriykulikov/FreeRTOS-on-XMEGA

taskYIELD() doesn't work under load

Closed this issue · 0 comments

When CPU is under a heavy load with a low priority task and higher priority task is woken by posting to the queue from ISR, a call to taskYIELD() hangs the kernel.

Example:
this doesn't work is lower priority task is running:
ISR(USARTC0_RXC_vect){ if( usartC->USART_RXComplete() ) taskYIELD(); }

this does, but lower priority task is not yield until the time slice.
ISR(USARTC0_RXC_vect){ if( usartC->USART_RXComplete() ) /taskYIELD()/; }

Possible solution is a naked + manual context switch interrupt routine for usart and spi slave.