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