changeset 304:ed08d441ed26

Backed out changeset: 9c39cedb662b
author heinrichsweikamp
date Sat, 30 Apr 2011 14:09:38 +0200 (2011-04-30)
parents 9c39cedb662b
children 77c70898c7aa
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/menu_gassetup.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm
diffstat 3 files changed, 56 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- 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'
--- 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