nobody wrote on Tuesday, April 11, 2006:
That is what Im doing right now, but it still does not acheive what I wanna do.
I have 2 threads TS and TR, respectively for sending and receiving data from the serial port. Moreover I have a flag that tells if the serial port is used at the moment, so that if the sending task or the receiving task loses hands in the middle of an operation, I am not messing with multiple interruptions on the serial port at a time (that leads to exceptions generally).
If my flag ‘serial_busy’ test flag is true and the serial_send task is running, then I have to switch to the serial_recv task, and the other way, if this flag is true and I am into the serial_recv task, then I need to switch to the serial_send task so that I dont lose too much cycles doing something irrelevant, instead of directly go to the task that needs to be executed.
It could simply be done having a taskYIELD() function which takes a parameter beeing the task handle that needs to be scheduled, unfortunately there is no such function in FreeRTOS (or I did not find it after looking a lot at the source code). I could do it using some assembly code but I dont know if this would implies big behavioral changes of the scheduler.
Anyone else has a suggestion on how to resolve this ?