Dual CANbus monitor and instrumentation cluster
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 beep mbed
Fork of CANary by
Diff: utility.cpp
- Branch:
- Metric
- Revision:
- 109:3e6f0e8fca0d
- Parent:
- 108:29b5a760adc2
- Child:
- 110:ffddff3ad2f2
--- a/utility.cpp Sun Jun 30 14:45:01 2013 +0000 +++ b/utility.cpp Sun Jun 30 17:52:58 2013 +0000 @@ -607,7 +607,7 @@ } void logPackVoltages() { // Turbo3 - routine to dump CP values to text file - char sTemp[40]; + /*char sTemp[40]; struct tm t; // pointer to a static tm structure short unsigned max, min, jv, i, bd; unsigned avg; @@ -658,13 +658,13 @@ } fprintf(bfile,"\r\n"); fclose(bfile); - } + }*/ logCP=false; showCP=true; } void tripLog() { // Daily log - char sTemp[40]; + /*char sTemp[40]; struct tm t; // pointer to a static tm structure short unsigned max, min, jv, i, bd; unsigned avg; @@ -715,7 +715,7 @@ } fprintf(bfile,"\r\n"); fclose(bfile); - } + }*/ logCP=false; showCP=true; } @@ -724,7 +724,7 @@ //the CANary into a computer for updates. void updateFirmware() { - char sTemp[40]; + /*char sTemp[40]; FILE *srcFile; srcFile = fopen("/usb/firmware.bin", "rb"); if(srcFile ==NULL) @@ -745,7 +745,7 @@ printf("Starting update\n"); printf("deleting old firmware files\n"); if ((dir = opendir ("/local/")) != NULL) { - /* print all the files and directories within directory */ + // print all the files and directories within directory while ((ent = readdir (dir)) != NULL) { //printf("FILE: %s\n",ent->d_name); char dest[4] = ""; @@ -762,7 +762,7 @@ } closedir (dir); } else { - /* could not open directory */ + //could not open directory printf("Couldnt open folder"); wait(3); return; @@ -800,15 +800,15 @@ printf("Rebooting in 3 seconds\n"); wait(3); //Now run new firmware - mbed_reset(); + mbed_reset();*/ } bool detectUSB(void){ - bool usbEn=false; + bool usbEn=true; // for now assume presence /*FILE *tfile = fopen("/usb/presence.det", "w"); usbEn=(tfile==NULL)?false:true; if(usbEn){ - fclose(lfile); + fclose(tfile); }*/ return(usbEn); }