Attempts to merge SPI_TFT2 & SPI_TFT_ILI9341

Dependencies:   SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed

Fork of CANary by Tick Tock

Revision:
169:84d790ac18a2
Parent:
168:9227024c4e3a
Child:
170:7ee98e3611bc
--- a/displayModes.cpp	Wed Dec 04 12:45:39 2013 +0000
+++ b/displayModes.cpp	Tue Dec 17 15:25:41 2013 +0000
@@ -69,8 +69,9 @@
             lkW=total_kW;
             if(CCon){
                 tt.set_font((unsigned char*) Arial12x12);
-                tt.locate(231,64);
-                printf("  %3.2fkW\n",CCkW);
+                tt.locate(228,64);
+                tt.foreground(GreenYellow);
+                printf("  -%3.2fkW\n",CCkW);
                 tt.set_font((unsigned char*) Arial28x28);
             }
         }
@@ -112,25 +113,20 @@
 
             // No Climate Control DTE
             tt.set_font((unsigned char*) Arial24x23);
-            tt.foreground(Green);
             if(CCon) {
                 dte=convertDistance((mpkWh_noCC-mpkWh[dtePeriod])*useable_kWh); //LM - add metric conversion
                 if(dte>199){
                     dte=199;
                 }
-                tt.locate(130,134);
-                printf("+%2.1f \n",dte);
-                /*// " "=13, "."=5, #=17
-                if(dte>=99.5){
-                    tt.locate(120,134);
-                    printf(" %3.0f\n",dte); 
-                }else if(dte>=9.5){
-                    tt.locate(111,134);
-                    printf("   %2.0f\n",dte);
+                tt.foreground(GreenYellow);
+                if(dte>=9.5){
+                    tt.locate(130,134);
+                    printf("+%2.0f \n",dte);
                 }else{
-                    tt.locate(111,134);
-                    printf("   %2.1f\n",dte);
-                }*/
+                    tt.locate(130,134);
+                    printf("+%2.1f \n",dte);
+                }
+                
                 lmaxTemp=0; //force battery termperature refresh (sometimes overlaps)
             }
             // best-case DTE
@@ -344,11 +340,15 @@
         tt.foreground(Navy);
         tt.set_font((unsigned char*) Arial28x28);
         tt.locate(6,210);
+        printf("kWh : %s : Eff\n",distanceUnit());
+        tt.set_font((unsigned char*) Arial12x12);
+        tt.locate(260,220);
         if(inclCC){
-            printf("kWh : %s : Eff  (+CC)\n",distanceUnit());
+            printf(" (+CC)\n");
         } else {
-            printf("kWh : %s : Eff (noCC)\n",distanceUnit());
+            printf("(noCC)\n");
         }
+        tt.set_font((unsigned char*) Arial28x28);
         for(int i=0; i<3; i++){
             kWh_f = kWh_trip[i];
             if(inclCC){
@@ -1000,7 +1000,13 @@
     //-------- top row --------
     showButton(0,0,"Calibrate"," Touch",4,4); // gg - 4x4
     showButton(1,0," Reset","Max/Min",4,4);
-          
+     if (showHealth) {
+        sprintf(sTemp1," Hide");
+    } else {
+        sprintf(sTemp1," Show");
+    }
+    showButton(2,0,sTemp1," Health",4,4);
+         
     // a button to step to the next skin
     unsigned int nextSkin = skin + 1 ;
     if( nextSkin > maxSkin ) nextSkin = 0 ;
@@ -1028,13 +1034,8 @@
     }
     showButton(0,2,sTemp1," tSync",4,4);    
     showButton(1,2,"  Set"," Time",4,4);
-    if (showHealth) {
-        sprintf(sTemp1," Hide");
-    } else {
-        sprintf(sTemp1," Show");
-    }
-    showButton(2,2,sTemp1," Health",4,4);
-    showButton(3,2,"Update","Firmware",4,4);
+    showButton(2,2," Update"," Config",4,4);
+    showButton(3,2," Update","Firmware",4,4);
 }
 
 void pbScreen(bool force, bool showButtons){
@@ -1234,7 +1235,7 @@
                 printf("    %2.1f\n",miles);
             }
             if(CCon) {
-                tt.foreground(Green);
+                tt.foreground(GreenYellow);
                 tt.set_font((unsigned char*) Arial24x23);
                 miles = (mpkWh_noCC-mpkWh[dtePeriod])*((float)(gids-5)*.075);
                 miles = convertDistance(miles); // LM - Metric support
@@ -1251,7 +1252,7 @@
             tt.locate(200,1);
             printf("%3.1f \n",mpkWh[dtePeriod]);
             if(CCon) {
-                tt.foreground(Green);
+                tt.foreground(GreenYellow);
                 tt.set_font((unsigned char*) Arial24x23);
                 tt.locate(190,52);
                 printf(" +%2.1f \n",(mpkWh_noCC-mpkWh[dtePeriod]));
@@ -1381,6 +1382,7 @@
             tt.locate(170,90+(i/2)*30);
         }
         if(clearTest){
+            maxPS=0;
             oldData[i]=uData[i];
             tt.foreground(Yellow);
             tt.background(Navy);