Dual CANbus monitor and instrumentation cluster

Dependencies:   SPI_TFTx2 TFT_fonts TOUCH_TFTx2 beep mbed

Fork of CANary by Tick Tock

Files at this revision

API Documentation at this revision

Comitter:
TickTock
Date:
Tue Apr 02 07:23:46 2013 +0000
Parent:
46:73e8716f976f
Child:
48:d1ce92104a1f
Commit message:
added showbutton feature to hide button on histogram

Changed in this revision

displayModes.cpp Show annotated file Show diff for this revision Revisions of this file
displayModes.h 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	Tue Apr 02 07:10:57 2013 +0000
+++ b/displayModes.cpp	Tue Apr 02 07:23:46 2013 +0000
@@ -295,7 +295,7 @@
 
 //----------------
 // gg - hist
-void cpHistogram(bool force){ 
+void cpHistogram(bool force, bool showButtons){ 
     short unsigned max, min, jv, i, bd;
     unsigned avg;
     if(force){
@@ -389,7 +389,7 @@
     }
     
     // handle the button
-    if(sMode==1){
+    if(sMode==1&&showButtons){
         tt.foreground(Yellow);
         tt.background(DarkCyan);
         tt.set_font((unsigned char*) Arial12x12);
@@ -568,7 +568,7 @@
             showDateTime(changed,(display==whichTouched));
             break;
         case cpHistScreen: // gg - hist
-            cpHistogram(changed);
+            cpHistogram(changed||showCP,(display==whichTouched));
             break;
         default:
             if (changed){
--- a/displayModes.h	Tue Apr 02 07:10:57 2013 +0000
+++ b/displayModes.h	Tue Apr 02 07:23:46 2013 +0000
@@ -41,7 +41,7 @@
     void dteDisplay (bool force, bool showButtons);
     void braking (bool force, bool showButtons, bool prdata);
     void cpData(bool force, bool showButtons);
-    void cpHistogram(bool force); // gg - hist
+    void cpHistogram(bool force, bool showButtons); // gg - hist
     void showDateTime(bool force, bool showButtons);
     void updateDisplay(char display);
     void showButton(unsigned char column, unsigned char row, char * text1, char * text2, unsigned char columns, unsigned char rows);
--- a/main.cpp	Tue Apr 02 07:10:57 2013 +0000
+++ b/main.cpp	Tue Apr 02 07:23:46 2013 +0000
@@ -141,7 +141,7 @@
     t = *localtime(&seconds) ;
     strftime(sTemp, 32, "%a %m/%d/%Y %X\n", &t);
     logMsg(sTemp);
-    sprintf(sTemp,"CANary firmware rev46\n");
+    sprintf(sTemp,"CANary firmware rev47\n");
     logMsg(sTemp);
 
     // Look for new binary on thumbdrive
@@ -186,7 +186,7 @@
     dMode[1]=logScreen;
     lastDMode[1]=99;
     updateDisplay(1);
-    wait_ms(4000); // Pause for a few seconds
+    wait_ms(3000); // Pause for a few seconds
     dMode[1]=i;
 
     touched=false;