OpenUART read

Hello! There was a problem with data read-out from UART -
I want to accept packages on 500 byte, on package reception should expose
Flag of the end of reception, but it is not clear during what moment occurs?

while(1)
{
adl_eventWait( EventHandle,
RX_EVENT_WAIT_MASK,
NULL,
ADL_EVENT_WAIT_ALL,
ADL_EVENT_NO_TIMEOUT);

                        /* clear Rx Available event */
           adl_eventClear( EventHandle, RX_EVENT_WAIT_MASK, NULL );

while(0!=(nb_read = uart_itf.read( uart_handle, r_buff, DATA_MAX )))
{
r_buff += nb_read;
lamd += nb_read; // Number accepted byte
}
“Flag of the end of reception”; // ? ? ?
break;

}

That is on what condition I can break a cycle?

Do you mean after receiving the 500 bytes, the openUART function is not needed?
And then you want to break the while (1) loop?

Hello!
I want to accept a file packages on 500 byte. In each cycle while (1)
one package is accepted only, I need to know to what sign
the package is precisely accepted!

Use a State Machine: Good paper on Event-Driven Programming - #6 by awneil

You certainly do not want a while(1) loop :exclamation: :open_mouth: