Fix FIFO full handling.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 2 Oct 2009 19:29:20 +0000 (19:29 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 2 Oct 2009 19:29:20 +0000 (19:29 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3004 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/net/afsk.c

index 5792967bfe7ab5279a3148d874c06e9ddcb111d6..4ebf54540c383c55b529b48e8bf17e31813d239a 100644 (file)
@@ -205,11 +205,13 @@ static void hdlc_parse(bool bit)
        {
                if ((hdlc_currchar == HDLC_FLAG
                        || hdlc_currchar == HDLC_RESET
-                       || hdlc_currchar == AX25_ESC)
-                       && !fifo_isfull(&rx_fifo))
-                       fifo_push(&rx_fifo, AX25_ESC);
-               else
-                       hdlc_rxstart = false;
+                       || hdlc_currchar == AX25_ESC))
+               {
+                       if (!fifo_isfull(&rx_fifo))
+                               fifo_push(&rx_fifo, AX25_ESC);
+                       else
+                               hdlc_rxstart = false;
+               }
 
                if (!fifo_isfull(&rx_fifo))
                        fifo_push(&rx_fifo, hdlc_currchar);