comparison 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
comparison
equal deleted inserted replaced
45:76dfe320e6ec 46:05227510cae0
87 return ; Done 87 return ; Done
88 88
89 deco_setup: 89 deco_setup:
90 banksel char_I_step_is_1min ; Select the right bank... 90 banksel char_I_step_is_1min ; Select the right bank...
91 clrf char_I_step_is_1min ; Default to 2sec steps. 91 clrf char_I_step_is_1min ; Default to 2sec steps.
92 clrf char_I_const_ppO2 ; Clear for OC, will be set for CC later
92 93
93 ; Fixed ambient surface pressure to 1bar. 94 ; Fixed ambient surface pressure to 1bar.
94 movlw LOW(.1000) 95 movlw LOW(.1000)
95 movwf int_I_pres_surface+0 96 movwf int_I_pres_surface+0
96 movwf int_I_pres_respiration+0 97 movwf int_I_pres_respiration+0
97 movlw HIGH(.1000) 98 movlw HIGH(.1000)
98 movwf int_I_pres_surface+1 99 movwf int_I_pres_surface+1
99 movwf int_I_pres_respiration+1 100 movwf int_I_pres_respiration+1
100 101
101 clrf int_I_divemins+0 ; Dive start 102 clrf int_I_divemins+0 ; Dive start
102 clrf int_I_divemins+1 103 clrf int_I_divemins+1
103 bcf use_agf ; =1: Use aGF 104 banksel common ; Bank1
105 bcf use_agf ; =1: Use aGF
106
104 rcall deco_setup_dive 107 rcall deco_setup_dive
105 108
109 ; Setup char_I_const_ppO2 for CC modes
110 btfsc FLAG_ccr_mode ; =1: CCR mode (Fixed ppO2 or Sensor) active
106 movff char_I_setpoint_cbar+0,char_I_const_ppO2 ; Setup fixed Setpoint (Always start with SP1) 111 movff char_I_setpoint_cbar+0,char_I_const_ppO2 ; Setup fixed Setpoint (Always start with SP1)
107 112
108 rcall get_first_gas_to_WREG ; Gets first gas (0-4) into WREG 113 rcall get_first_gas_to_WREG ; Gets first gas (0-4) into WREG
109 movff WREG,char_I_first_gas ; Copy for compatibility 114 movff WREG,char_I_first_gas ; Copy for compatibility
110 extern setup_gas_registers 115 extern setup_gas_registers