test fork

Dependencies:   SPI_TFTx2 SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2 mbed

Fork of CANary_9341 by Tick Tock

Revision:
79:68f0dd8d1f19
Parent:
73:62ee8eae3a84
Child:
126:e0d039096891
--- a/displayModes.cpp	Tue Apr 16 13:01:13 2013 +0000
+++ b/displayModes.cpp	Tue Apr 16 22:31:47 2013 +0000
@@ -768,6 +768,7 @@
 
 void dteDisplay(bool force, bool showButtons, bool showMiles){
     unsigned short i,x,y,lx,ly,gids,radius,color,r,t;
+    unsigned char toVal;
     static unsigned short lgids=0;
     static unsigned char leff[39]={0};
     CANMessage msg;
@@ -778,13 +779,16 @@
     msg = lastMsg[indexLastMsg[0x5bc]]; //Get gids
     gids = (msg.data[0]<<2)+(msg.data[1]>>6);
     if(gids==0){
-        gids=281;
+        gids=281; // Display new, fuily charged capacity until real data obtained
     }
 
     tt.background(Navy);
     tt.foreground(Yellow);
     if(force){
         tt.cls();
+        toVal=33;
+    } else {
+        toVal=18;// no need to constantly update the long tc values
     }
     if(force||lgids!=gids){
         tt.set_font((unsigned char*) Arial12x12);
@@ -865,7 +869,7 @@
         }
         if(dtePeriod==0){
             radius=6;
-            color=Magenta;
+            color=Yellow;
         }else{
             radius=2;
             color=Green;
@@ -873,7 +877,7 @@
         tt.fillcircle(lx,leff[0],radius,Navy);
         tt.fillcircle(lx,ly,radius,color);
 
-        for(i=1;i<33;i++){
+        for(i=1;i<toVal;i++){
             x=50+i*6;
             y=mpkWh[i]*20;
             if(y<200) {
@@ -882,8 +886,8 @@
                 y=0;
             }
             if(i==dtePeriod){
-                radius=4;
-                color=Magenta;
+                radius=6;
+                color=Yellow;
             }else{
                 radius=2;
                 color=Green;