diff src/simulator.asm @ 46:05227510cae0

Bugfix: deco gas init in OC planner
author heinrichsweikamp
date Wed, 04 Sep 2013 12:39:17 +0200
parents 1e2d2b0bca5b
children ec4d8503ec45
line wrap: on
line diff
--- a/src/simulator.asm	Wed Aug 28 18:48:11 2013 +0200
+++ b/src/simulator.asm	Wed Sep 04 12:39:17 2013 +0200
@@ -89,6 +89,7 @@
 deco_setup:
         banksel char_I_step_is_1min     ; Select the right bank...
         clrf    char_I_step_is_1min     ; Default to 2sec steps.
+        clrf    char_I_const_ppO2       ; Clear for OC, will be set for CC later
 
         ; Fixed ambient surface pressure to 1bar.
         movlw   LOW(.1000)
@@ -98,11 +99,15 @@
         movwf   int_I_pres_surface+1
         movwf   int_I_pres_respiration+1
     
-        clrf    int_I_divemins+0                ; Dive start
+        clrf    int_I_divemins+0         ; Dive start
         clrf    int_I_divemins+1
-        bcf     use_agf                         ; =1: Use aGF
+        banksel common                   ; Bank1
+        bcf     use_agf                  ; =1: Use aGF
+        
         rcall   deco_setup_dive
 
+        ; Setup char_I_const_ppO2 for CC modes
+        btfsc   FLAG_ccr_mode           ; =1: CCR mode (Fixed ppO2 or Sensor) active
         movff   char_I_setpoint_cbar+0,char_I_const_ppO2    ; Setup fixed Setpoint (Always start with SP1)
 
         rcall   get_first_gas_to_WREG           ; Gets first gas (0-4) into WREG