Attempts to merge SPI_TFT2 & SPI_TFT_ILI9341

Dependencies:   SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed

Fork of CANary by Tick Tock

Branch:
Metric
Revision:
121:553faf139a20
Parent:
120:041edeec08f5
Child:
122:138a40892a4c
--- a/displayModes.cpp	Mon Jul 08 02:08:08 2013 +0000
+++ b/displayModes.cpp	Thu Jul 11 05:29:18 2013 +0000
@@ -235,6 +235,26 @@
     tt.foreground(Yellow);
     tt.set_font((unsigned char*) Arial28x28);
     if(force) tt.cls();
+
+    /*if(force||tock){ // for esr debug
+        tt.locate(10,10);
+        printf("%d %d amps\n",Imax,Imin);
+        tt.locate(10,40);
+        printf(" %4.1f %4.1f\n",incRmax/2,incRmin/2);
+        tt.locate(10,70);
+        printf(" %4.1f %4.1f\n",redRmax/2,redRmin/2);
+        tt.locate(10,100);
+        printf(" %4.1f %4.1f\n",curRmax/2,curRmin/2);
+        //tt.locate(10,130);
+        curRmin=1000;
+        curRmax=0;
+        incRmin=1000;
+        incRmax=0;
+        redRmin=1000;
+        redRmax=0;
+        Imax=-1000;
+        Imin=1000;
+    }*/
     if(force||gids!=lgids){
         tt.locate(10,10);
         printf("%4d gids \n",gids);
@@ -631,8 +651,11 @@
             if( height > 100 ) height = 100 ; // clip tops
             
             // draw the bar, is always inside x-window
-            tt.fillrect( xPos,yWinMax-height, xPos+nBarWidth-1,yWinMax, Green);  
-              
+            if (shunt[i]){
+                tt.fillrect( xPos,yWinMax-height, xPos+nBarWidth-1,yWinMax, Red);  
+            } else {
+                tt.fillrect( xPos,yWinMax-height, xPos+nBarWidth-1,yWinMax, Green);  
+            }
             // tic mark the y axis each 5
             if(i%5 == 4){
                tt.line( xPos,yWinMax+2, xPos,yWinMax+5, White);  // a white tick mark
@@ -983,7 +1006,7 @@
         }
         lgids=gids;    
     }
-    if(updateDTE||force){
+    if(tock||force){
         for(i=3;i<8;i++){
             y=200-(i-3)*40;
             tt.line(40,y,158,y,DarkGrey);
@@ -1074,7 +1097,6 @@
             ly=y;
         }
         leff[i-1]=y;
-        updateDTE=false;
     }
 
     msg = lastMsg[indexLastMsg[0x1cb]]; //Get Target and Regen
@@ -1276,7 +1298,8 @@
                 break;
         }
     }
-}
+    tock=false;
+} // updateDisplay
 
 //---------------------
 // gg - highlight