Mercurial > public > ostc4
comparison 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 |
comparison
equal
deleted
inserted
replaced
705:158d612a9f4d | 706:10b7d271b9c4 |
---|---|
334 } | 334 } |
335 | 335 |
336 void openEdit_Custom(uint8_t line) | 336 void openEdit_Custom(uint8_t line) |
337 { | 337 { |
338 set_globalState_Menu_Line(line); | 338 set_globalState_Menu_Line(line); |
339 resetMenuEdit(CLUT_MenuPageCustomView); | |
340 | 339 |
341 switch(line) | 340 switch(line) |
342 { | 341 { |
343 case 1: | 342 case 1: |
344 default: openEdit_Customview(); | 343 default: openEdit_Customview(); |
345 break; | 344 break; |
346 case 2: openEdit_BigScreen(); | 345 case 2: openEdit_BigScreen(); |
347 break; | 346 break; |
348 case 3: openEdit_CustomviewDivemode(cv_changelist); | 347 case 3: openEdit_CustomviewDivemode(cv_changelist); |
349 break; | 348 break; |
355 } | 354 } |
356 | 355 |
357 /* Private functions ---------------------------------------------------------*/ | 356 /* Private functions ---------------------------------------------------------*/ |
358 void openEdit_Customview(void) | 357 void openEdit_Customview(void) |
359 { | 358 { |
359 resetMenuEdit(CLUT_MenuPageCustomView); | |
360 refresh_Customviews(); | 360 refresh_Customviews(); |
361 | 361 |
362 write_field_button(StMCustom1_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, ""); | 362 write_field_button(StMCustom1_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, ""); |
363 write_field_button(StMCustom1_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, ""); | 363 write_field_button(StMCustom1_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, ""); |
364 write_field_button(StMCustom1_CViewStandardBF, 400, 700, ME_Y_LINE3, &FontT48, ""); | 364 write_field_button(StMCustom1_CViewStandardBF, 400, 700, ME_Y_LINE3, &FontT48, ""); |
424 | 424 |
425 | 425 |
426 | 426 |
427 void openEdit_ViewPort(void) | 427 void openEdit_ViewPort(void) |
428 { | 428 { |
429 resetMenuEdit(CLUT_MenuPageCustomView); | |
429 refresh_ViewPort(); | 430 refresh_ViewPort(); |
430 | 431 |
431 write_field_button(StMCustom5_CViewPortCalib, 400, 700, ME_Y_LINE2, &FontT48, ""); | 432 write_field_button(StMCustom5_CViewPortCalib, 400, 700, ME_Y_LINE2, &FontT48, ""); |
432 write_field_button(StMCustom5_CViewPortSpotSize,400, 700, ME_Y_LINE3, &FontT48, ""); | 433 write_field_button(StMCustom5_CViewPortSpotSize,400, 700, ME_Y_LINE3, &FontT48, ""); |
433 write_field_button(StMCustom5_CViewPortLayout, 400, 700, ME_Y_LINE4, &FontT48, ""); | 434 write_field_button(StMCustom5_CViewPortLayout, 400, 700, ME_Y_LINE4, &FontT48, ""); |
795 uint8_t textPointer = 0; | 796 uint8_t textPointer = 0; |
796 uint32_t id; | 797 uint32_t id; |
797 | 798 |
798 uint8_t i; | 799 uint8_t i; |
799 | 800 |
801 resetMenuEdit(CLUT_MenuPageCustomView); | |
800 customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(pcv_changelist) / CV_PER_PAGE) + 1; | 802 customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(pcv_changelist) / CV_PER_PAGE) + 1; |
801 | 803 |
802 if(pcv_curchangelist != pcv_changelist) /* new selection base? => reset page index */ | 804 if(pcv_curchangelist != pcv_changelist) /* new selection base? => reset page index */ |
803 { | 805 { |
804 customviewsSubpage = 0; | 806 customviewsSubpage = 0; |