Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed
Fork of CANary by
Diff: displayModes.cpp
- Revision:
- 180:5fdeeb86f3a3
- Parent:
- 179:e4094e55f079
- Child:
- 181:396fdcceefd2
--- a/displayModes.cpp Sun Mar 23 22:04:44 2014 +0000
+++ b/displayModes.cpp Mon Mar 24 01:18:05 2014 +0000
@@ -1423,7 +1423,7 @@
showButton(3,0,"Reset","flags",4,4);
}
-void whpgDisplay(bool force, bool showButtons){
+void whpgDisplay(bool force, bool showButtons, bool showWh){
unsigned short maxVal, minVal, maxGid, minGid, i, j, y;
float avg;
static unsigned short lmg;
@@ -1443,14 +1443,27 @@
}
// find max/min/avg
- for(i=0; i<300; i++){
- if(whpg[i]>0){
- j=(whpg[i]-whpg[i+1]);
- avg+=j;
- if(j>maxVal) maxVal=j;
- if(j<minVal) minVal=j;
- if(i>maxGid) maxGid=i;
- if(i<minGid) minGid=i;
+ if(showWh){
+ for(i=0; i<300; i++){
+ if(wh[i]>0){
+ j=(wh[i]-wh[i+1]);
+ avg+=j;
+ if(j>maxVal) maxVal=j;
+ if(j<minVal) minVal=j;
+ if(i>maxGid) maxGid=i;
+ if(i<minGid) minGid=i;
+ }
+ }
+ }else{
+ for(i=0; i<300; i++){
+ if(whpg[i]>0){
+ j=(whpg[i]-whpg[i+1]);
+ avg+=j;
+ if(j>maxVal) maxVal=j;
+ if(j<minVal) minVal=j;
+ if(i>maxGid) maxGid=i;
+ if(i<minGid) minGid=i;
+ }
}
}
avg /= (maxGid-minGid+1);
@@ -1479,13 +1492,18 @@
tt.locate( 2, yWinMax-avg+2); printf("avg\n");
for( i=4; i<=286; i++) {
- if((whpg[i-4]>0)&&(whpg[i+4]>0)){
- y = (whpg[i-4]-whpg[i+4])/4;
+ if(showWh){
+ y = wh[i]-wh[i-1];
+ tt.fillcircle(i+xWinMin,yWinMax-y,2,Green);
}else{
- y = whpg[i];
- }
- if( (y>20) && (y<180) && whpg[i]>0){
- tt.fillcircle(i+xWinMin,yWinMax-y,2,Green);
+ if((whpg[i-4]>0)&&(whpg[i+4]>0)){
+ y = (whpg[i-4]-whpg[i+4])/4;
+ }else{
+ y = whpg[i];
+ }
+ if( (y>20) && (y<180) && whpg[i]>0){
+ tt.fillcircle(i+xWinMin,yWinMax-y,2,Yellow);
+ }
}
if(i%40 == 0){
// label the x axis each 40
@@ -1569,7 +1587,10 @@
testDisplay(changed,showButtons);
break;
case whpgScreen:
- whpgDisplay(changed,showButtons);
+ whpgDisplay(changed,showButtons,false);
+ break;
+ case whScreen:
+ whpgDisplay(changed,showButtons,true);
break;
default:
if (changed){
@@ -1669,6 +1690,9 @@
case whpgScreen: // gg - index
sprintf(sTemp2," WHPG");
break;
+ case whScreen: // gg - index
+ sprintf(sTemp2," WH");
+ break;
}
showButton(1,tNavRow," Select",sTemp2,4,4);
