[freertos - Open Discussion and Support] Yielding from ISR on dsPIC

4 views
Skip to first unread message

SourceForge.net

unread,
Nov 14, 2011, 7:10:11 AM11/14/11
to SourceForge.net

Read and respond to this message at:
https://sourceforge.net/projects/freertos/forums/forum/382005/topic/4814591
By:

I'm using FreeRTOS on a dsPIC and want to give a semaphore from an ISR. The
xSemaphoreGiveFromISR macro is being called but in all of the documentation
it talks about yielding from within the ISR. The actual implementation depends
on the port. some ports use taskYIELD. There is a version for the PIC32 that
is named portEND_SWITCHING_ISR but I can't find an implementation for the dsPIC.
Has anyone implemented this and if so, do you want to share the solution? I'm
in crunch mode and don't have time to re-invent the wheel. If nobody has the
solution I will implement it and post the code for all to use.

_____________________________________________________________________________________
You are receiving this email because you elected to monitor this topic or entire forum.
To stop monitoring this topic visit:
https://sourceforge.net/projects/freertos/forums/forum/382005/topic/4814591/unmonitor
To stop monitoring this forum visit:
https://sourceforge.net/projects/freertos/forums/forum/382005/unmonitor

SourceForge.net

unread,
Nov 14, 2011, 8:02:04 AM11/14/11
to SourceForge.net
By: richardbarry

See the "Interrupt Service Routines" section of
http://www.freertos.org/portpic24_dspic.html, and the example in _U2RXInterrupt()
defined within FreeRTOS\Demo\PIC24_MPLAB\serial\serial.c.

Regards.

SourceForge.net

unread,
Nov 14, 2011, 10:50:25 AM11/14/11
to SourceForge.net
By: richard_damon

If you want to make the code look the same for PIC32 and dsPIC, you can define

[code]
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
{ \
if( xSwitchRequired ) \
{ \
portYIELD(); \
} \
}
[/code]

SourceForge.net

unread,
Nov 16, 2011, 9:28:53 AM11/16/11
to SourceForge.net

Thank you for the replies. I used the taskYIELD() function and it seems to be
working fine. I'm having stack overflow problems but I'm convinced it's elsewhere
in the code. I had tried the taskYEILD before but thought it was causing the
stack overflows. Now I'm pretty sure it's not the cause.

Reply all
Reply to author
Forward
0 new messages