diff code_part1/OSTC_code_c_part2/p2_deco.c @ 555:43296991c283

BUGFIX: CF55 (gas switch delay) should not add fake stops when null.
author JeanDo
date Mon, 13 Feb 2012 00:18:13 +0100
parents 896b6346ccd2
children 57622cb0d80f
line wrap: on
line diff
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Fri Feb 10 16:23:41 2012 +0100
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Mon Feb 13 00:18:13 2012 +0100
@@ -859,6 +859,8 @@
     // If there is a better gas available
     if( switch_deco )
     {
+        unsigned char delay = read_custom_function(55);
+
         assert( !sim_gas_last_depth || sim_gas_last_depth > switch_deco );
 
         // Should restart gas-switch delay only when gas do changes...
@@ -866,11 +868,16 @@
 
         sim_gas_last_depth = switch_deco;
         sim_gas_last_used  = switch_last;
-        sim_gas_delay      = read_custom_function(55)
+        sim_gas_delay      = delay
                            + sim_dive_mins;
-        temp_depth_limit = switch_deco;
 
-        return 1;
+        if( delay )
+        {
+            temp_depth_limit = switch_deco;
+            return 1;
+        }
+        else
+            return 0;
     }
 
     sim_gas_delay = 0;