Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller

Dependencies:   SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed

Fork of CANary by Tick Tock

Revision:
75:77bd26829dca
Parent:
69:6bfdfc002036
Child:
77:7c136766466c
--- a/utility.cpp	Mon Apr 15 11:40:25 2013 +0000
+++ b/utility.cpp	Mon Apr 15 14:33:53 2013 +0000
@@ -60,6 +60,12 @@
             for(i=5;i<13;i++){ // Is there a better way to do this? (writeBuffer[writePointer][i]=canRXmsg.data?)
                 writeBuffer[writePointer][i]=canRXmsg.data[i-5];
             }
+            if (writePointer==readPointer) {
+                // Just overwrote an entry that hasn't been sent to thumbdrive
+                sprintf(sTemp,"Write buffer overrun.\n");
+                logMsg(sTemp); // write buffer overrun
+                spkr.beep(1000,0.25);
+            }
             if (++writePointer >= maxBufLen) {
                 writePointer = 0;
                 led3 = !led3;