Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller
Dependencies: SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed
Fork of CANary by
Diff: main.cpp
- Revision:
- 16:2a6ca248e1cb
- Parent:
- 15:a359fecf85ba
- Child:
- 17:e32324a2678d
diff -r a359fecf85ba -r 2a6ca248e1cb main.cpp --- a/main.cpp Sun Mar 03 18:06:53 2013 +0000 +++ b/main.cpp Sun Mar 03 18:25:50 2013 +0000 @@ -2,7 +2,6 @@ //To Do: // * USB device detect -// * config file on local fs with touchscreen calibration // * user programmable message decode // * brake trainer // * write and read the Mode Data @@ -141,6 +140,8 @@ // Look for config file cfile = fopen("/local/config.txt", "r"); if (cfile==NULL){ // if doesn't exist --> create + sprintf(sTemp,"No config file found.\nCalibrating touch screen.\n"); + logMsg(sTemp); tt.calibrate(); cfile = fopen("/local/config.txt", "w"); fprintf(cfile,"x0_off %d\r\n",tt.x0_off); @@ -153,6 +154,8 @@ fprintf(cfile,"y1_pp %d\r\n",tt.y1_pp); fprintf(cfile,"x_mid %d\r\n",tt.x_mid); } else { // read params + sprintf(sTemp,"Reading config file.\n"); + logMsg(sTemp); fscanf(cfile, "x0_off %d\r\n", &tt.x0_off ) ; fscanf(cfile, "y0_off %d\r\n", &tt.y0_off ) ; fscanf(cfile, "x0_pp %d\r\n", &tt.x0_pp ) ; @@ -172,8 +175,8 @@ seconds = time(NULL); t = *localtime(&seconds) ; strftime(fileName, 32, "/fs/%m%d%H%M.alc", &t); //mmddhhmm.alc - sprintf(sTemp,"Using file %s\n",fileName); - logMsg(sTemp); + //sprintf(sTemp,"Using file %s\n",fileName); + //logMsg(sTemp); file = fopen(fileName, "ab"); if(file==NULL){