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.
Revision 16:2a6ca248e1cb, committed 2013-03-03
- Comitter:
- TickTock
- Date:
- Sun Mar 03 18:25:50 2013 +0000
- Parent:
- 15:a359fecf85ba
- Child:
- 17:e32324a2678d
- Commit message:
- Added log messages for config
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Mar 03 18:06:53 2013 +0000
+++ b/main.cpp Sun Mar 03 18:25:50 2013 +0000
@@ -2,7 +2,6 @@
//To Do:
// * USB device detect
-// * config file on local fs with touchscreen calibration
// * user programmable message decode
// * brake trainer
// * write and read the Mode Data
@@ -141,6 +140,8 @@
// Look for config file
cfile = fopen("/local/config.txt", "r");
if (cfile==NULL){ // if doesn't exist --> create
+ sprintf(sTemp,"No config file found.\nCalibrating touch screen.\n");
+ logMsg(sTemp);
tt.calibrate();
cfile = fopen("/local/config.txt", "w");
fprintf(cfile,"x0_off %d\r\n",tt.x0_off);
@@ -153,6 +154,8 @@
fprintf(cfile,"y1_pp %d\r\n",tt.y1_pp);
fprintf(cfile,"x_mid %d\r\n",tt.x_mid);
} else { // read params
+ sprintf(sTemp,"Reading config file.\n");
+ logMsg(sTemp);
fscanf(cfile, "x0_off %d\r\n", &tt.x0_off ) ;
fscanf(cfile, "y0_off %d\r\n", &tt.y0_off ) ;
fscanf(cfile, "x0_pp %d\r\n", &tt.x0_pp ) ;
@@ -172,8 +175,8 @@
seconds = time(NULL);
t = *localtime(&seconds) ;
strftime(fileName, 32, "/fs/%m%d%H%M.alc", &t); //mmddhhmm.alc
- sprintf(sTemp,"Using file %s\n",fileName);
- logMsg(sTemp);
+ //sprintf(sTemp,"Using file %s\n",fileName);
+ //logMsg(sTemp);
file = fopen(fileName, "ab");
if(file==NULL){
