diff Discovery/Src/tMenuEditGasOC.c @ 696:cc542448fb28

Merge
author heinrichsweikamp
date Fri, 19 Aug 2022 11:30:24 +0200
parents 8775d3dc6325
children 01f40cb1057e
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditGasOC.c	Mon Nov 01 12:39:34 2021 +0100
+++ b/Discovery/Src/tMenuEditGasOC.c	Fri Aug 19 11:30:24 2022 +0200
@@ -92,7 +92,7 @@
     {
 		if(line == 6)
 		{
-			if((settingsGetPointer()->dive_mode == DIVEMODE_CCR) || (stateUsed->diveSettings.ccrOption == 1))
+			if(isLoopMode(settingsGetPointer()->dive_mode) || (stateUsed->diveSettings.ccrOption == 1))
 			{
 				selectPage(StMOG);
 			}
@@ -122,7 +122,7 @@
     {
 		if(line == 6)
 		{
-			if((settingsGetPointer()->dive_mode == DIVEMODE_CCR) || (stateUsed->diveSettings.ccrOption == 1))
+			if(isLoopMode(settingsGetPointer()->dive_mode) || (stateUsed->diveSettings.ccrOption == 1))
 			{
 				selectPage(StMCG);
 			}
@@ -167,9 +167,12 @@
 /* select gas in divemode */
 void openEdit_DiveGasSelect(uint8_t line, uint8_t ccr)
 {
-    openEdit_DiveGasSelect_Subroutine(line, ccr);
-    if(!ccr)
-        tMEGas_check_switch_to_bailout();
+	if(!ccr)
+	{
+		tMEGas_check_switch_to_bailout();
+	}
+	openEdit_DiveGasSelect_Subroutine(line, ccr);
+
     exitMenuEdit_to_Home_with_Menu_Update();
 }
 
@@ -367,7 +370,7 @@
 
 void tMEGas_check_switch_to_bailout(void)
 {
-    if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
+    if(isLoopMode(stateUsed->diveSettings.diveMode))
     {
     	stateUsedWrite->diveSettings.diveMode = DIVEMODE_OC;
         block_diluent_page();