diff src/divemode.asm @ 160:99ac325586ce

BUGFIX: Fast diluent (w/o dive mode menu) change did not work correctly
author heinrichsweikamp
date Mon, 08 Sep 2014 15:39:41 +0200
parents 19ad15f04f60
children 99065ef2d18e
line wrap: on
line diff
--- a/src/divemode.asm	Mon Sep 08 13:07:22 2014 +0200
+++ b/src/divemode.asm	Mon Sep 08 15:39:41 2014 +0200
@@ -1049,6 +1049,7 @@
     bra     check_gas_change_OC_bail; Yes, check for OC or bailout
 
     ; Check Diluents
+    bsf     ccr_diluent_setup       ; in CCR menus
     movlw   .0
     rcall   check_dil_common        ; With Gas 0-4 in WREG
     movlw   .1
@@ -1062,6 +1063,7 @@
     bra     check_gas_change_exit
 
 check_gas_change_OC_bail:
+    bcf     ccr_diluent_setup       ; in OC menus
     movlw   .0
     rcall   check_gas_common        ; With Gas 0-4 in WREG
     movlw   .1
@@ -1199,7 +1201,6 @@
 	cpfsgt	lo  					; gas_change_depth < current depth?
     return                          ; No, check next gas
 	incf    hi,W                    ; 1-5
-    addlw   .5                      ; 6-10
 	movwf	better_gas_number		; number (1-5) of the "better gas" in divemode, =0: no better gas available
 	movlw	better_gas_window_neg
 	subwf	lo,W                    ; Change depth-better_gas_window_neg