changeset 301:a5fd8777a598

Display ppO2[Diluent] in CCR modes
author heinrichsweikamp
date Sat, 30 Apr 2011 10:40:18 +0200
parents 438ecb8090eb
children 36cc8f0c1d73
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm
diffstat 3 files changed, 47 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Sat Apr 30 09:49:50 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Sat Apr 30 10:40:18 2011 +0200
@@ -11,6 +11,7 @@
 CHANGE: Gas Setup page 2 reworked
 BUGFIX: x-scale in Logbook fixed
 CHANGE: Some typos in English text
+NEW: Display ppO2[Diluent] in CCR modes
 
 New in 1.86 beta:
 BETA Version - Do NOT use for diving!
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Apr 30 09:49:50 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Apr 30 10:40:18 2011 +0200
@@ -134,28 +134,6 @@
 
 	bcf		onesecupdate					; one seconds update done
 
-;	GETCUSTOM8	d'38'		; Show seconds (=1?)
-;	movwf	lo
-;	movlw	d'1'
-;	cpfseq	lo					; =1?
-;	bra		diveloop_loop2		; No, minutes only
-;	bsf		update_divetime		; Set Update flag
-;
-;
-;diveloop_loop2:	
-;	btfss	update_divetime				; display new divetime?
-;	bra		diveloop_loop3				; No
-;	btfsc	premenu						; Is the divemode menu active?
-;	bra		diveloop_loop2a				; Yes
-;	call	PLED_divemins				; Display (new) divetime!
-;	btfsc	FLAG_const_ppO2_mode		; only in const_ppO2_mode
-;	call	PLED_const_ppO2_value		; display const ppO2 setting in [Bar]
-;	btfsc	ppO2_show_value				; show ppO2?
-;	call	check_ppO2					; check ppO2 and displays warning if required
-;
-;diveloop_loop2a:
-;	bcf		update_divetime				; clear flag
-;
 diveloop_loop3:
 	btfss	menubit							; Divemode menu active?
 	call	test_switches_divemode			; No, Check switches normal
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat Apr 30 09:49:50 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat Apr 30 10:40:18 2011 +0200
@@ -545,9 +545,6 @@
 ;=============================================================================
 
 PLED_display_velocity:
-;	btfsc	multi_gf_display			; Is the Multi-GF Table displayed?
-;	return							; Yes, No update and return!
-
 	ostc_debug	'v'		; Sends debug-information to screen if debugmode active
 	WIN_TOP		.90
 	WIN_LEFT	.0
@@ -974,9 +971,6 @@
 	return
 
 PLED_temp_divemode:
-;	btfsc	multi_gf_display			; Is the Multi-GF Table displayed?
-;	return								; Yes, No update and return!
-
 	ostc_debug	'u'		; Sends debug-information to screen if debugmode active
 
 ; temperature
@@ -1006,7 +1000,7 @@
     call    word_processor
 	return
 
-PLED_show_ppO2:					; Show ppO2
+PLED_show_ppO2:					; Show ppO2 (ppO2 stored in xC)
 	ostc_debug	't'		; Sends debug-information to screen if debugmode active
 	WIN_TOP		.119
 	WIN_LEFT	.0
@@ -1052,9 +1046,6 @@
 	btfsc	FLAG_apnoe_mode				; Ignore in Apnoe mode
 	return
 
-;	btfsc	multi_gf_display			; Is the Multi-GF Table displayed?
-;	return								; Yes, No update and return!
-
 	WIN_INVERT	.0					; Init new Wordprocessor	
 	call	PLED_active_gas_divemode_show	; Show gas (Non-Inverted in all cases)
 
@@ -2972,9 +2963,6 @@
 	return
 
 PLED_const_ppO2_value:
-;	btfsc	multi_gf_display			; Is the Multi-GF Table displayed?
-;	return								; Yes, No update and return!
-
 	ostc_debug	'j'		; Sends debug-information to screen if debugmode active
 	
 	WIN_TOP		.168
@@ -3137,8 +3125,51 @@
 	STRCAT_PRINT  "m"					; Display END
 	return
 
-PLED_show_end_ead_divemode3:			; Show CC EAD and END
-; ToDo...
+PLED_show_end_ead_divemode3:			; Show CC EAD, END and pO2[Diluent]
+; Show ppO2[Diluent]	
+	WIN_LEFT	.95
+	WIN_TOP		.168
+	call	PLED_divemask_color	; Set Color for Divemode mask
+	STRCPY_PRINT  "ppO2:"					; ppO2 of diluent
+	call	PLED_standard_color
+
+	movff		amb_pressure+0,xA+0
+	movff		amb_pressure+1,xA+1
+	movlw		d'10'
+	movwf		xB+0
+	clrf		xB+1
+	call		div16x16				; xC=p_amb/10
+	movff		xC+0,xA+0
+	movff		xC+1,xA+1
+	movff		char_I_O2_ratio,xB+0
+	clrf		xB+1
+	call		mult16x16				; char_I_O2_ratio * p_amb/10
+	movff		xC+0,lo
+	movff		xC+1,hi					; for output
+
+	WIN_LEFT	.130
+	WIN_TOP		.168
+	lfsr		FSR2,letter
+
+	movff		xC+0,sub_a+0
+	movff		xC+1,sub_a+1			; for compare
+	movlw		LOW	 d'10000'
+	movwf		sub_b+0
+	movlw		HIGH d'10000'			; ppO2 has mbar resolution...
+	movwf		sub_b+1
+	call		sub16					;  sub_c = sub_a - sub_b
+	movlw		'0'						
+	btfsc		neg_flag				; Display leading zero manually?
+	movwf		POSTINC2				; Yes!
+
+	bsf		leftbind
+	bsf		ignore_digit4
+	output_16dp	d'1'					; Show ppO2 w/o leading zero
+	bcf		ignore_digit4
+	bcf		leftbind
+	STRCAT_PRINT  " "					;  Display ppO2[Diluent]
+
+; EAD and END: ToDo...
 	return
 
 
@@ -3200,9 +3231,6 @@
 	return
 
 PLED_display_cns:
-;	btfsc	multi_gf_display			; Is the Multi-GF Table displayed?
-;	return								; Yes, No update and return!
-
 	btfsc	gauge_mode			; Do not display in gauge mode
 	 return