Mark Gottscho / UtilityLib

Fork of UtilityLib by Mark Gottscho

Revision:
7:a2b7928a81a2
Parent:
6:f9e2de3fcd8a
--- a/Utility.cpp	Wed Mar 12 01:31:35 2014 +0000
+++ b/Utility.cpp	Wed Mar 12 19:27:19 2014 +0000
@@ -244,6 +244,9 @@
 void Utility::__console_rx_ISR() {
     char tmp;
     
+    if (__user_fptr != NULL) //user callback
+        __user_fptr->call();
+    
     //Loop while the UART inbound FIFO is not empty and the receiving buffer is not full
     while (console.readable() && (__rx_head != (__rx_tail - 1) % BUFFER_SIZE)) {
         tmp = console.getc(); //read a byte into the buffer from the serial port
@@ -252,9 +255,6 @@
         if (tmp == '\r')
             __have_rx_serial = true;
     }
-    
-    if (__user_fptr != NULL) //user callback
-        __user_fptr->call();
 }
 
 //THIS DOES NOT WORK YET