{
sendString( buffer ); //calls another function to send it out of UART… ///poll for response while(1) { rxCode = USARTFetchChar();
if( rxCode == RCVDPROMPT ) //one more for 0xD rxCode = USARTFetchChar();
break; }
xSemaphoreGive( xMutexUARTAccess );
}else { printf(“Had to leave…couldn’t wait for pokey the UART.n”); } Based on this, I have 2 questions: 1 – Is there a better mechanism in FreeRTOS than what I am using (assuming I am using the mutex correctly) 2 – Is there any way to determine if the poll response is hanging? For example, if I set the 2nd parameter as shown to 25ms, the message will print for about 20 times, then stop, then the watchdog reboots it. If I set it to 5 or 10ms, it seems to work OK. However, what I don’t understand is whether or not the mutex will tell me anything about the poll and response. To check the poll response, I have set a volatile variable at the top of the function, and then change it in the while(1) loop. It seems to always get reset in the while loop OK, but not certain if this really determines much. I should also mention that the tasks calling this function are doing so through a queue. The various tasks send the single queue the pointer to the (queue) data structure, and it then calls this function from there. So I am hoping I’ve covered all the bases to safeguard wild access, but something must be missing. Any suggestions on what could be wrong, or how I could implement this in a better way? Thanks…