Mercurial > public > ostc4
diff Discovery/Src/tMenu.c @ 850:bc2fcd002fc4 Evo_2_23
Check line enable/disable state when a new page is selected:
Some lines may change the enable/disable state based on events which are triggered from outside the page scope (for example sensor setup). Updating the line states while another page is active caused problems in the framebuffer handling. To solve this usecase the conditions for the line dis/enabling is checked when a "nextPage" is selected. If condition changed then the page will be refreshed.
author | Ideenmodellierer |
---|---|
date | Fri, 01 Mar 2024 19:30:29 +0100 |
parents | 2a9a47547b05 |
children | 9f487ad38170 |
line wrap: on
line diff
--- a/Discovery/Src/tMenu.c Thu Feb 29 18:49:55 2024 +0100 +++ b/Discovery/Src/tMenu.c Fri Mar 01 19:30:29 2024 +0100 @@ -261,6 +261,13 @@ } } +uint8_t getLineMask(uint32_t lineId) +{ + SStateList idList; + get_idSpecificStateList(lineId, &idList); + return(menu.disableLineMask[idList.page]); +} + void resetLineMask(uint32_t lineId) { SStateList idList; @@ -931,6 +938,16 @@ block_diluent_handler(1); } +static void checkLineStatus() +{ + switch(get_globalState()) + { + case StMXTRA: tMXtra_checkLineStatus(); + break; + default: + break; + } +} static void nextPage(void) { @@ -950,6 +967,8 @@ set_globalState_Menu_Page(page); + checkLineStatus(); /* some lines may be enabled / disabled depending on condition occuring outside the page scope => check if update is necessary */ + change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1));