FIX: changing the result booleran when sending over serial.

This commit is contained in:
iceman1001 2017-10-29 19:22:03 +01:00
commit 994248265d
3 changed files with 14 additions and 135 deletions

View file

@ -111,10 +111,13 @@ static void *uart_receiver(void *targ) {
while (arg->run) {
rxlen = 0;
if (uart_receive(sp, prx, sizeof(UsbCommand) - (prx-rx), &rxlen) && rxlen) {
if (uart_receive(sp, prx, sizeof(UsbCommand) - (prx-rx), &rxlen)) {
if ( rxlen == 0 ) continue;
prx += rxlen;
if (prx-rx < sizeof(UsbCommand)) {
if ( (prx-rx) < sizeof(UsbCommand)) {
continue;
}