changeset 643:3b50c9949b84

gas6 setup simplified
author heinrichsweikamp
date Wed, 03 Oct 2012 12:40:00 +0200
parents 2cecac640202
children 420e62cd88ad
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/divemode_menu.asm code_part1/OSTC_code_asm_part1/menu_ppO2.asm
diffstat 4 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Wed Oct 03 11:39:50 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Wed Oct 03 12:40:00 2012 +0200
@@ -5,6 +5,7 @@
 NEW: CF29 stored in divelog header (Byte 52)
 BUGFIX: Gas Setup when using "ERR" Gases (e.g. NX17)
 
+
 New in 2.51:
 BETA Version - Do NOT use for diving!
 NEW: Saves last selected custom view for surface mode and dive mode
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Wed Oct 03 11:39:50 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Wed Oct 03 12:40:00 2012 +0200
@@ -33,9 +33,9 @@
 ; Startup Tasks for all modes
 	ostc_debug	'R'		; Sends debug-information to screen if debugmode active
 	call	PLED_ClearScreen			; clean up OLED
-	call	PLED_divemode_mask					; Display mask
-	call	PLED_active_gas_divemode	; Display gas, if required
+	call	PLED_divemode_mask			; Display mask
 	call	PLED_temp_divemode			; Displays temperature
+   	call	PLED_active_gas_divemode	; Display gas
 
 ; Reload last customview
 	read_int_eeprom	d'94'				; Read last selected customview dive mode into EEDATA
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Wed Oct 03 11:39:50 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Wed Oct 03 12:40:00 2012 +0200
@@ -520,10 +520,13 @@
 	read_int_eeprom		d'24'			; O2 value
 	movff	EEDATA,lo
 	decf	lo,F						; decrease O2
-	movlw	d'3'						; Limit-1
+	movlw	d'0'
 	cpfseq	lo
 	bra		divemenu_set_xgas2_o2minus2
-	incf	lo,F						; limit to min=9
+    read_int_eeprom		d'25'			; Read He ratio
+    movf    EEDATA,W                    ; into WREG
+    sublw   .100                        ; 100% total...
+    movwf   lo                          ; Set to Max. value
 divemenu_set_xgas2_o2minus2:
 	movff	lo, EEDATA
 	write_int_eeprom	d'24'			; O2 Value
@@ -547,8 +550,8 @@
 	movf	EEDATA,W
 	addwf	lo,W						; add O2 value
 	movwf	hi							; store in temp
-	movlw	d'101'
-	cpfseq	hi							; O2 and He > 100?
+	movlw	d'100'
+	cpfsgt	hi							; O2 and He > 100?
 	bra		divemenu_set_xgas2_o2plus3	; No!
 	decf	lo,F						; reduce O2 again = unchanged after operation
 divemenu_set_xgas2_o2plus3:				; save current value
--- a/code_part1/OSTC_code_asm_part1/menu_ppO2.asm	Wed Oct 03 11:39:50 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_ppO2.asm	Wed Oct 03 12:40:00 2012 +0200
@@ -746,17 +746,19 @@
 	OUTPUTTEXT	d'192'				; Dil.
 	PUTC	' '
 
+ 	movlw	d'96'						; = address for O2 ratio
+	movwf	EEADR
     movlw   .1
     movwf   EEADRH
-	addlw	d'96'						; = address for O2 ratio
-	movwf	EEADR
 	call	read_eeprom					; Read O2 ratio
 	movff	EEDATA, lo                  ; O2 ratio
 	bsf		leftbind
 	output_99
 	PUTC	'/'
-	addlw	d'97'						; = address for He ratio
+	movlw	d'97'						; = address for He ratio
 	movwf	EEADR
+    movlw   .1
+    movwf   EEADRH
 	call	read_eeprom					; Read He ratio
 	movff	EEDATA,lo                   ; And copy into hold register
     clrf    EEADRH