changeset 105:64109f6fb3d1

added END to GasSetup, small fixes
author heinrichsweikamp
date Sun, 19 Dec 2010 14:27:30 +0100
parents 2a2606e9db5f
children 966ebf905514
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/math.asm code_part1/OSTC_code_asm_part1/menu_gassetup.asm code_part1/OSTC_code_asm_part1/menu_reset.asm
diffstat 4 files changed, 80 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Wed Dec 15 11:01:35 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Sun Dec 19 14:27:30 2010 +0100
@@ -1,3 +1,9 @@
+New in 1.74 Beta:
+BETA Version - Do NOT use for diving!
+NEW: Added END (Equivalent narcotic depth) for GasSetup
+CHANGE: Limits for several Custom Functions
+BUGFIX: Realtime Simulator menu
+
 New in 1.73 Beta:
 BETA Version - Do NOT use for diving!
 NEW: Anti-Alised fonts (OSTC MK.2 only)
--- a/code_part1/OSTC_code_asm_part1/math.asm	Wed Dec 15 11:01:35 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/math.asm	Sun Dec 19 14:27:30 2010 +0100
@@ -91,8 +91,7 @@
     return        
 
 
-mult16x16:
-;xA*xB=xC
+mult16x16:		;xA*xB=xC
 	clrf    xC+2        	  ;  Clear the High-Order Bits
 	clrf    xC+3
 	movf    xA, w               ;  Do the "L" Multiplication first
--- a/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Wed Dec 15 11:01:35 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Sun Dec 19 14:27:30 2010 +0100
@@ -409,8 +409,75 @@
 	movwf	POSTINC2
 	movlw	' '
 	movwf	POSTINC2
+	movlw	'('
+	movwf	POSTINC2
+	movlw	'E'
+	movwf	POSTINC2
+	movlw	'N'
+	movwf	POSTINC2
+	movlw	'D'
+	movwf	POSTINC2
+	movlw	':'
+	movwf	POSTINC2
+
+; Show END in m
+	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'
+	addwfc	hi,F				; lo:hi holding MOD+10m
+
+	movf	divemins+0,W
+	addlw	0x07
+	movwf	EEADR
+	call	read_eeprom		; He value in % -> EEDATA
+	movlw	d'100'
+	movwf	xA+0
+	movf	EEDATA,W		; He value in % -> EEDATA
+	subwf	xA+0,F			; xA+0 = 100 - He Value in %
+	clrf	xA+1
+	movff	lo,xB+0
+	movff	hi,xB+1			; Copy MOD+10
+	call	mult16x16		;xA*xB=xC
+	movff	xC+0,xA+0
+	movff	xC+1,xA+1
+	movlw	d'100'
+	movwf	xB+0
+	clrf	xB+1
+	call	div16x16		;xA/xB=xC with xA as remainder 	
+	;	xC:2 = ((MOD+10) * 100 - HE Value in %) / 100
+	movlw	d'10'
+	subwf	xC+0,F				; Subtract 10m...
+	movff	xC+0,lo
+	movlw	d'0'
+	subwfb	xC+1,F
+	movff	xC+1,hi
+	output_16
+	movlw	'm'
+	movwf	POSTINC2
+	movlw	')'
+	movwf	POSTINC2
 	movlw	' '
 	movwf	POSTINC2
+	movlw	' '
+	movwf	POSTINC2
+
 	call	word_processor		
 
 	WIN_TOP		.125
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Wed Dec 15 11:01:35 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sun Dec 19 14:27:30 2010 +0100
@@ -111,7 +111,7 @@
 	CF_DEFAULT    CF_INT8, 	    d'7',   d'3',   d'18'   ; minimum_velocity		    7min/min
 	CF_DEFAULT    CF_INT15,	    d'1160',d'950', 0    	; pressure_offset_divemode	1160mBar
 	CF_DEFAULT    CF_INT15,	    d'1100',d'1100', 0   	; max_surfpressure		    1100mBar
-	CF_DEFAULT    CF_PERCENT,	d'20',  d'1',  d'99'   ; min_gradient_factor		20%
+	CF_DEFAULT    CF_PERCENT,	d'20',  d'1',  d'99'   	; min_gradient_factor		20%
 	CF_DEFAULT    CF_PERCENT,	d'20',  d'1',  d'20'	; oxygen_threshold			20%
 
 	CF_DEFAULT    CF_SEC,	    d'30',  d'5',   d'30'   ; dive_menu_timeout		    30s
@@ -120,13 +120,13 @@
 	CF_DEFAULT    CF_PERCENT,	d'60',  d'60',  d'100'	; nofly_time_ratio			60%
 	CF_DEFAULT    CF_PERCENT,	d'100', d'50',  d'100'  ; gradient_factor_alarm1	100%
 
-	CF_DEFAULT    CF_PERCENT,	d'10',  d'01',  d'100'  ; cns_display_surface		10%
+	CF_DEFAULT    CF_PERCENT,	d'10',  d'0',  	d'100'  ; cns_display_surface		10%
 	CF_DEFAULT    CF_DECI,	    d'10',  d'0',  	d'10'	; deco_distance_for_sim		1m
-	CF_DEFAULT    CF_CENTI,     d'019', d'019', d'021'	; ppo2_warning_low			0.19 Bar
-	CF_DEFAULT    CF_CENTI,     d'160', d'100', d'160'  ; ppo2_warning_high			1.60 Bar
-	CF_DEFAULT    CF_CENTI,     d'150', d'100', d'150'	; ppo2_display_high			1.50 Bar
+	CF_DEFAULT    CF_CENTI,     d'019', d'19', 	d'021'	; ppo2_warning_low			0.19 Bar
+	CF_DEFAULT    CF_CENTI,     d'160', d'0', 	d'160'  ; ppo2_warning_high			1.60 Bar
+	CF_DEFAULT    CF_CENTI,     d'150', d'0', 	d'150'	; ppo2_display_high			1.50 Bar
     
-	CF_DEFAULT    CF_INT8,	    d'10',  d'1',   d'120'   ; sampling_rate				10s
+	CF_DEFAULT    CF_INT8,	    d'10',  d'1',   d'120'  ; sampling_rate				10s
 	CF_DEFAULT    CF_INT8,	    d'6',   d'0',   d'15'   ; sampling_divisor_temp		/6
 	CF_DEFAULT    CF_INT8,	    d'6',   d'0',   d'15'   ; sampling_divisor_deco		/6
 	CF_DEFAULT    CF_INT8,	    d'0',   d'0',   d'15'   ; sampling_divisor_tank		never