Attempts to merge SPI_TFT2 & SPI_TFT_ILI9341
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary by
Diff: main.cpp
- Branch:
- Metric
- Revision:
- 112:b41b35401eb6
- Parent:
- 111:d1559bb25c43
- Child:
- 113:f388b4505463
diff -r d1559bb25c43 -r b41b35401eb6 main.cpp --- a/main.cpp Sun Jun 30 23:04:56 2013 +0000 +++ b/main.cpp Mon Jul 01 01:58:36 2013 +0000 @@ -24,7 +24,7 @@ #include "displayModes.h" #include "TOUCH_TFTx2.h" -char revStr[7] = "111"; // gg - revision string, max 6 characters +char revStr[7] = "112"; // gg - revision string, max 6 characters FATFS USBdrive; LocalFileSystem local("local"); @@ -223,7 +223,7 @@ secsNoTouch=2; while (true) { if (!logOpen) { // Open new file if one is not already open - if(logEn&&usbEn&&!waitasec){ //logging enables and USB device detected + if(logEn&&usbEn){ //logging enables and USB device detected strftime(fileName, 32, "%m%d%H%M.alc", &t); //mmddhhmm.alc efr = f_open(&efile,fileName,FA_WRITE|FA_OPEN_ALWAYS); seconds = time(NULL); @@ -694,7 +694,8 @@ kWh_trip[0]=0; if (repeatPoll) { // Poll on startup if autopoll enabled logOnce=true; - sendReq(); + reqMsgCnt=0; + msgReq.attach(&sendReq,0.015); } } laccOn=accOn; @@ -763,7 +764,7 @@ } logPackVoltages(); // Turbo3, only call } - if(!usbEn){ + if(!usbEn&&!waitasec){ usbEn=detectUSB(); // Keep looking if none found } waitasec=false; // work around to avoid hang when USB tries to init immediately