Attempts to merge SPI_TFT2 & SPI_TFT_ILI9341
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary by
Diff: displayModes.cpp
- Revision:
- 52:d5385fbf4ea1
- Parent:
- 50:83d5864c64a0
- Child:
- 55:591406a71fa8
--- a/displayModes.cpp Sun Apr 07 17:11:28 2013 +0000 +++ b/displayModes.cpp Tue Apr 09 04:13:20 2013 +0000 @@ -741,8 +741,10 @@ tt.background(Navy); tt.foreground(Yellow); + if(force){ + tt.cls(); + } if(force||lgids!=gids){ - tt.cls(); tt.set_font((unsigned char*) Arial12x12); for(i=0;i<10;i++){ y=200-i*20; @@ -756,27 +758,27 @@ } x=50+0*6; - tt.locate(x-6,226); + tt.locate(x-10,226); printf("sec\n"); tt.line(x,10,x,220,DarkGrey); x=50+9*6; - tt.locate(x-6,226); + tt.locate(x-10,226); printf("min\n"); tt.line(x,10,x,220,DarkGrey); x=50+18*6; - tt.locate(x-6,226); + tt.locate(x-10,226); printf("hour\n"); tt.line(x,10,x,220,DarkGrey); x=50+25*6; - tt.locate(x-6,226); + tt.locate(x-10,226); printf("day\n"); tt.line(x,10,x,220,DarkGrey); x=50+32*6; - tt.locate(x-6,226); + tt.locate(x-10,226); printf("mon\n"); tt.line(x,10,x,220,DarkGrey); x=50+38*6; - tt.locate(x-6,226); + tt.locate(x-10,226); printf("year\n"); tt.line(x,10,x,220,DarkGrey); lgids=gids; @@ -805,10 +807,11 @@ tt.line(x,180,x,220,DarkGrey); tt.set_font((unsigned char*) SCProSB31x55); tt.foreground(Green); - tt.locate(180,10); if (showMiles){ - printf("%4.1f\n",mpkWh[dtePeriod]*((float)(gids-5)*.075)); + tt.locate(160,10); + printf("%4.1f \n",mpkWh[dtePeriod]*((float)(gids-5)*.075)); } else { + tt.locate(180,10); printf("%3.1f\n",mpkWh[dtePeriod]); } lx=50; @@ -819,7 +822,7 @@ ly=0; } if(dtePeriod==0){ - radius=4; + radius=6; color=Magenta; }else{ radius=2; @@ -846,7 +849,9 @@ tt.fillcircle(x,leff[i],radius,Navy); tt.line(x-6,leff[i-1],x,leff[i],Navy); leff[i-1]=ly; - tt.fillcircle(x,y,radius,color); + if(y>0){ + tt.fillcircle(x,y,radius,color); + } tt.line(lx,ly,x,y,White); lx=x; ly=y;