RealtimeCompLab2

Dependencies:   mbed

Fork of PPP-Blinky by Nicolas Nackel

Revision:
43:aa57db08995d
Parent:
42:4de44be70bfd
Child:
44:d0c61ae49ea5
--- a/main.cpp	Tue Jan 10 18:19:58 2017 +0000
+++ b/main.cpp	Tue Jan 17 21:08:03 2017 +0000
@@ -88,6 +88,12 @@
     ppp.ledState=0;
 }
 
+void led1Toggle()
+{
+    ppp.ledState = ppp.ledState? 0 : 1;
+    led1 = ppp.ledState;
+}
+
 void crcReset()
 {
     ppp.crc=0xffff;   // crc restart
@@ -118,18 +124,12 @@
     }
 }
 
-void led1Toggle()
-{
-    ppp.ledState = ppp.ledState? 0 : 1;
-    led1 = ppp.ledState;
-}
-
 int rxbufNotEmpty() // check if rx buffer has data
 {
     __disable_irq(); // critical section start
-    int notEmpty = (ppp.rx.head==ppp.rx.tail) ? 0 : 1 ;
+    int emptyStatus = (ppp.rx.head==ppp.rx.tail) ? 0 : 1 ;
     __enable_irq(); // critical section end
-    return notEmpty;
+    return emptyStatus;
 }
 
 int pc_getBuf() // get one character from the buffer