comparison 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
comparison
equal deleted inserted replaced
554:896b6346ccd2 555:43296991c283
857 } 857 }
858 858
859 // If there is a better gas available 859 // If there is a better gas available
860 if( switch_deco ) 860 if( switch_deco )
861 { 861 {
862 unsigned char delay = read_custom_function(55);
863
862 assert( !sim_gas_last_depth || sim_gas_last_depth > switch_deco ); 864 assert( !sim_gas_last_depth || sim_gas_last_depth > switch_deco );
863 865
864 // Should restart gas-switch delay only when gas do changes... 866 // Should restart gas-switch delay only when gas do changes...
865 assert( sim_gas_delay <= sim_dive_mins ); 867 assert( sim_gas_delay <= sim_dive_mins );
866 868
867 sim_gas_last_depth = switch_deco; 869 sim_gas_last_depth = switch_deco;
868 sim_gas_last_used = switch_last; 870 sim_gas_last_used = switch_last;
869 sim_gas_delay = read_custom_function(55) 871 sim_gas_delay = delay
870 + sim_dive_mins; 872 + sim_dive_mins;
871 temp_depth_limit = switch_deco; 873
872 874 if( delay )
873 return 1; 875 {
876 temp_depth_limit = switch_deco;
877 return 1;
878 }
879 else
880 return 0;
874 } 881 }
875 882
876 sim_gas_delay = 0; 883 sim_gas_delay = 0;
877 return 0; 884 return 0;
878 } 885 }