Release 1.01
Diff: EditTimeMenu.cpp
- Revision:
- 8:9d4e684d8eb8
- Parent:
- 5:9f4d4f8ffc00
diff -r d8673bb9fb6f -r 9d4e684d8eb8 EditTimeMenu.cpp --- a/EditTimeMenu.cpp Fri Sep 27 13:20:32 2019 +0000 +++ b/EditTimeMenu.cpp Tue Mar 17 17:23:15 2020 +0000 @@ -1,3 +1,4 @@ + /************************************************************************** * @file EditTimeMenu.cpp * @brief Base class for implementing the Edit Time Menu display @@ -107,14 +108,36 @@ } else { + // edit mode secs = timeinfo->tm_sec; + + if ( hours < 12 ) { + cur_hours = (hours == 0) ? 12 : hours; + + } else { + cur_hours = (hours - 12); + } lcd->locate(2,0); switch(active_selection) { case 1: - lcd->printf("Set Time (hours) : %02d", hours); + +#if 1 + if ( hours < 12 ) { + cur_hours = (hours == 0) ? 12 : hours; + lcd->printf("Set Time (hours) : %02dam", cur_hours); + + } else { + cur_hours = (hours - 12); + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + + lcd->printf("Set Time (hours) : %02dpm", cur_hours); + } +#else + lcd->printf("Set Time (hours) : %02d", hours); +#endif break; case 2: lcd->printf("Set Time (min) : %02d", mins); @@ -137,9 +160,32 @@ lcd->locate(3,0); lcd->printf("Updated Time :"); - +#if 1 + + if ( hours < 12 ) { + + cur_hours = (hours == 0) ? 12 : hours; + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + lcd->locate(3,20); + lcd->printf(" %02d:%02d:%02dam %02d/%02d/%02d", + cur_hours, mins, secs, months, days, (years%100)); + + } else { + + cur_hours = (hours - 12); + cur_hours = (cur_hours == 0) ? 12 : cur_hours; + lcd->locate(3,20); + lcd->printf(" %02d:%02d:%02dpm %02d/%02d/%02d", + cur_hours, mins, secs, months, days, (years%100)); + + + } +#else lcd->locate(3,20); lcd->printf(" %02d:%02d %02d/%02d/%04d", hours, mins, months, days, years); + +#endif + }