Attempts to merge SPI_TFT2 & SPI_TFT_ILI9341

Dependencies:   SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed

Fork of CANary by Tick Tock

Files at this revision

API Documentation at this revision

Comitter:
TickTock
Date:
Fri Aug 02 14:11:23 2013 +0000
Parent:
138:a2f5af85ed0d
Child:
140:ab3e94eb0227
Commit message:
Fixed right justify (compare to 9.5, 99.5 instead of 10, 100)

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 Aug 02 05:13:26 2013 +0000
+++ b/displayModes.cpp	Fri Aug 02 14:11:23 2013 +0000
@@ -52,7 +52,7 @@
             dte=convertDistance(minTripEff*useable_kWh);
             tt.foreground(Green);
             tt.locate(20,80);            
-            if(dte>=10){
+            if(dte>=9.5){
                 printf("%2.0f \n",dte); //LM - add metric conversion
             }else{
                 printf("%2.1f \n",dte); //LM - add metric conversion
@@ -65,10 +65,10 @@
                 dte=199;
             }
             // " "=0x10, "."=0x15, #=0x1D
-            if(dte>=100){
+            if(dte>=99.5){
                 tt.locate(80,85);
                 printf(" %3.0f\n",dte); //LM - add metric conversion
-            }else if(dte>=10){
+            }else if(dte>=9.5){
                 tt.locate(94,85);
                 printf("  %2.0f\n",dte); //LM - add metric conversion
             }else{
@@ -81,10 +81,10 @@
 
             dte=convertDistance(maxTripEff*useable_kWh);
             tt.foreground(Orange);
-            if(dte>=100){
+            if(dte>=99.5){
                 tt.locate(255,80);            
                 printf("%3.0f \n",dte); //LM - add metric conversion            
-            }else if(dte>=10){
+            }else if(dte>=9.5){
                 tt.locate(270,80);            
                 printf("%2.0f \n",dte); //LM - add metric conversion
             }else{
--- a/main.cpp	Fri Aug 02 05:13:26 2013 +0000
+++ b/main.cpp	Fri Aug 02 14:11:23 2013 +0000
@@ -10,10 +10,8 @@
 // * Subtract accessory power from efficiency history (add back in when displaying)
 // * Add trip history display
 
-// rev138
-// Added update if screen touched on power
-// Fixed hang on immediate USB access
-// Fixed metric DTE formatting
+// rev139
+// Fixed right justify (compare to 9.5, 99.5 instead of 10, 100)
 
 #include "mbed.h"
 #include "CAN.h"
@@ -25,7 +23,7 @@
 #include "displayModes.h"
 #include "TOUCH_TFTx2.h"
 
-char revStr[7] = "138"; // gg - revision string, max 6 characters
+char revStr[7] = "139"; // gg - revision string, max 6 characters
 
 FATFS USBdrive;
 LocalFileSystem local("local");
@@ -608,6 +606,8 @@
                                     dMode[whichTouched] = playbackScreen ; // GoTo Playback Screen                                    
                                 } else if (dMode[whichTouched]==configScreen) {
                                     metric = !metric; // toggle metric/imperial display
+                                    lastDMode[0]=99;//repaint
+                                    lastDMode[1]=99;//repaint
                                 } else {
                                     lastDMode[whichTouched]=99;//repaint to clear highlight
                                 }