Download Salvo User Manual

Transcript
Example
void TaskRx ( voi d)
{
/* initially there are no Rx chars for
/* TaskRcvRsp() to process.
OSCreateSem(SEM_RX_RBUFF_P, 0);
/* The task to interpret responses is driven
/* solely by TaskRx()'s collecting incoming
/* incoming chars for it, so we'll launch
/* it from here.
OSCreateTask(TaskRcvRsp, TASK_RCV_RSP_P,
TASK_RCV_RSP_PRIO);
*/
*/
*/
*/
*/
*/
/* deal with Rx chars. */
while (1) {
/* if there are any Rx chars waiting,
*/
/* signal the command interpreter.
*/
while (SioRxQue(Port) > 0)
{
/* put new Rx char into local buffer
*/
rxBuff[rxTail] = (char) SioGetc(Port, 10);
/* massage buffer pointers
rxTail++;
rxCount++;
if (rxTail >= SIZEOF_RX_BUFF)
rxTail = 0;
*/
/* signal the command interpreter that
/* there's work to be done. In this
/* implementation we signal once for
/* every new character received.
OSSignalSem(SEM_RX_RBUFF_P);
*/
*/
*/
*/
}
/* wait a while and poll again.
OS_Delay(1);
}
*/
}
342
Chapter 7 • Reference
Salvo User Manual