comparison 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
comparison
equal deleted inserted replaced
849:fce639612464 850:bc2fcd002fc4
259 { 259 {
260 menu.disableLineMask[idList.page] |= (1 << idList.line); 260 menu.disableLineMask[idList.page] |= (1 << idList.line);
261 } 261 }
262 } 262 }
263 263
264 uint8_t getLineMask(uint32_t lineId)
265 {
266 SStateList idList;
267 get_idSpecificStateList(lineId, &idList);
268 return(menu.disableLineMask[idList.page]);
269 }
270
264 void resetLineMask(uint32_t lineId) 271 void resetLineMask(uint32_t lineId)
265 { 272 {
266 SStateList idList; 273 SStateList idList;
267 get_idSpecificStateList(lineId, &idList); 274 get_idSpecificStateList(lineId, &idList);
268 if(idList.page < MAXPAGES) 275 if(idList.page < MAXPAGES)
929 void unblock_diluent_page(void) 936 void unblock_diluent_page(void)
930 { 937 {
931 block_diluent_handler(1); 938 block_diluent_handler(1);
932 } 939 }
933 940
941 static void checkLineStatus()
942 {
943 switch(get_globalState())
944 {
945 case StMXTRA: tMXtra_checkLineStatus();
946 break;
947 default:
948 break;
949 }
950 }
934 951
935 static void nextPage(void) 952 static void nextPage(void)
936 { 953 {
937 uint8_t page, line; 954 uint8_t page, line;
938 955
947 //menu.lineMemoryForNavigationForPage[page] = line; 964 //menu.lineMemoryForNavigationForPage[page] = line;
948 menu.lineMemoryForNavigationForPage[page] = 0; 965 menu.lineMemoryForNavigationForPage[page] = 0;
949 menu.modeFlipPages = 1; 966 menu.modeFlipPages = 1;
950 967
951 set_globalState_Menu_Page(page); 968 set_globalState_Menu_Page(page);
969
970 checkLineStatus(); /* some lines may be enabled / disabled depending on condition occuring outside the page scope => check if update is necessary */
952 971
953 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1)); 972 change_CLUT_entry(CLUT_MenuLineSelectedSides, (CLUT_MenuPageGasOC + page - 1));
954 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1)); 973 change_CLUT_entry(CLUT_MenuLineSelectedSeperator, (CLUT_MenuPageGasOC + page - 1));
955 974
956 GFX_SetFrameTop(menu.StartAddressForPage[page]); 975 GFX_SetFrameTop(menu.StartAddressForPage[page]);