test fork

Dependencies:   SPI_TFTx2 SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2 mbed

Fork of CANary_9341 by Tick Tock

Revision:
38:155ec32c5e91
Parent:
37:fea2c1d52c5f
Child:
39:eef8beac7411
--- a/displayModes.cpp	Sun Mar 24 15:35:45 2013 +0000
+++ b/displayModes.cpp	Sun Mar 24 17:26:09 2013 +0000
@@ -69,6 +69,7 @@
 void printDTE (bool force){
     unsigned short gids, SOC, packV;
     static unsigned short lgids=0, lSOC=0, lpackV=0;
+    static float lmpkWh=0;
     CANMessage msg;
 
     msg = lastMsg[indexLastMsg[0x5bc]]; //Get gids
@@ -79,10 +80,10 @@
     packV = (msg.data[2]<<2)+(msg.data[3]>>6);
 
     tt.background(Navy);
+    tt.foreground(Yellow);
+    tt.set_font((unsigned char*) Arial28x28);
     if(force) tt.cls();
     if(force||gids!=lgids){
-        tt.foreground(Yellow);
-        tt.set_font((unsigned char*) Arial28x28);
         tt.locate(10,10);
         printf("%4d gids\n",gids);
         tt.locate(20,40);
@@ -92,28 +93,27 @@
         tt.locate(60,96);
         printf("%4.1f mi  \n",(float)(gids-5)*0.31); // Approx for now
         lgids=gids;
+        tt.foreground(Yellow);
+        tt.set_font((unsigned char*) Arial28x28);
     }
     if(force||SOC!=lSOC){
-        tt.foreground(Yellow);
-        tt.set_font((unsigned char*) Arial28x28);
         tt.locate(200,10);
         printf("%4.1f%s\n",(float)SOC/10,"%");
         lSOC=SOC;
     }
     if(force||packV!=lpackV){
-        tt.foreground(Yellow);
-        tt.set_font((unsigned char*) Arial28x28);
         tt.locate(200,200);
         printf("%4.1fV \n",(float)packV/2);
         lpackV=packV;
     }
     if(force||tick){
-        tt.foreground(Yellow);
-        tt.set_font((unsigned char*) Arial28x28);
         tt.locate(20,200);
         printf("%4.2fV  \n",accV);
-        tt.locate(170,40);
-        printf("%4.3fkW  \n",mpkWh); //kW for now
+    }
+    if(force||mpkWh!=lmpkWh){
+        tt.locate(180,40);
+        printf("%3.2fkW  \n",mpkWh); //kW for now
+        lmpkWh=mpkWh;
     }
 }
 
@@ -454,7 +454,7 @@
         case config1Screen:
             config1(changed);
             break;
-        case config2Screen:
+        case playbackScreen:
             config2(changed);
             break;
         case dateScreen: