# HG changeset patch # User ideenmodellierer # Date 1560794198 -7200 # Node ID 3c7030d6d67ad5062e083ff670e77093a5b3aca4 # Parent c18aebb03fedc3e2eccea8b0bc2e450aa1320515 Fix misalignment of do while loop diff -r c18aebb03fed -r 3c7030d6d67a Discovery/Src/t7.c --- a/Discovery/Src/t7.c Mon Jun 17 19:53:01 2019 +0200 +++ b/Discovery/Src/t7.c Mon Jun 17 19:56:38 2019 +0200 @@ -1525,48 +1525,48 @@ } } - 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; + 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)) && + } + } + + 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++; - if(*pViews == CVIEW_END) - { - pViews = pStartView; - } - } - else - { - if(pViews == pStartView) - { - pViews = pLastView - 1; - } - else - { - pViews--; - } - } - } - } while(cv_disabled); - } + { + cv_disabled = 1; + } + + if(cv_disabled) /* view is disabled => jump to next view */ + { + if((action == ACTION_BUTTON_ENTER) || (action == ACTION_SHAKE_POS)) + { + pViews++; + if(*pViews == CVIEW_END) + { + pViews = pStartView; + } + } + else + { + if(pViews == pStartView) + { + pViews = pLastView - 1; + } + else + { + pViews--; + } + } + } + } while(cv_disabled); + selection_customview = *pViews; }