comparison code_part1/OSTC_code_c_part2/p2_deco.c @ 743:8466932a2fcf

.. minor cleanups
author JeanDo
date Mon, 12 Aug 2013 15:08:05 +0200
parents f555590f1419
children 7e7e98247a8a
comparison
equal deleted inserted replaced
733:b064dd9c9899 743:8466932a2fcf
369 #endif 369 #endif
370 370
371 static short read_custom_function(PARAMETER unsigned char cf) 371 static short read_custom_function(PARAMETER unsigned char cf)
372 { 372 {
373 #ifdef CROSS_COMPILE 373 #ifdef CROSS_COMPILE
374 return (cf & 32) ? eeprom.bank1_CF[cf-32].value.lo 374 return READ_CF_MACRO(cf);
375 : eeprom.bank0_CF[cf ].value.lo;
376 #else 375 #else
377 extern unsigned char hi, lo; 376 extern unsigned char hi, lo;
378 extern void getcustom15(); 377 extern void getcustom15();
379 _asm 378 _asm
380 movff cf,WREG 379 movff cf,WREG
1062 switch( char_O_deco_status ) 1061 switch( char_O_deco_status )
1063 { 1062 {
1064 case 3: //---- At surface: start a new dive ------------------------------ 1063 case 3: //---- At surface: start a new dive ------------------------------
1065 clear_deco_table(); 1064 clear_deco_table();
1066 copy_deco_table(); 1065 copy_deco_table();
1067 int_O_ascenttime = 0; // Reset DTR. 1066 int_O_ascenttime = 0; // Reset TTS.
1068 int_O_extra_ascenttime = 0; 1067 int_O_extra_ascenttime = 0;
1069 char_O_nullzeit = 0; // Reset bottom time. 1068 char_O_nullzeit = 0; // Reset bottom time.
1070 char_O_deco_status = 0; // Calc bottom-time/nullzeit next iteration. 1069 char_O_deco_status = 0; // Calc bottom-time/nullzeit next iteration.
1071 1070
1072 // Values that should be reset just once for the full real dive. 1071 // Values that should be reset just once for the full real dive.
2242 //---- Retrieve bottom Gas used, and set variables. 2241 //---- Retrieve bottom Gas used, and set variables.
2243 sim_gas_last_used = char_I_first_gas; 2242 sim_gas_last_used = char_I_first_gas;
2244 sim_gas_last_depth = 0; // Surface gas marker. 2243 sim_gas_last_depth = 0; // Surface gas marker.
2245 gas_switch_set(); // Sets initial calc_N2/He_ratio 2244 gas_switch_set(); // Sets initial calc_N2/He_ratio
2246 2245
2247 //---- CCR mode : do the full TTS at once -------------------------------- 2246 //---- CCR mode : do the full CNS at once --------------------------------
2248 if( char_I_const_ppO2 != 0 ) 2247 if( char_I_const_ppO2 != 0 )
2249 { 2248 {
2250 overlay unsigned short t; // Needs 16bits here ! 2249 overlay unsigned short t; // Needs 16bits here !
2251 char_I_actual_ppO2 = char_I_const_ppO2; 2250 char_I_actual_ppO2 = char_I_const_ppO2;
2252 for(t=0; t<int_O_ascenttime; ++t) 2251 for(t=0; t<int_O_ascenttime; ++t)