Mercurial > public > mk2
changeset 478:fd8266b511cc
New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
author | JeanDo |
---|---|
date | Wed, 12 Oct 2011 19:02:38 +0200 |
parents | 1b09cead63a8 |
children | 9fc8feff27a5 |
files | code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/customview.asm code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/menu_custom.asm code_part1/OSTC_code_asm_part1/menu_reset.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm code_part1/OSTC_code_c_part2/p2_deco.c code_part1/OSTC_code_c_part2/p2_deco.o |
diffstat | 8 files changed, 20 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt Mon Oct 10 01:15:14 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Wed Oct 12 19:02:38 2011 +0200 @@ -1,5 +1,6 @@ New in 2.02 beta: NEW: Cave divers consomation display and alarm (CF59). +CHANGE: SAC (CF56/CF57) in range 5..50 l/min (no more decimal). NEW: 32MhZ mode: computes twice faster. BUGFIX: Hang when deco table is full (more than 32 stops).
--- a/code_part1/OSTC_code_asm_part1/customview.asm Mon Oct 10 01:15:14 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/customview.asm Wed Oct 12 19:02:38 2011 +0200 @@ -17,10 +17,10 @@ ; Customviews for divemode ; written by: Matthias Heinrichs, info@heinrichsweikamp.com -; written: 101212 ; history: -; 2010-12-12: [MH] last updated +; 2010-12-12: [MH] First updated ; 2011-01-04: [jDG] Saturation graphs in customview divemode +; 2011-10-10: [jDG] Added Cave live gas counter ; known bugs: ; ToDo:
--- a/code_part1/OSTC_code_asm_part1/definitions.asm Mon Oct 10 01:15:14 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Wed Oct 12 19:02:38 2011 +0200 @@ -110,8 +110,7 @@ ;============================================================================= -;#include "../OSTC_code_c_part2/shared_definitions.h" -#include "shared_definitions.h" +#include "../OSTC_code_c_part2/shared_definitions.h" ;============================================================================= ; Reserve space for C-code data space. Eg.when calling log.
--- a/code_part1/OSTC_code_asm_part1/menu_custom.asm Mon Oct 10 01:15:14 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_custom.asm Wed Oct 12 19:02:38 2011 +0200 @@ -47,7 +47,7 @@ ; define the display format. Also stores min/max bounds into the PROM table. ; And provides surfacemode checking of all parameters. -CF_INT8 EQU 0 ; Default display, 8 or 15 bits values. +CF_INT8 EQU 0 ; Default display, 8 or 15 bits values. CF_PERCENT EQU 1 ; Displays 110% CF_DECI EQU 2 ; Displays 1.6 CF_CENTI EQU 3 ; Displays 1.50
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm Mon Oct 10 01:15:14 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm Wed Oct 12 19:02:38 2011 +0200 @@ -178,9 +178,9 @@ CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF53 Show Laeding Tissue in Divemode CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF54 Display shallowest stop first CF_DEFAULT CF_INT8, d'0', d'0', d'10' ; GF55 Gas switch additional delay - CF_DEFAULT CF_DECI, d'200', d'5', d'250' ; CF56 Bottom gas usage (l/min or bar/min) + CF_DEFAULT CF_INT8, d'20', d'5', d'50' ; CF56 Bottom gas usage (SAC l/min) - CF_DEFAULT CF_DECI, d'200', d'5', d'250' ; CF57 Ascent/deco gas usage (l/min or bar/min) + CF_DEFAULT CF_INT8, d'20', d'5', d'50' ; CF57 Ascent/deco gas usage (SAC l/min) CF_DEFAULT CF_INT8, d'0', d'0', d'10' ; CF58 TTS for extra time at current depth [min] CF_DEFAULT CF_INT15, d'0', d'0', d'7000' ; CF59 Cave conso warning [l] CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Mon Oct 10 01:15:14 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Wed Oct 12 19:02:38 2011 +0200 @@ -3384,15 +3384,15 @@ addwfc xC+1,W movwf xA+1 ; xA:2 holds total dive seconds - ;---- Multiply by SAC, and divide by 600 (SAC in 0.1 liters per minutes) + ;---- Multiply by SAC, and divide by 60 (SAC inliters per minutes) GETCUSTOM8 d'56' ; Get bottom SAC movwf xB+0 clrf xB+1 call mult16x16 ; xC:4=xA:2*xB:2 - movlw LOW(.600) + movlw LOW(.60) movwf xB+0 - movlw HIGH(.600) + movlw HIGH(.60) movwf xB+1 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
--- a/code_part1/OSTC_code_c_part2/p2_deco.c Mon Oct 10 01:15:14 2011 +0200 +++ b/code_part1/OSTC_code_c_part2/p2_deco.c Wed Oct 12 19:02:38 2011 +0200 @@ -2508,14 +2508,14 @@ // char_I_first_gas is the bottom gas. // decoplan (char_O_deco_depth, char_O_deco_time). // CF#54 == TRUE if shallowest stop first. -// CF#56 == bottom deci-liters/minutes (0.5 .. 50.0) or bar/min. -// CF#57 == deco deci-liters/minutes (0.5 .. 50.0) or bar/min. +// CF#56 == bottom liters/minutes (5 .. 50) or bar/min. +// 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]; - overlay float bottom_usage, ascent_usage; + overlay float bottom_usage, deco_usage; overlay unsigned char i, deepest_first; overlay unsigned char gas; RESET_C_STACK @@ -2527,7 +2527,7 @@ assert(1 <= char_I_first_gas && char_I_first_gas <= NUM_GAS); gas = char_I_first_gas - 1; - bottom_usage = read_custom_function(56) * 0.1; + bottom_usage = (float) read_custom_function(56); if( bottom_usage > 0.0 ) volumes[gas] = (char_I_bottom_depth*0.1 + 1.0) // Use Psurface = 1.0 bar. @@ -2539,18 +2539,18 @@ //---- Ascent usage ------------------------------------------------------ deepest_first = read_custom_function(54) == 0; - ascent_usage = read_custom_function(57) * 0.1; // In liter/minutes. + deco_usage = (float) read_custom_function(57); // In liter/minutes. // Usage up to the first stop: // - computed at MAX depth (easier, safer), // - with an ascent speed of 10m/min. // - with ascent litter / minutes. // - still using bottom gas: - if( ascent_usage > 0.0 ) + if( deco_usage > 0.0 ) volumes[gas] += (char_I_bottom_depth*0.1 + 1.0) // Depth -> bar * (char_I_bottom_depth - char_O_first_deco_depth) * 0.1 // ascent time (min) - * ascent_usage; // Consumption ( xxx / min @ 1 bar) + * deco_usage; // Consumption ( xxx / min @ 1 bar) else volumes[gas] = 65535.0; @@ -2589,14 +2589,14 @@ // usage during stop: // Note: because first gas is not in there, increment gas+1 - if( ascent_usage > 0.0 ) + if( deco_usage > 0.0 ) volumes[gas] += (depth*0.1 + 1.0) // depth --> bar. * time // in minutes. - * ascent_usage // in xxx / min @ 1bar. + * deco_usage // in xxx / min @ 1bar. // Plus usage during ascent to the next stop, at 10m/min. + (depth*0.1 + 1.0) * ascent*0.1 // metre --> min - * ascent_usage; + * deco_usage; else volumes[gas] = 65535.0; }