# HG changeset patch # User jdg@air # Date 1432860404 -7200 # Node ID 30edd177016a0e9def5e57999ebef03d6b38dcd0 # Parent 08986d479b94c647e69ebd6434e4250094bcfc68 [mq]: 2015-05-29_02-40-44_r288+.diff diff -r 08986d479b94 -r 30edd177016a src/p2_deco.c --- a/src/p2_deco.c Fri May 29 02:40:43 2015 +0200 +++ b/src/p2_deco.c Fri May 29 02:46:44 2015 +0200 @@ -2140,7 +2140,6 @@ assert( int_I_temp < 5760 ); // Less than 96h too... } - ////////////////////////////////////////////////////////////////////////////// // deco_gas_volumes // @@ -2157,8 +2156,6 @@ // CF#57 == deco liters/minutes (5 .. 50) or bar/min. // Output: int_O_gas_volumes[0..4] in litters * 0.1 // - - void deco_gas_volumes(void) { overlay float volumes[NUM_GAS]; @@ -2167,23 +2164,29 @@ overlay unsigned char gas, depth; RESET_C_STACK - //---- initialize with bottom consumption -------------------------------- + //---- initialize -------------------------------------------------------- for(i=0; i 0.0 ) + if( char_I_const_ppO2 == 0 ) volumes[gas] = (char_I_bottom_depth*0.1 + 1.0) // Use Psurface = 1.0 bar. * char_I_bottom_time // in minutes. * bottom_usage; // In liter/minutes. //---- Ascent usage ------------------------------------------------------ - deco_usage = 20; // In liter/minutes. - depth = char_I_bottom_depth; for(i=0; i bar. * (depth-newDepth)*0.1 // metre --> min * deco_usage; - //---- Do gas switch, at new depth + //---- Do gas switch, at new depth: gas = newGas; depth = newDepth; - // Usage at stop: - if( deco_usage > 0.0 ) - volumes[gas] += (depth*0.1 + 1.0) // depth --> bar. - * time // in minutes. - * deco_usage; // in xxx / min @ 1bar. - else - volumes[gas] = 65535.0; + //---- Usage at stop: + volumes[gas] += (depth*0.1 + 1.0) // depth --> bar. + * time // in minutes. + * deco_usage; // in xxx / min @ 1bar. } // From last stop to surface - if( deco_usage > 0.0 ) - volumes[gas] += (depth*0.05 + 1.0) // avg depth --> bar. - * depth * 0.1 // time to surface, in minutes. - * deco_usage; // in xxx / min @ 1bar. + volumes[gas] += (depth*0.05 + 1.0) // avg depth --> bar. + * depth * 0.1 // time to surface, in minutes. + * deco_usage; // in xxx / min @ 1bar. //---- convert results for the ASM interface ----------------------------- +done: for(i=0; i 65534.0 ) int_O_gas_volumes[i] = 65535; @@ -2233,8 +2233,6 @@ ////////////////////////////////////////////////////////////////////////////// - - void deco_push_tissues_to_vault(void) { overlay unsigned char x;