Baseline for testing
Revision 3:2b760f267603, committed 2020-03-17
- Comitter:
- foxbrianr
- Date:
- Tue Mar 17 17:23:55 2020 +0000
- Parent:
- 2:486d068deff9
- Commit message:
- fix up code for barry
Changed in this revision
EventLog.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 486d068deff9 -r 2b760f267603 EventLog.cpp --- a/EventLog.cpp Tue Sep 17 13:48:38 2019 +0000 +++ b/EventLog.cpp Tue Mar 17 17:23:55 2020 +0000 @@ -94,15 +94,19 @@ printf("Initializing Event Log\n\r"); if ( !load() ) { + printf("..Load Failed \n\r"); + printf("..Setting Default Event Log\n\r"); memset ( events,0,sizeof(ESCM_Event)*MAX_EVENTS); // for testing for ( int i=0; i<MAX_EVENTS; i++) { add(i*2); } save(); - + } else { + printf("..Loaded Event Log\n\r"); } + printf("Complete\n\r"); return 1; } @@ -115,6 +119,9 @@ uint16_t code; uint16_t size; + uint16_t hr; + + fread(&code, sizeof(uint16_t),1,input); fread(&size, sizeof(uint16_t),1,input); @@ -137,10 +144,35 @@ fread( &events[i].day, sizeof(uint16_t),1 , input); fread( &events[i].month, sizeof(uint16_t),1 , input); fread( &events[i].year, sizeof(uint16_t),1 , input); - - //fread( events[i].timeStr, sizeof(char) ,40, input); +#if 0 + if ( events[i].hours < 12 ) { + + hr = (events[i].hours == 0) ? 12 : events[i].hours; + + printf("%02d) %02x %02d:%02d:%02dam\r", + i, + events[i].address, + hr, + events[i].mins, + events[i].secs ); + + } else { + + hr = (events[i].hours - 12); + + printf("%02d) %02x %02d:%02d:%02dpm\r", + i, + events[i].address, + hr, + events[i].mins, + events[i].secs ); + } +#endif + } fclose(input); + + printf("Number of Events = %d (%d) \n\r", this->size(),this->capacity()); } else {