comparison code_part1/OSTC_code_asm_part1/start.asm @ 197:f15e804ff67f

Gas switch delay + New CF#55 for additional delay in decoplan for gas switch. + BUGFIX compute integration at full ascent, not half (or the formula is wrong). + BUGFIX minor typo in 2sec exposition factors.
author JeanDo
date Sun, 13 Feb 2011 17:27:43 +0100
parents e26f49674956
children 85ea09d3b9d8
comparison
equal deleted inserted replaced
196:e185b3b028af 197:f15e804ff67f
71 movff amb_pressure+0,last_surfpressure_30min+0 71 movff amb_pressure+0,last_surfpressure_30min+0
72 movff amb_pressure+1,last_surfpressure_30min+1 ; Rests all airpressure registers 72 movff amb_pressure+1,last_surfpressure_30min+1 ; Rests all airpressure registers
73 73
74 ; reset deco data 74 ; reset deco data
75 incf nofly_time+0,F ; =1 75 incf nofly_time+0,F ; =1
76 clrf wait_temp ; Use as buffer 76 clrf WREG ; Use as buffer
77 movff wait_temp,char_I_He_ratio ; No He at the Surface 77 movff WREG,char_I_He_ratio ; No He at the Surface
78 movlw d'79' ; 79% N2 78 movlw d'79' ; 79% N2
79 movwf wait_temp ; Use as buffer 79 movff WREG,char_I_N2_ratio ; No He at the Surface
80 movff wait_temp,char_I_N2_ratio ; No He at the Surface
81 movff amb_pressure+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine 80 movff amb_pressure+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine
82 movff amb_pressure+1,int_I_pres_respiration+1 81 movff amb_pressure+1,int_I_pres_respiration+1
83 82
84 movlw d'0' 83 clrf WREG
85 movff WREG,char_I_step_is_1min ; 2 second deco mode 84 movff WREG,char_I_step_is_1min ; 2 second deco mode
86 call deco_clear_tissue ; 85 call deco_clear_tissue ;
87 call deco_calc_desaturation_time ; calculate desaturation time 86 call deco_calc_desaturation_time ; calculate desaturation time
88 call deco_clear_CNS_fraction ; clear CNS 87 call deco_clear_CNS_fraction ; clear CNS
89 call calc_deko_surfmode ; calculate desaturation every minute 88 call calc_deko_surfmode ; calculate desaturation every minute
208 207
209 display_new_cf_installed: 208 display_new_cf_installed:
210 call PLED_new_cf_warning ; Display new CF warning screen 209 call PLED_new_cf_warning ; Display new CF warning screen
211 movlw d'20' ; timeout for warning screen 210 movlw d'20' ; timeout for warning screen
212 bra startup_screen3a ; Will RETURN after timeout or button press 211 bra startup_screen3a ; Will RETURN after timeout or button press
213 212
214 restart_set_modes_and_flags: ; "Call"ed from divemode, as well! 213 ;=============================================================================
214 ; Setup all flags and parameters for divemode and simulator computations.
215 ;
216 restart_set_modes_and_flags: ; "Call"ed from divemode, as well!
215 bcf gauge_mode 217 bcf gauge_mode
216 bcf FLAG_const_ppO2_mode 218 bcf FLAG_const_ppO2_mode
217 bcf FLAG_apnoe_mode 219 bcf FLAG_apnoe_mode
218 220
219 ; Pre-load modes for OC, GF 90/90 and no Aponoe or Gauge. 221 ; Pre-load modes for OC, GF 90/90 and no Aponoe or Gauge.
220 bcf no_deco_customviews ; Clear no-deco-mode-flag 222 bcf no_deco_customviews ; Clear no-deco-mode-flag
221 movlw d'0' 223 movlw d'0'
222 movwf wait_temp 224 movff WREG,char_I_deco_model ; Clear Flagbyte
223 movff wait_temp,char_I_deco_model ; Clear Flagbyte
224 ; Load GF values into RAM 225 ; Load GF values into RAM
225 movlw d'90' 226 movlw d'90'
226 movwf wait_temp 227 movff WREG,char_I_GF_Low_percentage
227 movff wait_temp,char_I_GF_Low_percentage 228 movff WREG,char_I_GF_High_percentage ; Set to 90/90...
228 movff wait_temp,char_I_GF_High_percentage ; Set to 90/90...
229 clrf EEADRH 229 clrf EEADRH
230 read_int_eeprom d'34' ; Read deco data 230 read_int_eeprom d'34' ; Read deco data
231 movlw d'1' ; Gauge mode 231 movlw d'1' ; Gauge mode
232 cpfseq EEDATA 232 cpfseq EEDATA
233 bra restart_3_test_ppO2_mode; check for ppO2 mode 233 bra restart_3_test_ppO2_mode ; check for ppO2 mode
234 bsf gauge_mode ; Set flag for gauge mode 234 bsf gauge_mode ; Set flag for gauge mode
235 bsf no_deco_customviews ; Set no-deco-mode-flag 235 bsf no_deco_customviews ; Set no-deco-mode-flag
236 return ; start in Surfacemode 236 return ; start in Surfacemode
237 restart_3_test_ppO2_mode: 237 restart_3_test_ppO2_mode:
238 movlw d'2' ; const ppO2 mode 238 movlw d'2' ; const ppO2 mode
239 cpfseq EEDATA 239 cpfseq EEDATA
240 bra restart_3_test_apnoe_mode; check for apnoe mode 240 bra restart_3_test_apnoe_mode; check for apnoe mode
241 bsf FLAG_const_ppO2_mode ; Set flag for ppO2 mode 241 bsf FLAG_const_ppO2_mode ; Set flag for ppO2 mode
242 return ; start in Surfacemode 242 return ; start in Surfacemode
243 restart_3_test_apnoe_mode: 243 restart_3_test_apnoe_mode:
244 movlw d'3' ; Apnoe mode 244 movlw d'3' ; Apnoe mode
245 cpfseq EEDATA 245 cpfseq EEDATA
246 bra restart_4_test_gf_mode ; check for GF OC mode 246 bra restart_4_test_gf_mode ; check for GF OC mode
247 bsf FLAG_apnoe_mode ; Set flag for Apnoe Mode 247 bsf FLAG_apnoe_mode ; Set flag for Apnoe Mode
248 bsf no_deco_customviews ; Set no-deco-mode-flag 248 bsf no_deco_customviews ; Set no-deco-mode-flag
249 return ; start in Surfacemode 249 return ; start in Surfacemode
250 restart_4_test_gf_mode: 250 restart_4_test_gf_mode:
251 movlw d'4' ; GF OC mode 251 movlw d'4' ; GF OC mode
252 cpfseq EEDATA 252 cpfseq EEDATA
253 bra restart_5_test_gfO2_mode; check for GF CC mode 253 bra restart_5_test_gfO2_mode ; check for GF CC mode
254 movlw d'1' 254 movlw d'1'
255 movwf wait_temp 255 movff WREG,char_I_deco_model ; Set Flagbyte for GF method
256 movff wait_temp,char_I_deco_model ; Set Flagbyte for GF method
257 ; Load GF values into RAM 256 ; Load GF values into RAM
258 GETCUSTOM8 d'32' ; GF low 257 GETCUSTOM8 d'32' ; GF low
258 movff EEDATA,char_I_GF_Low_percentage
259 GETCUSTOM8 d'33' ; GF high
260 movff EEDATA,char_I_GF_High_percentage
261 return ; start in Surfacemode
262 restart_5_test_gfO2_mode:
263 movlw d'5' ; GF CC mode
264 cpfseq EEDATA
265 return ; Start in Surfacemode
266 bsf FLAG_const_ppO2_mode ; Set flag for ppO2 mode
267 movlw d'1'
268 movff WREG,char_I_deco_model ; Set Flagbyte for GF method
269 ; Load GF values into RAM
270 GETCUSTOM8 d'32' ; GF low
259 movff EEDATA,char_I_GF_Low_percentage 271 movff EEDATA,char_I_GF_Low_percentage
260 GETCUSTOM8 d'33' ; GF high 272 GETCUSTOM8 d'33' ; GF high
261 movff EEDATA,char_I_GF_High_percentage 273 movff EEDATA,char_I_GF_High_percentage
262 return ; start in Surfacemode 274 return ; start in Surfacemode
263 restart_5_test_gfO2_mode: 275
264 movlw d'5' ; GF CC mode 276 ;=============================================================================
265 cpfseq EEDATA
266 return ; Start in Surfacemode
267 bsf FLAG_const_ppO2_mode ; Set flag for ppO2 mode
268 movlw d'1'
269 movwf wait_temp
270 movff wait_temp,char_I_deco_model ; Set Flagbyte for GF method
271 ; Load GF values into RAM
272 GETCUSTOM8 d'32' ; GF low
273 movff EEDATA,char_I_GF_Low_percentage
274 GETCUSTOM8 d'33' ; GF high
275 movff EEDATA,char_I_GF_High_percentage
276 return ; start in Surfacemode
277 277
278 startup_screen1: 278 startup_screen1:
279 call PLED_ClearScreen 279 call PLED_ClearScreen
280 call PLED_startupscreen1 ; show startup sreen 280 call PLED_startupscreen1 ; show startup sreen
281 startup_screen1_2: 281 startup_screen1_2: