Mercurial > public > ostc4
diff Discovery/Src/tMenuSystem.c @ 944:44599695df41 Evo_2_23
Restructure Date/Time menu:
To have more space for upcoming optins the selection of the date format (DDMMYY) has been moved into a submenu. In addition the function was upgraded to support multi language handling.
author | Ideenmodellierer |
---|---|
date | Thu, 19 Dec 2024 18:58:18 +0100 |
parents | 9f487ad38170 |
children |
line wrap: on
line diff
--- a/Discovery/Src/tMenuSystem.c Mon Dec 16 19:33:20 2024 +0100 +++ b/Discovery/Src/tMenuSystem.c Thu Dec 19 18:58:18 2024 +0100 @@ -49,7 +49,6 @@ SSettings *data; int i; uint8_t textPointer; - uint8_t dateFormat; uint8_t RTEhigh, RTElow; RTC_DateTypeDef Sdate; RTC_TimeTypeDef Stime; @@ -59,6 +58,7 @@ textPointer = 0; *tab = 300; *subtext = 0; + char tmpString[15]; resetLineMask(StMSYS); @@ -128,49 +128,11 @@ translateDate(pStateReal->lifeData.dateBinaryFormat, &Sdate); translateTime(pStateReal->lifeData.timeBinaryFormat, &Stime); - dateFormat = data->date_format; - - textPointer += snprintf(&text[textPointer], 40, - "Date" - "\016\016" - " " - ); - - if(dateFormat == DDMMYY) - { - textPointer += snprintf(&text[textPointer], 40, - "DDMMYY" - "\017" - "\t" - "%02d-%02d-%02d" - " " - , Sdate.Date, Sdate.Month, 2000 + Sdate.Year - ); - } - else - if(dateFormat == MMDDYY) - { - textPointer += snprintf(&text[textPointer], 40, - "MMDDYY" - "\017" - "\t" - "%02d-%02d-%02d" - " " - ,Sdate.Month, Sdate.Date, 2000 + Sdate.Year - ); - } - else - if(dateFormat == YYMMDD) - { - textPointer += snprintf(&text[textPointer], 40, - "YYMMDD" - "\017" - "\t" - "%02d-%02d-%02d" - " " - , 2000 + Sdate.Year, Sdate.Month, Sdate.Date - ); - } + text[textPointer++] = TXT_Date; + getStringOfFormat_DDMMYY(tmpString,15); + textPointer += snprintf(&text[textPointer], 40,"\016\016 %s ",tmpString); + convertStringOfDate_DDMMYY(tmpString,15,Sdate.Date, Sdate.Month, Sdate.Year); + textPointer += snprintf(&text[textPointer], 40,"\017\t%s ",tmpString); textPointer += snprintf(&text[textPointer], 60, "%02d:%02d:%02d"