Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller
Dependencies: SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed
Fork of CANary by
Diff: utility.cpp
- Revision:
- 158:059abeb44ba1
- Parent:
- 156:4e5d30535cf9
- Child:
- 159:577e9d015693
--- a/utility.cpp Wed Oct 30 03:16:51 2013 +0000 +++ b/utility.cpp Thu Oct 31 14:41:24 2013 +0000 @@ -529,11 +529,11 @@ fprintf(cfile,"x1_pp %d\r\n",tt.x1_pp); fprintf(cfile,"y1_pp %d\r\n",tt.y1_pp); fprintf(cfile,"x_mid %d\r\n",tt.x_mid); - if (dMode[0]==configScreen) + if ((dMode[0]==configScreen)||(dMode[0]==config2Screen)) fprintf(cfile,"dMode0 %d\r\n",mainScreen); else fprintf(cfile,"dMode0 %d\r\n",dMode[0]); - if (dMode[1]==configScreen) + if ((dMode[1]==configScreen)||(dMode[1]==config2Screen)) fprintf(cfile,"dMode1 %d\r\n",mainScreen); else fprintf(cfile,"dMode1 %d\r\n",dMode[1]); @@ -664,7 +664,7 @@ } if(ff>8){ fscanf(cfile, "modelYear %d\r\n", &modelYear); - fscanf(cfile, "modelYear %d\r\n", &readBool); + fscanf(cfile, "autoSync %d\r\n", &readBool); autoSync = (bool)readBool; } fclose(cfile); @@ -794,7 +794,7 @@ msg = lastMsg[indexLastMsg[0x509]]; t.tm_sec = msg.data[2]>>2; } - if((t.tm_mon>=0)&&(t.tm_mon<12)&&(t.tm_mday>0)&&(t.tm_mday<8)&&(t.tm_hour>=0)&&(t.tm_hour<24)&&(t.tm_min>=0)&&(t.tm_min<60)&&(t.tm_sec>=0)&&(t.tm_sec<60)){ // sanity check result before using + if((t.tm_mon>=0)&&(t.tm_mon<12)&&(t.tm_mday>0)&&(t.tm_mday<32)&&(t.tm_hour>=0)&&(t.tm_hour<24)&&(t.tm_min>=0)&&(t.tm_min<60)&&(t.tm_sec>=0)&&(t.tm_sec<60)){ // sanity check result before using set_time(mktime(&t)); return(true); }else{ @@ -945,6 +945,7 @@ char buffer[bufSize]; FILE *lfile; + tt.set_font((unsigned char*) Arial12x12); tt.background(Blue); tt.foreground(Yellow); tt.locate(0,10);