Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2_ILI9341 mbed
Fork of CANary_corrupt by
Diff: main.cpp
- Revision:
- 75:77bd26829dca
- Parent:
- 74:e491e92b0bef
- Child:
- 76:fb6779d0963e
diff -r e491e92b0bef -r 77bd26829dca main.cpp
--- a/main.cpp Mon Apr 15 11:40:25 2013 +0000
+++ b/main.cpp Mon Apr 15 14:33:53 2013 +0000
@@ -64,9 +64,10 @@
unsigned char battData[256]={0};
unsigned char msgChanged[100]; // inidcates which bytes changed
char c;
-volatile int writePointer = 0;
-volatile int secsNoMsg = 0;
-volatile int secsNoTouch = 0;
+volatile unsigned short writePointer = 0;
+unsigned short readPointer=0;
+volatile unsigned short secsNoMsg = 0;
+volatile unsigned short secsNoTouch = 0;
volatile bool canIdle;
volatile bool userIdle;
bool touched=false; //flag to read touchscreen
@@ -119,7 +120,6 @@
unsigned short pointerSep;
int main() {
- int readPointer=0;
char sTemp[40];
unsigned long secs;
unsigned char i,j,display=0,lwt=0;
@@ -273,11 +273,12 @@
spkr.beep(1000,0.25);
logEn=false;
} else {
- if (pointerSep>(maxBufLen*7/8)) { // Hi-water mark
- sprintf(sTemp,"Write buffer overrun.\n");
- logMsg(sTemp); // write buffer overrun
- spkr.beep(1000,0.25);
- }
+ //moved overrun detection to the write code in utility.cpp
+ //if (pointerSep>(maxBufLen*7/8)) { // Hi-water mark
+ // sprintf(sTemp,"Write buffer overrun.\n");
+ // logMsg(sTemp); // write buffer overrun
+ // spkr.beep(1000,0.25);
+ //}
while (readPointer != writePointer) {
for (j = 0; j<13; j++){
fprintf(file,"%c",writeBuffer[readPointer][j]);
