nobody wrote on Thursday, February 01, 2007:
In my highest priority task I wait for an interrupt to occur in the following way:
static uint8_t volatile timerOVF;
//a lot of other code here
//Service the watchdog before and after the loop
while( timerOVF == 0 )
timerOVF = 0;
__interrupt void Timer0_Overflow( void )
timerOVF = 1;
As can been seen I use vTaskDelay(1) to force a context switch. For some strange reason calling taskYIELD() does not change the context (actually it does, but the new context is the same as the current context). As a result all other tasks are starved from processing time.
The task calling WaitForSecond() has the highest priority, so I can understand why the yield might pick it as the next task (this might be considered a bug). What I do not understand is why vTaskDelay is able to create an actual context switch.
Can anyone help me out on this one?