# HG changeset patch
# User ideenmodellierer
# Date 1570131568 -7200
# Node ID 9d82411d0afa0b431ec92d514702dc1ea5dfd4a7
# Parent  84f5c18b74eae9be674969229afb28cb905d136c
Decrease ManualExitDiveCounter in surface mode
Bugfix: option would be enabled for 30 dive minutes instead of 30 minutes surface time

diff -r 84f5c18b74ea -r 9d82411d0afa Small_CPU/Src/scheduler.c
--- a/Small_CPU/Src/scheduler.c	Thu Oct 03 21:34:52 2019 +0200
+++ b/Small_CPU/Src/scheduler.c	Thu Oct 03 21:39:28 2019 +0200
@@ -551,10 +551,6 @@
 			Scheduler.tick_execute1second = 0xFFFFFFFF;	/* execute once only in the second cycle */
 			if(global.dataSendToSlave.diveModeInfo != DIVEMODE_Apnea)
 			{
-				if(ManualExitDiveCounter)
-				{
-					ManualExitDiveCounter--;
-				}
 				scheduleUpdateLifeData(0); // includes tissues
 				global.lifeData.dive_time_seconds++; // there is dive_time_seconds_without_surface_time too
 				global.lifeData.ppO2 = decom_calc_ppO2(global.lifeData.pressure_ambient_bar, &global.lifeData.actualGas);
@@ -834,6 +830,11 @@
 				clearDecoNow = 0;
 			}
 
+			if(ManualExitDiveCounter)
+			{
+				ManualExitDiveCounter--;
+			}
+
 			if(global.seconds_since_last_dive)
 			{
 				schedule_update_timer_helper(-1);