comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 250:4ef3bcbc7091

Fix minor CNS calc when ppO2 > 2.55
author JeanDo
date Tue, 29 Mar 2011 23:47:19 +0200
parents 3ed240d60341
children f0cba9cff25c
comparison
equal deleted inserted replaced
249:544cc5d47755 250:4ef3bcbc7091
282 movwf xB+0 282 movwf xB+0
283 clrf xB+1 283 clrf xB+1
284 call div16x16 ; xC=(char_I_O2_ratio * p_amb/10)/100 284 call div16x16 ; xC=(char_I_O2_ratio * p_amb/10)/100
285 285
286 ; Copy ppO2 for CNS calculation 286 ; Copy ppO2 for CNS calculation
287 movff xC+0, char_I_actual_ppO2 ; copy last ppO2 to buffer register 287 tstfsz xC+1 ; Is ppO2 > 2.55bar ?
288 btfsc FLAG_const_ppO2_mode ; do in const_ppO2_mode 288 setf xC+0 ; yes: bound to 2.55... better than wrap around.
289 movff char_I_const_ppO2, char_I_actual_ppO2 ; copy last ppO2 to buffer register 289
290 movff xC+0, char_I_actual_ppO2 ; copy last ppO2 to buffer register
291 btfsc FLAG_const_ppO2_mode ; do in const_ppO2_mode
292 movff char_I_const_ppO2, char_I_actual_ppO2 ; copy last ppO2 to buffer register
290 293
291 ; Calculate CNS 294 ; Calculate CNS
292 call deco_calc_CNS_fraction ; calculate CNS 295 call deco_calc_CNS_fraction ; calculate CNS
293 movlb b'00000001' ; rambank 1 selected 296 movlb b'00000001' ; rambank 1 selected
294 297