changeset 666:3282581fe178

Allow gf switch
author heinrichsweikamp
date Sun, 02 Dec 2012 19:19:11 +0100
parents 259e4c1bf3c2
children 8a8124f6b389
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/customview.asm code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/divemode_menu.asm code_part1/OSTC_code_asm_part1/english_text.asm code_part1/OSTC_code_asm_part1/menu_reset.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm
diffstat 8 files changed, 125 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Sun Dec 02 19:19:11 2012 +0100
@@ -1,5 +1,10 @@
 New in 2.57:
 BETA Version - Do NOT use for diving!
+CHANGE: GF_hi default now 85% (CF33)
+NEW: aGF: Alternative GF (CF67 and CF68). Can be switched underwater if CF69=1
+NEW: CF67: aGF_lo [%]
+NEW: CF68: aGF_hi [%]
+NEW: CF69: Allow GF change (underwater)
 
 New in 2.56:
 BETA Version - Do NOT use for diving!
--- a/code_part1/OSTC_code_asm_part1/customview.asm	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/customview.asm	Sun Dec 02 19:19:11 2012 +0100
@@ -47,6 +47,11 @@
 	bra		customview_menu3_@5         ; Show nothing
 	dcfsnz	WREG,F
 	bra		customview_menu3_cave_bailout; Show reset option
+	dcfsnz	WREG,F
+	bra		customview_menu3_pSCR_ppO2    ; Show nothing
+	dcfsnz	WREG,F
+	bra		customview_menu3_show_change_gf; Show toggle option
+
 	return
 
 customview_menu3_cave_bailout:
@@ -54,6 +59,10 @@
 	DISPLAYTEXT	.33                     ; ResetAvr
 	return
 
+customview_menu3_show_change_gf:
+    DISPLAYTEXTH    .269                ; ToggleGF
+    return
+
 customview_menu3_marker:
 	DISPLAYTEXT	.30                     ; Set Marker
 	return
@@ -64,6 +73,7 @@
 customview_menu3_graphs:
 customview_menu3_ead_end:
 customview_menu3_@5:
+customview_menu3_pSCR_ppO2:
 	return
 
 ;=============================================================================
@@ -91,6 +101,8 @@
 	bra		customview_1sec_cave_bailout; Show Cave conso prediction.
 	dcfsnz	WREG,F
 	bra		customview_1sec_pSCR_ppO2	; Show/Update pSCR ppO2
+	dcfsnz	WREG,F
+	bra		customview_1sec_show_change_gf; Show and/or change GF values
 	; Menupos3=0, do nothing
 	return
 
@@ -109,6 +121,7 @@
 	goto	PLED_stopwatch_show_gauge  	; Update figures + Description
 
 customview_1sec_marker:                 ; Do nothing extra
+customview_1sec_show_change_gf:         ; Do nothing extra
 	bsf		menu3_active                ; Set Flag
 customview_1sec_clock:                  ; Do nothing extra
 customview_1sec_lead_tiss:              ; Do nothing extra
@@ -163,6 +176,8 @@
 	bra		customview_minute_cave_bailout; Show Cave consomation prediction.
 	dcfsnz	WREG,F
 	bra		customview_minute_pSCR_ppO2; Show pSCR ppO2 level
+	dcfsnz	WREG,F
+	bra		customview_minute_show_change_gf; Show and/or change GF values
 
 	; Menupos3=0, do nothing
 	return
@@ -173,6 +188,7 @@
 customview_minute_lead_tiss:
 	goto	PLED_show_leading_tissue_2  ; Update the leading tissue
 
+customview_minute_show_change_gf:       ; Do nothing extra
 customview_minute_cave_bailout:         ; Do nothing extra
 customview_minute_@5:                   ; Do nothing extra
 customview_minute_ead_end:              ; Do nothing extra
@@ -195,7 +211,7 @@
 	btfsc	FLAG_apnoe_mode					; In Apnoe mode?
 	bra		customview_toggle_exit			; Yes, ignore custom view in divemode completely
 
-	movlw	d'10'							; Max number
+	movlw	d'11'							; Max number
 	cpfsgt	menupos3			            ; Max reached?
 	bra		customview_mask		            ; No, show
 	clrf	menupos3			            ; Reset to zero (Zero=no custom view)
@@ -225,6 +241,8 @@
 	bra		customview_init_cave_bailout    ; 9: Show Cave consomation prediction.
 	dcfsnz	WREG,F
 	bra		customview_init_pSCR_ppo2	    ; 10: Show ppO2 for pSCR users
+    dcfsnz	WREG,F
+	bra		customview_init_show_change_gf  ; 11: Show and/or change GF values
 
 customview_init_nocustomview:
 	bra		customview_toggle_exit	
@@ -336,10 +354,29 @@
 	decfsz		WREG,F					; WREG=1?	
 	bra			customview_toggle		; No, use next Customview
 
+	btfsc		no_deco_customviews		; no-deco-mode-flag = 1
+	bra			customview_toggle		; Yes, use next Customview!
+
     call        PLED_show_pSCR_ppO2		; Yes, compute and show value
 	
 	bra         customview_toggle_exit
 
+customview_init_show_change_gf:
+ 	GETCUSTOM8	d'69'					; Allow GF change?
+	decfsz		WREG,F					; WREG=1?
+	bra			customview_toggle		; No, use next Customview
+
+	btfsc		no_deco_customviews		; no-deco-mode-flag = 1
+	bra			customview_toggle		; Yes, use next Customview!
+
+	movff       char_I_deco_model,lo
+	decfsz      lo,F                    ; jump over next line if char_I_deco_model == 1
+    bra         customview_toggle_exit
+
+	bsf			menu3_active            ; Set Flag
+    call        PLED_show_gf_customview ; Show info
+    bra         customview_toggle_exit
+
 customview_toggle_exit:
 	bcf		toggle_customview			; Clear flag
 	ostc_debug	'Y'		                ; Sends debug-information to screen in debugmode
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Dec 02 19:19:11 2012 +0100
@@ -460,6 +460,7 @@
 #DEFINE	pres_changed		flag3,7	; pressure changed
 
 #DEFINE	set_year			flag4,0	; Menu Settime
+#DEFINE	use_aGF 			flag4,0	; =1: Use alternative GF in divemode
 #DEFINE	set_day				flag4,1	; Menu Settime
 #DEFINE	set_month			flag4,2	; Menu Settime
 #DEFINE	store_sample		flag4,3	;=1 after any CF20 seconds in divemode
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Dec 02 19:19:11 2012 +0100
@@ -1980,6 +1980,7 @@
 	cpfsgt	EEDATA
 	call	PLED_brightness_full
 
+    bcf     use_aGF
 	bcf		timeout_display
 	bcf		menu3_active
 	clrf	divesecs
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Sun Dec 02 19:19:11 2012 +0100
@@ -217,10 +217,36 @@
 	bra		divemode_menu3_nothing      ; Future TTS...
 	dcfsnz	WREG,F
 	bra		toggle_stopwatch            ; Cave bailout prediction.
+	dcfsnz	WREG,F
+	bra		divemode_menu3_nothing      ; pSCR info
+	dcfsnz	WREG,F
+	bra		toggle_gradient_factors     ; Toggle gradient factors
 
 divemode_menu3_nothing:
 	bra		timeout_divemenu2			; Quit divemode menu
 
+toggle_gradient_factors:
+    btg     use_aGF                     ; Toggle GF selector bit
+    bsf     decoplan_invalid            ; The decoplan needs to updated
+    clrf    WREG
+    movff   WREG,char_O_deco_status     ; Restart decoplan computation mH
+    btfss   use_aGF
+    bra     toggle_gradient_factors2    ; Use aGf
+    ; Use normal GF
+	; Load GF values into RAM
+	GETCUSTOM8	d'32'                   ; GF low
+	movff	EEDATA,char_I_GF_Low_percentage
+	GETCUSTOM8	d'33'                   ; GF high
+	movff	EEDATA,char_I_GF_High_percentage
+	bra		timeout_divemenu2			; quit menu!
+toggle_gradient_factors2:               ; Use aGf
+	; Load GF values into RAM
+	GETCUSTOM8	d'67'                   ; aGF low
+	movff	EEDATA,char_I_GF_Low_percentage
+	GETCUSTOM8	d'68'                   ; aGF high
+	movff	EEDATA,char_I_GF_High_percentage
+	bra     timeout_divemenu2			; quit menu!
+
 set_marker:
 	movlw	d'6'                        ; Type of Alarm  (Manual Marker)
 	movwf	AlarmType                   ; Copy to Alarm Register
--- a/code_part1/OSTC_code_asm_part1/english_text.asm	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/english_text.asm	Sun Dec 02 19:19:11 2012 +0100
@@ -117,6 +117,7 @@
 #DEFINE	TXT_NX2				 "x"						 ; "x"
 #DEFINE TXT_DIL_C            "D"                         ; "D"
 #DEFINE	TXT_DIL5			 "Dil.#"                     ; "Dil.#"
+#DEFINE TXT_aGF4             "aGF:"                      ; "aGF:"
  
 #ENDIF                                                                   
 ;=============================================================================
@@ -329,9 +330,9 @@
 	TCODE    .40,   .35,     "Color# inactive"           ;193 Color# inactive
     TCODE    .40,   .35,     "Use safety stop"           ;194 Use safety stop
     TCODE    .40,   .35,     "Show GF in NDL "           ;195 Show GF in NDL	(If GF > CF08)
-    TCODE    .40,   .35,     "unused         "           ;196 unused
-    TCODE    .40,   .35,     "unused         "           ;197 unused
-    TCODE    .40,   .35,     "unused         "           ;198 unused
+    TCODE    .40,   .35,     "Alt. GF Low [%]"           ;196 Alt. GF Low [%]
+    TCODE    .40,   .35,     "Alt. GF High[%]"           ;197 Alt. GF High[%]
+    TCODE    .40,   .35,     "Allow GF change"           ;198 Allow GF change
     TCODE    .40,   .35,     "unused         "           ;199 unused
     TCODE    .40,   .35,     "unused         "           ;200 unused
     TCODE    .40,   .35,     "unused         "           ;201 unused
@@ -407,8 +408,8 @@
 
     TCODE    .0,    .0,      "pSCR Info"             	 ;266 pSCR Info (Must be 9Chars!)
 	TCODE    .0,    .184,    "Max."                      ;267 Max.
-    TCODE    .0,    .0,      ""     	                 ;268 unused
-    TCODE    .0,    .0,      ""		                   	 ;269 unused
+    TCODE    .93,   .170,    "GF Values"                 ;268 GF Values
+    TCODE    .100,  .50,     "ToggleGF"               	 ;269 ToggleGF (In Divemode Menu)
     TCODE    .0,    .0,      ""		                     ;270 unused
 
 ; New CFs Warning
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sun Dec 02 19:19:11 2012 +0100
@@ -151,7 +151,7 @@
 cf_default_table1:
     ;                          DEFAULT   MIN     MAX
 	CF_DEFAULT    CF_PERCENT,   d'30',  d'5',  	d'90'   ; CF32 GF_low_default			30%
-	CF_DEFAULT    CF_PERCENT,   d'90', 	d'30',  d'95'   ; CF33 GF_high_default			90%
+	CF_DEFAULT    CF_PERCENT,   d'85', 	d'30',  d'95'   ; CF33 GF_high_default			85%
 	CF_DEFAULT    CF_COLOR,     d'199', 0,      0 		; CF34 color_battery_surface	Color Battery sign: Deep blue
 	CF_DEFAULT    CF_COLOR,     d'255', 0,      0 		; CF35 color_standard1			Color Standard: White
 	CF_DEFAULT    CF_COLOR,     d'62',  0,      0 		; CF36 color_divemask			Color Divemask: Light green
@@ -194,10 +194,10 @@
 	CF_DEFAULT    CF_COLOR,     d'74',  0,      0 		; CF64 color_inactive	Color inactive: grey
 	CF_DEFAULT    CF_BOOL,     	0,   	0,      0 		; CF65 Show safety stop
 	CF_DEFAULT    CF_BOOL,      0,   	0,      0 		; CF66 Show GF in NDL (If GF > CF08)
-	CF_DEFAULT    CF_INT8,      d'0',   d'0',   d'0'    ; CF67 unused
-	CF_DEFAULT    CF_INT8,      d'0',   d'0',   d'0'    ; CF68 unused
+	CF_DEFAULT    CF_PERCENT,   d'30',  d'5',  	d'90'   ; CF67 aGF_low_default			30%
+	CF_DEFAULT    CF_PERCENT,   d'90', 	d'30',  d'95'   ; CF68 aGF_high_default			90%
 
-	CF_DEFAULT    CF_INT8,      d'0',   d'0',   d'0'    ; CF69 unused
+	CF_DEFAULT    CF_BOOL,     	0,   	0,      0 		; CF69 Allow GF change (Between GF and aGF)
 	CF_DEFAULT    CF_INT8,      d'0',   d'0',   d'0'    ; CF70 unused
 	CF_DEFAULT    CF_INT8,      d'0',   d'0',   d'0'    ; CF71 unused
 	CF_DEFAULT    CF_INT8,      d'0',   d'0',   d'0'    ; CF72 unused
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Wed Nov 14 12:39:39 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sun Dec 02 19:19:11 2012 +0100
@@ -890,6 +890,50 @@
 	STRCAT_PRINT " "
 	return
 
+PLED_show_gf_customview:
+	WIN_LEFT	.93
+	WIN_FONT 	FT_SMALL
+	WIN_INVERT	.0					; Init new Wordprocessor
+    call    PLED_divemask_color     ; Set Color for Divemode mask
+    DISPLAYTEXTH .268               ;"Gradient Factors"
+
+   	GETCUSTOM8	d'64'               ; Set to grey
+	call	PLED_set_color
+    btfss   use_aGF
+    call    PLED_standard_color
+
+	WIN_TOP		.192
+    STRCPY  TXT_GF3             ; "GF:"
+    GETCUSTOM8  d'32'            ; GF_lo
+    movwf   lo
+	bsf		leftbind
+	output_8
+	STRCAT  "/"
+    GETCUSTOM8  d'33'            ; GF_hi
+    movwf   lo
+    output_8
+    STRCAT_PRINT  ""
+
+   	GETCUSTOM8	d'64'               ; Set to grey
+	call	PLED_set_color
+    btfsc   use_aGF
+    call    PLED_standard_color
+
+	WIN_TOP		.216
+    STRCPY  TXT_aGF4             ; "aGF:"
+    GETCUSTOM8  d'67'            ; aGF_lo
+    movwf   lo
+    bsf		leftbind
+	output_8
+	STRCAT  "/"
+    GETCUSTOM8  d'68'            ; aGF_hi
+    movwf   lo
+	output_8
+    STRCAT_PRINT  ""
+    bcf		leftbind
+
+    call    PLED_standard_color
+    return
 
 PLED_show_cf11_cf12_cf29:; Display saturations/desaturation multiplier and last deco in the customview field
 	WIN_TOP		.25