# HG changeset patch # User ideenmodellierer # Date 1560793981 -7200 # Node ID c18aebb03fedc3e2eccea8b0bc2e450aa1320515 # Parent 3014a698f46de9ce2b882fa3211a8fda26c8ff16 Bugfix: selection of current view not working diff -r 3014a698f46d -r c18aebb03fed Discovery/Src/t7.c --- a/Discovery/Src/t7.c Mon Jun 17 19:47:07 2019 +0200 +++ b/Discovery/Src/t7.c Mon Jun 17 19:53:01 2019 +0200 @@ -1481,7 +1481,7 @@ void t7_change_customview(uint8_t action) { - const uint8_t *pViews; + uint8_t *pViews; uint8_t *pStartView,*pCurView, *pLastView; _Bool cv_disabled = 0; @@ -1515,34 +1515,36 @@ } else { - pViews--; - if(pViews = pStartView) + if(pViews == pStartView) { pViews = pLastView - 1; } + else + { + pViews--; + } } - if(stateUsed->mode == MODE_DIVE) - { - do - { - cv_disabled = 0; - for(int i=0;i<6;i++) - { - if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i])) - { - cv_disabled = 1; - break; - } - } - - if ((*pViews == CVIEW_sensors || *pViews == CVIEW_sensors_mV) && - stateUsed->diveSettings.ppo2sensors_deactivated) - { - cv_disabled = 1; - } - - if(cv_disabled) /* view is disabled => jump to next view */ - { + + do + { + cv_disabled = 0; + for(int i=0;i<6;i++) + { + if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(settingsGetPointer()->cv_configuration, cv_changelist[i])) + { + cv_disabled = 1; + break; + } + } + + if (((*pViews == CVIEW_sensors) || (*pViews == CVIEW_sensors_mV)) && + ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0))) + { + cv_disabled = 1; + } + + if(cv_disabled) /* view is disabled => jump to next view */ + { if((action == ACTION_BUTTON_ENTER) || (action == ACTION_SHAKE_POS)) { pViews++; @@ -1553,11 +1555,14 @@ } else { - pViews--; if(pViews == pStartView) { pViews = pLastView - 1; } + else + { + pViews--; + } } } } while(cv_disabled);