nobody wrote on Wednesday, May 03, 2006:
Dear dispensers of wisdom,
The implementation of taskYIELD for the MSP430 GCC port calls vPortYield.
To make the stack look like the task was pre-empted by an ISR, vPortYield does the following:
asm volatile ("push r2"); // Save status register
_DINT(); // Disable interrupt.
portSAVE_CONTEXT(); // Save the context etc.
However, since taskYIELD is not called from an ISR, the Program Counter is not saved (register r0).
So if this context is restored, how could the task resume from the yield point.