comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 341:2144f19fa1eb

BUGFIX protect against ISR changing pressure/temperature while reading it.
author JeanDo
date Fri, 20 May 2011 00:48:30 +0200
parents 21a0f7393468
children 797e2ac42d24
comparison
equal deleted inserted replaced
340:ecbbbd423e86 341:2144f19fa1eb
130 movlw HIGH d'1000' 130 movlw HIGH d'1000'
131 addwfc xC+1,F ; add 1000mBar 131 addwfc xC+1,F ; add 1000mBar
132 132
133 movff xC+0,sim_pressure+0 133 movff xC+0,sim_pressure+0
134 movff xC+1,sim_pressure+1 134 movff xC+1,sim_pressure+1
135 135
136 movff sim_pressure+0,amb_pressure+0 ; override readings with simulator values 136 ; This override is done in ISR too, but do it right now also:
137 movff sim_pressure+0,amb_pressure+0
137 movff sim_pressure+1,amb_pressure+1 138 movff sim_pressure+1,amb_pressure+1
138 139
139 bcf menubit2 140 bcf menubit2
140 bcf menubit3 141 bcf menubit3
141 bcf menubit 142 bcf menubit
343 call PLED_topline_box 344 call PLED_topline_box
344 WIN_INVERT .1 345 WIN_INVERT .1
345 DISPLAYTEXT .12 ; "Wait..." 346 DISPLAYTEXT .12 ; "Wait..."
346 WIN_INVERT .0 347 WIN_INVERT .0
347 348
348 movff sim_pressure+0,amb_pressure+0 ; override readings with simulator values 349 ; This override is done in ISR too, but do it right now also:
350 movff sim_pressure+0,amb_pressure+0
349 movff sim_pressure+1,amb_pressure+1 351 movff sim_pressure+1,amb_pressure+1
350 352
351 call divemode_check_decogases ; Checks for decogases and sets the gases 353 call divemode_check_decogases ; Checks for decogases and sets the gases
352 call divemode_prepare_flags_for_deco 354 call divemode_prepare_flags_for_deco
353 call set_first_gas ; Set current N2/He/O2 ratios. 355 call set_first_gas ; Set current N2/He/O2 ratios.