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] [September 2007 Threads] vCoRoutineSchedule to xCoRoutineSchedulePosted by sashiono on September 12, 2007 proposed change/addition to vCoRoutineSchedule to xCoRoutineSchedule
instead of returning void I would like to return the true if a co-routine is ready to be scheduled, otherwise false if all the co-routines are blocked.
something like this
signed portBASE_TYPE xCoRoutineSchedule( void ) { /* See if any co-routines readied by events need moving to the ready lists. */ prvCheckPendingReadyList();
/* See if any delayed co-routines have timed out. */ prvCheckDelayedList();
/* Find the highest priority queue that contains ready co-routines. */ while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) ) { if( uxTopCoRoutineReadyPriority == 0 ) { /* No more co-routines to check. */ return pdFALSE; } --uxTopCoRoutineReadyPriority; }
/* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines of thesame priority get an equal share of the processor time. */ listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) );
/* Call the co-routine. */ ( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
return pdTRUE; }
The reason this would be useful is for power reduction for example, the IdleHook can look something like this now.
void vApplicationIdleHook( void ) { if(xCoRoutineSchedule() == pdFALSE) { //Idle the CPU PCON = 0x1;//IDle Mode } }
I haven't tested this yet, but I think it should work fine.
RE: vCoRoutineSchedule to xCoRoutineSchedulePosted by sashiono on September 21, 2007 i have been running this mod for a while now and it works well.
RE: vCoRoutineSchedule to xCoRoutineSchedulePosted by sashiono on November 18, 2007 any input into including this mod into the next release? I find it quite useful for power reduction.
RE: vCoRoutineSchedule to xCoRoutineSchedulePosted by Richard on November 18, 2007 Thanks for your suggestion. I would be grateful if you could add this to the Feature Request tracker under SourceForce. That way I will not forget it :o) http://sourceforge.net/tracker/?atid=659636&group_id=111543&func=browse
Regards.
RE: vCoRoutineSchedule to xCoRoutineSchedulePosted by sashiono on November 21, 2007 I didn't know if you actually took requests posted in the Feature Request tracker. I posted up the suggestion.
Btw, Keep up the good work. FreeRTOS is getting better every day.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|