Dual CANbus monitor and instrumentation cluster

Dependencies:   SPI_TFTx2 TFT_fonts TOUCH_TFTx2 beep mbed

Fork of CANary by Tick Tock

Files at this revision

API Documentation at this revision

Comitter:
TickTock
Date:
Fri May 03 14:31:07 2013 +0000
Parent:
95:248b3c25a7df
Child:
97:a25940fd7b5b
Child:
98:9f8bab96edff
Commit message:
Fixed mistake (battTemp is char not short)

Changed in this revision

displayModes.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/displayModes.cpp	Fri May 03 12:18:10 2013 +0000
+++ b/displayModes.cpp	Fri May 03 14:31:07 2013 +0000
@@ -72,7 +72,8 @@
 
 void mainDisplay (bool force, bool showButtons){
     unsigned short gids, SOC, packV;
-    static unsigned short lgids=0, lSOC=0, lpackV=0, lbattTemp_x4=99, maxPS=0;
+    static unsigned short lgids=0, lSOC=0, lpackV=0, maxPS=0;
+    static unsigned char lbattTemp_x4=0;
     static float lkW=0, laccV=0, lmpkWh=0;
     CANMessage msg;
 
@@ -117,9 +118,9 @@
             printf("%4.1fV \n",(float)packV/2);
             lpackV=packV;
         }
-        if(battTemp_x4!=lbattTemp_x4){
+        if(force||battTemp_x4!=lbattTemp_x4){
             tt.locate(200,170);
-            printf("%4.1fF \n",(float)battTemp_x4*9/20+32);
+            printf("%4.1fF\n",(float)battTemp_x4*9/20+32);
             lbattTemp_x4=battTemp_x4;
         }
         if(force||accV!=laccV){
--- a/main.cpp	Fri May 03 12:18:10 2013 +0000
+++ b/main.cpp	Fri May 03 14:31:07 2013 +0000
@@ -51,7 +51,7 @@
 // gg - revStr is used in 2 places
 // gg - and is easy to edit here
 // gg - added ZeroSecTick and revStr
-char revStr[7] = "95";
+char revStr[7] = "96";
 
 bool debugMode = false;
 bool logEn = false, logOpen = false; 
@@ -125,7 +125,7 @@
 bool updateDTE = false;
 unsigned short pointerSep;
 unsigned char reqMsgCnt = 99;
-unsigned char battTemp_x4 = 99;
+unsigned char battTemp_x4 = 0;
 int main() {
     char sTemp[40];
     unsigned long secs;