FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2012 Threads] Yielding from an ISRPosted by rafleury on April 23, 2012 How important is it that vPortYieldFromISR() is called at the very end of the ISR handler? For example:
void UART0_IRQHandler(void) { Bool woken = false; someAPICall(&woken);
portyieldfromisr(woken);
}
is this functionally different from:
void UART0_IRQHandler(void) { doStuff(); }
void doStuff() { Bool woken = false;
someAPICall(&woken);
portyieldfromisr(woken); }
For refernce im using Rowley Crossworks and the LPC1763.
RE: Yielding from an ISRPosted by Richard on April 24, 2012 On some ports it is extremely important, essential even, that the yielding is done as the last thing. On the Cortex-M however, it is not important, and either of your code snippets are fine, provided your doStuff() function is only called from an interrupt. If it is not called from an interrupt then it will still be ok provided the function that calls it takes care of the yielding if one is required.
Regards.
RE: Yielding from an ISRPosted by Frank Andersen on April 24, 2012 Hi Richard,
Could you please explain why the yield not is important on the Cortex-M?
Best regards,
Frank Andersen
RE: Yielding from an ISRPosted by Richard on April 24, 2012 Every port is different. Some require direct manipulation of the ISR exit code, in which case the yield must be at the end, or use function calls, which again means it has to be at the end, but the Cortex-M just pends the PendSV interrupt, and that can be done at any time because the interrupt won't execute until the original ISR exits (because the PendSV is the lowest priority).
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|