# HG changeset patch # User heinrichsweikamp # Date 1304165378 -7200 # Node ID ed08d441ed26a4ec07a8bd50362e59f5da3dea5e # Parent 9c39cedb662bcb2daa77278ed124902af64560c7 Backed out changeset: 9c39cedb662b diff -r 9c39cedb662b -r ed08d441ed26 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Sat Apr 30 14:07:44 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Sat Apr 30 14:09:38 2011 +0200 @@ -85,8 +85,8 @@ ;============================================================================= -;#include "../OSTC_code_c_part2/shared_definitions.h" -#include "shared_definitions.h" +#include "../OSTC_code_c_part2/shared_definitions.h" +;#include "shared_definitions.h" ;============================================================================= ; Reserve space for C-code data space. Eg.when calling log. diff -r 9c39cedb662b -r ed08d441ed26 code_part1/OSTC_code_asm_part1/menu_gassetup.asm --- a/code_part1/OSTC_code_asm_part1/menu_gassetup.asm Sat Apr 30 14:07:44 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_gassetup.asm Sat Apr 30 14:09:38 2011 +0200 @@ -336,8 +336,23 @@ lfsr FSR2, letter WIN_LEFT .90 OUTPUTTEXTH .298 ; END: - - rcall gassetup_get_mod ; compute MOD based on CF18 into lo:hi + GETCUSTOM8 .18 ; ppO2 warnvalue in WREG + mullw d'10' + movff PRODL,xA+0 + movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 + movf divemins+0,W + addlw 0x06 + movwf EEADR + call read_eeprom ; O2 value + movff EEDATA,xB+0 + clrf xB+1 + call div16x16 ; xA/xB=xC with xA as remainder + movlw d'10' + subwf xC+0,F ; Subtract 10m... + movff xC+0,lo + movlw d'0' + subwfb xC+1,F + movff xC+1,hi ; lo:hi holding MOD in meters movlw d'10' addwf lo,F movlw d'0' diff -r 9c39cedb662b -r ed08d441ed26 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Sat Apr 30 14:07:44 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Sat Apr 30 14:09:38 2011 +0200 @@ -3082,15 +3082,47 @@ bra PLED_show_end_ead_divemode3 ; No, show CC EAD and END PLED_show_end_ead_divemode2: ; Show OC EAD and END -; EAD and END: ToDo... - -; Show EAD +; Show EAD: char_I_N2_ratio/0.79*rel_pressure:2*10 -> char_I_N2_ratio*rel_pressure:2/7900 -> EAD in m WIN_LEFT .125 WIN_TOP .192 - -; Show END + movff char_I_N2_ratio,xA+0 + clrf xA+1 + movff rel_pressure+0,xB+0 + movff rel_pressure+1,xB+1 + call mult16x16 ; xA*xB=xC + movlw LOW d'7900' + movwf xB+0 + movlw HIGH d'7900' + movwf xB+1 + call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder + movff xC+0,lo + movff xC+1,hi ; lo:hi now hold EAD in m + lfsr FSR2,letter + output_16_3 ; Display only full meters + STRCAT_PRINT "m" ; Display EAD + WIN_LEFT .125 WIN_TOP .216 +; Show END = rel_pressure × (100 - char_I_He_ratio)/10000 -> Result in m + movff char_I_He_ratio,lo ; temp + movlw d'100' + bsf STATUS,C + subfwb lo,W + movwf xA+0 + clrf xA+1 + movff rel_pressure+0,xB+0 + movff rel_pressure+1,xB+1 + call mult16x16 ; xA*xB=xC + movlw LOW d'10000' + movwf xB+0 + movlw HIGH d'10000' + movwf xB+1 + call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder + movff xC+0,lo + movff xC+1,hi ; lo:hi now hold END in m + lfsr FSR2,letter + output_16_3 + STRCAT_PRINT "m" ; Display END return PLED_show_end_ead_divemode3: ; Show CC EAD, END and pO2[Diluent] @@ -3138,14 +3170,6 @@ STRCAT_PRINT " " ; Display ppO2[Diluent] ; EAD and END: ToDo... - -; Show EAD - WIN_LEFT .125 - WIN_TOP .192 - -; Show END - WIN_LEFT .125 - WIN_TOP .216 return