changeset 1001:21142f4fa968 GasConsumption tip

Cleanup menu structucture afer menu shift: Compass and timer have been moved to the new menu => some code cleanup was needed.
author Ideenmodellierer
date Mon, 28 Apr 2025 22:53:36 +0200 (35 hours ago)
parents c386ae6635e4
children
files Discovery/Inc/tMenuEditCvOption.h Discovery/Inc/tMenuSystem.h Discovery/Inc/tStructure.h Discovery/Src/settings.c Discovery/Src/tMenu.c Discovery/Src/tMenuCvOption.c Discovery/Src/tMenuEditCvOption.c Discovery/Src/tMenuEditHardware.c Discovery/Src/tMenuSystem.c
diffstat 9 files changed, 17 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- 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 */
--- 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 */
--- 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 */
--- 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;
--- 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;
--- 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();
--- 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);
--- 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;
     }
--- 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 ---------------------------------------------------------*/