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:
- 148:6e3b9135fad2
- Parent:
- 147:e0f1c84c62a6
- Child:
- 149:e9739523109f
--- a/main.cpp Wed Aug 07 13:36:13 2013 +0000 +++ b/main.cpp Thu Sep 12 14:42:22 2013 +0000 @@ -12,8 +12,13 @@ // * Add temperature to efficiency lookup table // * Add debug screen -// rev147 -// Changed CONFIG.TXT copy on thumbdrive to CONFIG.BAK to avoid unwanted restore +// rev148 +// No longer save config after firmware update +// Added config health check after read +// Added debugScreen +// Switched friction monitor to msgId:292 so MY2013 will work +// Added ambient to main display +// Added Resr to trip log #include "mbed.h" #include "CAN.h" @@ -24,7 +29,7 @@ #include "utility.h" #include "displayModes.h" #include "TOUCH_TFTx2.h" -char revStr[7] = "147"; // gg - revision string, max 6 characters +char revStr[7] = "148"; // gg - revision string, max 6 characters FATFS USBdrive; LocalFileSystem local("local"); @@ -152,6 +157,7 @@ unsigned char saveDmode=99; bool moving=false; unsigned short chirpInt; +unsigned short uMsgId[8] = {0x5103, 0x50a3, 0x54a4, 0x54b4, 0x54c0, 0x55b4, 0x0000, 0x0000}; // messages to display on debug screen msgId:byte int main() { char sTemp[40]; @@ -705,7 +711,7 @@ tick=false; curEff = miles_trip[0]/kWh_trip[0]; headlights = (lastMsg[indexLastMsg[0x358]].data[1]&0x80)?true:false; // headlight/turn signal indicator - if(indexLastMsg[0x355]>0){ + if(accOn&&indexLastMsg[0x355]>0){ miles_kmbar = (lastMsg[indexLastMsg[0x355]].data[4]&0x20)?true:false; // indicates selected distance units metric = !miles_kmbar; }