# HG changeset patch # User Ideenmodellierer # Date 1666978760 -7200 # Node ID 8c48553a01765028fe458b62919539366af6605e # Parent c28c090172100c409726fb521f19cdeac361c49b Bugfix display of deactivated sensors: In the previous version disabled sensors had been show after startup. Rootcause was that the deactivation state was taken from the divesettings instead of the common setting. After startup divesettings are not initialized and therefore all three sensors were displayed even if one or more were disabled. This has been fixed by using the common settings in case that the OSTC is not in divemode. diff -r c28c09017210 -r 8c48553a0176 Discovery/Src/t7.c --- a/Discovery/Src/t7.c Tue Oct 18 21:21:32 2022 +0200 +++ b/Discovery/Src/t7.c Fri Oct 28 19:39:20 2022 +0200 @@ -1733,6 +1733,17 @@ SSettings* pSettings; pSettings = settingsGetPointer(); + uint8_t local_ppo2sensors_deactivated = 0; + + if(stateUsed->mode == MODE_DIVE) /* show sensors based on current dive settings */ + { + local_ppo2sensors_deactivated = stateUsed->diveSettings.ppo2sensors_deactivated; + } + else + { + local_ppo2sensors_deactivated = pSettings->ppo2sensors_deactivated; + } + if(last_customview != selection_customview) /* check if current selection is disabled and should be skipped */ { if(t7_customview_disabled(selection_customview)) @@ -2040,7 +2051,7 @@ text[textpointer++] = '\030'; // main color for(int i=0;i<3;i++) { - if((stateUsed->diveSettings.ppo2sensors_deactivated & (1<lifeData.ppO2Sensor_bar[i] == 0.0)) + if((local_ppo2sensors_deactivated & (1<lifeData.ppO2Sensor_bar[i] == 0.0)) { #ifdef ENABLE_PSCR_MODE if((stateUsed->diveSettings.diveMode == DIVEMODE_PSCR) && (showSimPPO2) && (stateUsed->mode == MODE_DIVE)) /* display ppo2 sim in blue letters in case a slot is not used in the ppo2 custom view */ @@ -2089,7 +2100,7 @@ text[textpointer++] = '\030'; for(int i=0;i<3;i++) { - if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<