# HG changeset patch # User JeanDo # Date 1387718591 -3600 # Node ID 3b1af9891019717dbef8a151d06542eb04ad6e43 # Parent aac1379d6983bbe66b6a4db6c30c4af68733d75b BUGFIX: CNS calculation in decoplan should track gas (no marked changes anymore) diff -r aac1379d6983 -r 3b1af9891019 code_part1/OSTC_code_c_part2/p2_deco.c --- a/code_part1/OSTC_code_c_part2/p2_deco.c Mon Dec 16 20:50:34 2013 +0100 +++ b/code_part1/OSTC_code_c_part2/p2_deco.c Sun Dec 22 14:23:11 2013 +0100 @@ -88,7 +88,8 @@ // 2013/03/05: [jDG] Should vault low_depth too. // 2013/03/05: [jDG] Wrobell remark: ascent_to_first_stop works better with finer steps (2sec). // 2013/05/08: [jDG] A. Salm remark: NOAA tables for CNS are in ATA, not bar. -// 2013/10/22: [mH] Remove CF55 stuff +// 2013/10/22: [mH] Remove CF55 stuff +// 2013/12/21: [jDG] Fix CNS calculation in decoplan w/o marked gas switch // // TODO: // + Allow to abort MD2 calculation (have to restart next time). @@ -669,7 +670,7 @@ { // Copy depth of the first (deepest) stop, because when reversing // order, it will be hard to find... - char_O_first_deco_depth = internal_deco_depth[0] & 0x7F; + char_O_first_deco_depth = internal_deco_depth[0]; char_O_first_deco_time = internal_deco_time [0]; if( read_custom_function(54) & 1 ) //---- Should we reverse table ? ------ @@ -845,14 +846,14 @@ // // Input: temp_depth_limit, // deco_gas_change[] -// sim_gas_delay, sim_gas_depth_used, sim_dive_mins. +// sim_gas_depth_used, sim_dive_mins. // // RETURNS TRUE if a stop is needed for gas switch. // -// Output: temp_depth_limit, sim_gas_delay, sim_gas_depth_used IFF the is a switch. +// Output: temp_depth_limit, sim_gas_depth_used IFF the is a switch. // -// NOTE: might be called from bottom (when sim_gas_delay and sim_gas_depth_used -// are null), or during the ascent to make sure we are not passing a +// NOTE: might be called from bottom (when sim_gas_depth_used +// is null), or during the ascent to make sure we are not passing a // stop (in which case both can be already set). // static unsigned char gas_switch_deepest(void) @@ -1710,9 +1711,9 @@ for(x=0; x