comparison Discovery/Src/tMenuEditCustom.c @ 815:ce8f71217f45

Bugfix CustomView selection during dive mode: The CustomView selection during dive mode was limited to two pages, while meanwhile three are needed to show all options. The problem did not showup in surface mode selection. Rootcause was a static definition instead of the dynamic one used in surface mode. In addition with every page shift a new page was created which might cause display errors after some times. To solve this the pages are now updated instead of rebuilding the pages.
author Ideenmodellierer
date Sun, 03 Sep 2023 18:03:49 +0200
parents dd7ce655db26
children 7322adb00305
comparison
equal deleted inserted replaced
814:26ae9e8f24fd 815:ce8f71217f45
42 #include "tMenuSystem.h" 42 #include "tMenuSystem.h"
43 #include <math.h> 43 #include <math.h>
44 44
45 45
46 #define CV_PER_PAGE (5u) /* number of cv selections shown at one page */ 46 #define CV_PER_PAGE (5u) /* number of cv selections shown at one page */
47 #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */
48 #define MAX_BACKLIGHT_BOOST (2u) /* max number of backlight levels which may be increased during focus state */ 47 #define MAX_BACKLIGHT_BOOST (2u) /* max number of backlight levels which may be increased during focus state */
49 48
50 #define MAX_FOCUS_LIMITER (2u) /* max number for reducing the spot used for focus detection */ 49 #define MAX_FOCUS_LIMITER (2u) /* max number for reducing the spot used for focus detection */
51 50
52 static uint8_t customviewsSubpage = 0; 51 static uint8_t customviewsSubpage = 0;
928 927
929 void openEdit_CustomviewDivemodeMenu(uint8_t line) 928 void openEdit_CustomviewDivemodeMenu(uint8_t line)
930 { 929 {
931 static uint8_t customviewsSubpage = 0; 930 static uint8_t customviewsSubpage = 0;
932 SSettings *pSettings = settingsGetPointer(); 931 SSettings *pSettings = settingsGetPointer();
933 char text[MAX_PAGE_TEXTSIZE]; 932
934 uint16_t tabPosition; 933 customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(cv_changelist) / CV_PER_PAGE) + 1;
935 uint32_t id;
936
937 934
938 if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */ 935 if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */
939 { 936 {
940 customviewsSubpage++; 937 customviewsSubpage++;
941 if(customviewsSubpage == CV_SUBPAGE_MAX) 938 if(customviewsSubpage == customviewsSubpageMax)
942 { 939 {
943 customviewsSubpage = 0; 940 customviewsSubpage = 0;
944 } 941 }
945 set_CustomsviewsSubpage(customviewsSubpage); 942 set_CustomsviewsSubpage(customviewsSubpage);
946 /* rebuild the selection page with the next set of customer views */ 943 /* rebuild the selection page with the next set of customer views */
947 id = tMSystem_refresh(0, text, &tabPosition, NULL); 944 updateSpecificMenu(StMSYS);
948 tM_build_page(id, text, tabPosition, NULL);
949 openMenu(0); 945 openMenu(0);
950 } 946 }
951 else 947 else
952 { 948 {
953 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]); 949 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]);