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] [July 2011 Threads] Context switch from co-routinePosted by Andrei on July 30, 2011 Hi all. static void __interrupt __far vExampleInterruptHandler( void ) { ... crQUEUE_RECEIVE_FROM_ISR( xIntegerQueue, &ulReceivedNumber, &pxCoRoutineWoken ); if( pxCoRoutineWoken == pdTRUE ) { // HOW CAN I "MANUALLY" SWITCH TO OTHER CO-ROUTINE WITH HIGHER PRIORITY ????? } }
Can I use vCoRoutineSchedule() API function??? Thanks.
RE: Context switch from co-routinePosted by Richard Damon on July 30, 2011 Note that co-routines do not support preemption, so the interrupt can't change which co-routine is running.
RE: Context switch from co-routinePosted by Andrei on July 31, 2011 To richard_damon:
But I can change current coroutine to other by call crDELAY(xHandle, 0); It will be correct, if I could do the same from ISR...
How to use parameter pxCoRoutineWoken in crQUEUE_RECEIVE_FROM_ISR() API function? What for is this parameter?
Thanks.
RE: Context switch from co-routinePosted by Richard Damon on July 31, 2011 Since Co-Routines do not support pre-emption, the switch between co-routines occurs when the co-routine calls an API function. They don't save enough state to allow a co-routine to be interrupted at another point and the flow of execution changed (to another co-routine). In effect, all the co-routines in a program fall within a single task, and that task can be pre-empted, so another task can run. This is what the Woken flag controls, should the "co-routine" task be woken by the interrupt.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|