test fork
Dependencies: SPI_TFTx2 SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary_9341 by
Diff: displayModes.cpp
- Revision:
- 157:1a100a5ed06f
- Parent:
- 156:4e5d30535cf9
- Child:
- 158:059abeb44ba1
diff -r 4e5d30535cf9 -r 1a100a5ed06f displayModes.cpp --- a/displayModes.cpp Thu Oct 24 19:51:31 2013 +0000 +++ b/displayModes.cpp Wed Oct 30 03:16:51 2013 +0000 @@ -640,7 +640,7 @@ showButton(2,1," GoTo","CP Bars",4,4); showButton(3,1," GoTo"," Config",4,4); // bottom (not Nav) row - showButton(0,2," GoTo","Playback",4,4); + showButton(0,2," GoTo","Playback",4,4); //showButton(1,2," GoTo","Set Time",4,4); showButton(2,2," GoTo"," Log",4,4); showButton(3,2," GoTo"," Trip",4,4); @@ -897,19 +897,19 @@ tt.cls(); } //-------- top row -------- - showButton(0,0,"Calibrate"," Touch",4,4); // gg - 4x4 + //showButton(0,0,"Calibrate"," Touch",4,4); // gg - 4x4 showButton(1,0," Reset","",4,4); showButton(2,0," Save"," Config",4,4); // a button to step to the next skin - unsigned int nextSkin = skin + 1 ; - if( nextSkin > maxSkin ) nextSkin = 0 ; + //unsigned int nextSkin = skin + 1 ; + //if( nextSkin > maxSkin ) nextSkin = 0 ; - if( nextSkin == ttSkin ) sprintf(sTemp1,"Skin TT"); - else if( nextSkin == ggSkin ) sprintf(sTemp1,"Skin GG"); - else sprintf(sTemp1,"Skin %d",nextSkin); + //if( nextSkin == ttSkin ) sprintf(sTemp1,"Skin TT"); + //else if( nextSkin == ggSkin ) sprintf(sTemp1,"Skin GG"); + //else sprintf(sTemp1,"Skin %d",nextSkin); - showButton(3,0," Use",sTemp1,4,4); + //showButton(3,0," Use",sTemp1,4,4); //------- second row ----- if (logEn&&usbEn) { @@ -935,17 +935,89 @@ showButton(2,1,sTemp1,"Batt Log",4,4); // add Enable/Disable Debug - debugMode + //if (debugMode) { + // sprintf(sTemp1," Disable"); + //} else { + // sprintf(sTemp1," Enable"); + //} + //showButton(3,1,sTemp1," Debug",4,4); + + if(brakeMon) + showButton(0,2,"Disable","BrkMon",4,4); + else + showButton(0,2," Enable"," BrkMon",4,4); + + if(regenMon) + showButton(1,2,"Disable","RegMon",4,4); + else + showButton(1,2," Enable"," RegMon",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); + +} + +void config2(bool force, bool showButtons){ + if (force) { + tt.background(Black); + tt.cls(); + } + //-------- top row -------- + showButton(0,0,"Calibrate"," Touch",4,4); // gg - 4x4 + showButton(1,0," Reset"," DTE",4,4); + //showButton(2,0," Save"," Config",4,4); + + // a button to step to the next skin + unsigned int nextSkin = skin + 1 ; + if( nextSkin > maxSkin ) nextSkin = 0 ; + + if( nextSkin == ttSkin ) sprintf(sTemp1,"Skin TT"); + else if( nextSkin == ggSkin ) sprintf(sTemp1,"Skin GG"); + else sprintf(sTemp1,"Skin %d",nextSkin); + + showButton(3,0," Use",sTemp1,4,4); + + //------- second row ----- + //if (logEn&&usbEn) { + // sprintf(sTemp1,"Disable"); + //} else { + // sprintf(sTemp1,"Enable"); + //} + //showButton(0,1,sTemp1,"Logging",4,4); + + //if (repeatPoll) { + // sprintf(sTemp1,"Disable"); + //} else { + // sprintf(sTemp1,"Enable"); + //} + //showButton(1,1,sTemp1,"Auto CP",4,4); + + // add Enable/Disable Batt Log gg - yesBattLog + //if (yesBattLog) { + // sprintf(sTemp1,"Disable"); + //} else { + // sprintf(sTemp1,"Enable"); + //} + //showButton(2,1,sTemp1,"Batt Log",4,4); + + // add Enable/Disable Debug - debugMode if (debugMode) { sprintf(sTemp1," Disable"); } else { sprintf(sTemp1," Enable"); } showButton(3,1,sTemp1," Debug",4,4); - - if(brakeMon) - showButton(0,2,"Disable","BrkMon",4,4); - else - showButton(0,2," Enable"," BrkMon",4,4); + + //if(brakeMon) + // showButton(0,2,"Disable","BrkMon",4,4); + //else + // showButton(0,2," Enable"," BrkMon",4,4); showButton(1,2," Set"," Time",4,4); if (showHealth) { @@ -1337,6 +1409,9 @@ case configScreen: config(changed,showButtons); break; + case config2Screen: + config2(changed,showButtons); + break; case playbackScreen: pbScreen(changed,showButtons); break; @@ -1423,6 +1498,9 @@ case configScreen: sprintf(sTemp2," Config"); break; + case config2Screen: + sprintf(sTemp2,"Config2"); + break; case playbackScreen: showButton(3,0,sTemp1,"",4,4); sprintf(sTemp2,"Playback");