groger57 wrote on Tuesday, October 24, 2017:
Hello:
I am presently using a task that waits for a binary semaphore “give” from the ISR. This works good. Now, I want to change that to a task that executes differently based on the existence of a response, or timeout, whicever occurs first.
1 - A command is transmitted
2 - A response (1 byte) should be received in 2000ms. If not, set the sequence as “incomplete”
I know that I will be using vTaskSetTimeOutState. My question is this. How does the task that uses vTaskSetTimeOutState know that it should start executing and subsequently using up the 2000ms timeout? Does the task get created like any other task, then suspended, and resumed just after transmitting the command?
Thanks for your help, always appreciated!
FYI: The current sempahore task:
static void prvCOMprocessTask( void pvParameters )
{
configASSERT( xCOMsemaphore );
/ Take semaphore to get it to correct state. */
xSemaphoreTake( xCOMsemaphore, mainDONT_BLOCK );
for( ;; )
{
xSemaphoreTake( xCOMsemaphore, portMAX_DELAY );
/* do some stuff, I got a message.... */
}
}