changeset 366:3c7030d6d67a MotionDetection

Fix misalignment of do while loop
author ideenmodellierer
date Mon, 17 Jun 2019 19:56:38 +0200
parents c18aebb03fed
children e309f78f89a5
files Discovery/Src/t7.c
diffstat 1 files changed, 40 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }