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] [October 2011 Threads] taskYIELD in an ISRPosted by lafleur on October 7, 2011 In the dsPIC33 demo, the serial driver interrupt routine has a taskYIELD, but in the Using the FreeRTOS Real Time Kernel, Sep 2011 edition (for the PIC32) stated that only API that end with FromISR are allowed in ISR... why is this an exception?? and not documented??
thanks...
also, in Microchips MPLAB Ver 8.76 there is a FreeRTOS viewing tool for displaying information on the current program... It display information on Task and CoRoutines, but never on Queues??? is it outdated??
void __attribute__((__interrupt__, auto_psv)) _U2RXInterrupt( void ) { char cChar; portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Get the character and post it on the queue of Rxed characters. If the post causes a task to wake force a context switch as the woken task may have a higher priority than the task we have interrupted. */ IFS1bits.U2RXIF = serCLEAR_FLAG; while( U2STAbits.URXDA ) { cChar = U2RXREG; xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); }
if( xHigherPriorityTaskWoken != pdFALSE ) { taskYIELD(); } }
RE: taskYIELD in an ISRPosted by Richard on October 7, 2011 “In the dsPIC33 demo, the serial driver interrupt routine has a taskYIELD, but in the Using the FreeRTOS Real Time Kernel, Sep 2011 edition (for the PIC32) stated that only API that end with FromISR are allowed in ISR” The PIC32 book is for the PIC32, which in architecture terms is about as far away from a dsPIC as you can get. Why would it talk about an exception for a dsPIC any more than it would for a Cortex-M3? Not calling a function that does not end in FromISR from an ISR is a very good general rule in all cases. Some, but not many, ports can tolerate taskYIELD() being called from an ISR, provided it is the last instruction in the ISR. In most cases, where this is the case, the call to taskYIELD() is hidden behind a macro called portYIELD_FROM_ISR(), or portEND_SWITCHING_ISR(). The PIC24/dsPIC port is rather old, and that is probably why it was not done in that case. The documentation page for that port (http://www.freertos.org/portpic24_dspic.html) does however say how it is done, albeit rather briefly. “also, in Microchips MPLAB Ver 8.76 there is a FreeRTOS viewing tool for displaying information on the current program... It display information on Task and CoRoutines, but never on Queues??? is it outdated?? ” See configQUEUE_REGISTRY_SIZE on http://www.freertos.org/a00110.html and http://www.freertos.org/vQueueAddToRegistry.html Regards.
RE: taskYIELD in an ISRPosted by Samuel on October 14, 2011 We bought two documents from website, I get confused about "xSemaphoreGiveFromISR()".
1. In document "FreeRTOS Reference Manual", in page93, void VISR( void *pvParameters) { ..... taskYIELD_FROM_ISR( xHigherPriorityTaskWoken); }
2. In document " Using the RTOS REal Time Kernel" ARM Cortex-M3 Edition, page 93 void vSoftwareInterruptHandler (void) { ... portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); }.
My question is: I can't find the function prototype for taskYIELD_FROM_ISR( ) and portEND_SWITCHING_ISR(). Regards Samuel
RE: taskYIELD in an ISRPosted by Richard Damon on October 14, 2011 These are macros in port macro.h (for the appropriate port). The exact method used to end an interrupt depends on the port.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|