diff src/divemode.asm @ 137:28b057aa9f75

Simplify gas change
author heinrichsweikamp
date Thu, 17 Jul 2014 14:24:51 +0200
parents 4574aed5cd4c
children 2852b0bd6391
line wrap: on
line diff
--- a/src/divemode.asm	Thu Jul 17 13:29:25 2014 +0200
+++ b/src/divemode.asm	Thu Jul 17 14:24:51 2014 +0200
@@ -828,6 +828,8 @@
     movwf   timeout_counter3            ; Reload timeout
 	movff	menupos2,WREG               ; Menupos3 holds number of customview/divemode menu function
 	dcfsnz	WREG,F
+    bra		divemode_option_gaschange	; Switch to the indicated "better gas"
+	dcfsnz	WREG,F
     bra		divemode_option0			; Start/Setup Divemode menu
 	dcfsnz	WREG,F
 	bra		divemode_option1			; Quit Simulation?
@@ -908,6 +910,12 @@
     banksel common
     return
 
+divemode_option_gaschange:          ; Switch to the better gas
+    movff   better_gas_number,menupos; 1-5
+    bsf     divemode_gaschange      ; Change the gas in the dive mode loop...
+    call    menuview_toggle_reset   ; Reset to zero (Zero=no menuview)
+    return
+
 divemode_option0:                   ; Start/Setup Divemode menu
     call    TFT_clear_divemode_menu ; Clear menu area
     bcf     menuview