# HG changeset patch # User Ideenmodellierer # Date 1745873616 -7200 # Node ID 21142f4fa96857948de6ab4a8b2e9aba61409e0f # Parent c386ae6635e404a86f886c7d3a78091dbb9dd70a Cleanup menu structucture afer menu shift: Compass and timer have been moved to the new menu => some code cleanup was needed. diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Inc/tMenuEditCvOption.h --- a/Discovery/Inc/tMenuEditCvOption.h Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Inc/tMenuEditCvOption.h Mon Apr 28 22:53:36 2025 +0200 @@ -38,5 +38,6 @@ void openEdit_CvOption(uint8_t line); void refresh_CompassEdit(void); uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext); +void tMCvOption_checkLineStatus(void); #endif /* TMENU_EDIT_CVOPTION_H */ diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Inc/tMenuSystem.h --- a/Discovery/Inc/tMenuSystem.h Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Inc/tMenuSystem.h Mon Apr 28 22:53:36 2025 +0200 @@ -44,6 +44,5 @@ /* Exported functions --------------------------------------------------------*/ uint32_t tMSystem_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext); -void tMSystem_checkLineStatus(void); #endif /* TMENU_SYSTEM_H */ diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Inc/tStructure.h --- a/Discovery/Inc/tStructure.h Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Inc/tStructure.h Mon Apr 28 22:53:36 2025 +0200 @@ -390,7 +390,7 @@ #define StMOption_Compass_Inertia _MB(2,10,1,4,0) #define StMOption_Compass_Declination _MB(2,10,1,5,0) -#define StMOption_Timer _MB(2,10,2,0,0) +#define StMOption_Timer _MB(2,10,2,1,0) /* PAGE 11 */ diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Src/settings.c --- a/Discovery/Src/settings.c Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Src/settings.c Mon Apr 28 22:53:36 2025 +0200 @@ -1781,7 +1781,7 @@ corrections++; setFirstCorrection(parameterId); } - parameterId++; + parameterId++; /* 93 */ if((Settings.scrubberData[1].TimerMax > MAX_SCRUBBER_TIME) || Settings.scrubberData[1].TimerCur < MIN_SCRUBBER_TIME || Settings.scrubberData[1].TimerCur > (int16_t)MAX_SCRUBBER_TIME) { Settings.scrubberData[1].TimerMax = 0; diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Src/tMenu.c --- a/Discovery/Src/tMenu.c Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Src/tMenu.c Mon Apr 28 22:53:36 2025 +0200 @@ -845,6 +845,11 @@ clean_line_actual_page(); update_content_actual_page(text, tabPosition, subtext); break; + case StMOption: + tMCvOption_refresh(line, text, &tabPosition, subtext); + clean_line_actual_page(); + update_content_actual_page(text, tabPosition, subtext); + break; default: break; } @@ -958,7 +963,7 @@ { switch(get_globalState()) { - case StMSYS: tMSystem_checkLineStatus(); + case StMOption: tMCvOption_checkLineStatus(); break; case StMXTRA: tMXtra_checkLineStatus(); break; diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Src/tMenuCvOption.c --- a/Discovery/Src/tMenuCvOption.c Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Src/tMenuCvOption.c Mon Apr 28 22:53:36 2025 +0200 @@ -82,13 +82,13 @@ void tMCvOption_checkLineStatus(void) { uint8_t localLineMask = 0; - uint8_t lineMask = getLineMask(StMSYS); -#if 0 + uint8_t lineMask = getLineMask(StMOption); + if(t7_customview_disabled(CVIEW_Timer)) { localLineMask |= 1 << 2; } -#endif + if(lineMask != localLineMask) { updateMenu(); diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Src/tMenuEditCvOption.c --- a/Discovery/Src/tMenuEditCvOption.c Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Src/tMenuEditCvOption.c Mon Apr 28 22:53:36 2025 +0200 @@ -280,6 +280,8 @@ snprintf(text, 32, "\001%c%c", TXT_2BYTE, TXT2BYTE_Timer); write_topline(text); + set_globalState(StMOption_Timer); + uint16_t yPos = ME_Y_LINE_BASE + get_globalState_Menu_Line() * ME_Y_LINE_STEP; snprintf(text, 32, "%c%c", TXT_2BYTE, TXT2BYTE_Timer); write_label_var(30, 299, yPos, &FontT48, text); diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Src/tMenuEditHardware.c --- a/Discovery/Src/tMenuEditHardware.c Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Src/tMenuEditHardware.c Mon Apr 28 22:53:36 2025 +0200 @@ -84,20 +84,16 @@ openEdit_Bluetooth(); break; case 2: - resetMenuEdit(CLUT_MenuPageHardware); - openEdit_Compass(); + openEdit_O2Sensors(); break; case 3: - openEdit_O2Sensors(); + openEdit_Brightness(); break; case 4: - openEdit_Brightness(); - break; - case 5: resetMenuEdit(CLUT_MenuPageHardware); openEdit_ButtonSens(); break; - case 6: + case 5: openEdit_FlipDisplay(); break; } diff -r c386ae6635e4 -r 21142f4fa968 Discovery/Src/tMenuSystem.c --- a/Discovery/Src/tMenuSystem.c Mon Apr 28 19:51:36 2025 +0200 +++ b/Discovery/Src/tMenuSystem.c Mon Apr 28 22:53:36 2025 +0200 @@ -260,19 +260,6 @@ return StMSYS; } -void tMSystem_checkLineStatus(void) -{ - uint8_t localLineMask = 0; - uint8_t lineMask = getLineMask(StMSYS); - if(t7_customview_disabled(CVIEW_Timer)) - { - localLineMask |= 1 << 2; - } - if(lineMask != localLineMask) - { - updateMenu(); - } -} /* Private functions ---------------------------------------------------------*/