diff Discovery/Src/tMenuEditCustom.c @ 706:10b7d271b9c4

Bugfix: only reset menu if a new sub menu is created: In the previous version a short black screen (blink) happend while changing parameters. Root cause was that the menu structure was reset while no submenu was created because the value update happend at the actual menu. This has been fixed by only resetting the menu if it is really needed
author Ideenmodellierer
date Thu, 03 Nov 2022 20:37:06 +0100
parents c28c09017210
children 5071d554aaa5
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditCustom.c	Tue Nov 01 09:55:45 2022 +0100
+++ b/Discovery/Src/tMenuEditCustom.c	Thu Nov 03 20:37:06 2022 +0100
@@ -336,12 +336,11 @@
 void openEdit_Custom(uint8_t line)
 {
     set_globalState_Menu_Line(line);
-    resetMenuEdit(CLUT_MenuPageCustomView);
 
     switch(line)
     {
     	case 1:
-    	default:	openEdit_Customview();
+    	default:    openEdit_Customview();
     		break;
     	case 2: 	openEdit_BigScreen();
     		break;
@@ -357,6 +356,7 @@
 /* Private functions ---------------------------------------------------------*/
 void openEdit_Customview(void)
 {
+	resetMenuEdit(CLUT_MenuPageCustomView);
     refresh_Customviews();
 
     write_field_button(StMCustom1_CViewTimeout,		400, 700, ME_Y_LINE1,  &FontT48, "");
@@ -426,6 +426,7 @@
 
 void openEdit_ViewPort(void)
 {
+	resetMenuEdit(CLUT_MenuPageCustomView);
     refresh_ViewPort();
 
     write_field_button(StMCustom5_CViewPortCalib,	400, 700, ME_Y_LINE2,  &FontT48, "");
@@ -797,6 +798,7 @@
 
     uint8_t i;
 
+    resetMenuEdit(CLUT_MenuPageCustomView);
 	customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(pcv_changelist) / CV_PER_PAGE) + 1;
 
 	if(pcv_curchangelist != pcv_changelist)		/* new selection base? => reset page index */