Can anyone explaine this logic?

while (1)
    {
        USARTdrv->Receive(&cmd, 1);          /* Get byte from UART */
        osSignalWait(0x01, osWaitForever);
        if (cmd == 13)                       /* CR, send greeting  */
        {
          USARTdrv->Send("\nHello World!", 12);
          osSignalWait(0x01, osWaitForever);
        }

    }

So the USARTdrv->Receive and the osSignalWait need to be ran over and over? Is the osSignalWait not sufficient by itself?

I'm trying to make this work but I see nothing that explains how it works. If the signal is set in

if (event & mask) { /* Success: Wakeup Thread */

then how is this checked in a loop? I figured this line just loops until met? osSignalWait(0x01, osWaitForever);

Is that not how it works?

More questions in this forum