comparison code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 479:9fc8feff27a5

Enable reset in cave bailout prediction, by using chrono average depth.
author JeanDo
date Thu, 13 Oct 2011 01:59:59 +0200
parents fd8266b511cc
children 19b9e19ea4da
comparison
equal deleted inserted replaced
478:fd8266b511cc 479:9fc8feff27a5
3368 WIN_LEFT .90 3368 WIN_LEFT .90
3369 WIN_TOP .201 ; 170 + 24 + 14/2 + 32 + 14/2 = 240. 3369 WIN_TOP .201 ; 170 + 24 + 14/2 + 32 + 14/2 = 240.
3370 call PLED_standard_color 3370 call PLED_standard_color
3371 lfsr FSR2,letter 3371 lfsr FSR2,letter
3372 3372
3373 ;---- Compute divetime in seconds 3373 ;---- Retrieve divetime in seconds (since last reset)
3374 movff divemins+0,xA+0 3374 movff average_divesecs+0,xA+0
3375 movff divemins+1,xA+1 3375 movff average_divesecs+1,xA+1
3376 movlw d'60'
3377 movwf xB+0
3378 clrf xB+1
3379 call mult16x16 ; xC:4=xA:2*xB:2
3380 movf divesecs,W
3381 addwf xC+0,W
3382 movwf xA+0
3383 movlw d'0'
3384 addwfc xC+1,W
3385 movwf xA+1 ; xA:2 holds total dive seconds
3386 3376
3387 ;---- Multiply by SAC, and divide by 60 (SAC inliters per minutes) 3377 ;---- Multiply by SAC, and divide by 60 (SAC inliters per minutes)
3388 GETCUSTOM8 d'56' ; Get bottom SAC 3378 GETCUSTOM8 d'56' ; Get bottom SAC
3389 movwf xB+0 3379 movwf xB+0
3390 clrf xB+1 3380 clrf xB+1
3398 3388
3399 ;---- Multiply by average pressure [absolute, in bar] 3389 ;---- Multiply by average pressure [absolute, in bar]
3400 movff xC+0,xA+0 ; Get result (in xC+0, noy xC+2 !) into xA 3390 movff xC+0,xA+0 ; Get result (in xC+0, noy xC+2 !) into xA
3401 movff xC+1,xA+1 3391 movff xC+1,xA+1
3402 3392
3403 movf avr_rel_pressure_total+0,W ; Add surface pressure to get absolute pressure 3393 movf avr_rel_pressure+0,W ; Add surface pressure to get absolute pressure
3404 addwf last_surfpressure_30min+0,W 3394 addwf last_surfpressure_30min+0,W
3405 movwf xB+0 3395 movwf xB+0
3406 movf avr_rel_pressure_total+1,W 3396 movf avr_rel_pressure+1,W
3407 addwfc last_surfpressure_30min+1,W 3397 addwfc last_surfpressure_30min+1,W
3408 movwf xB+1 ; --> Into xB 3398 movwf xB+1 ; --> Into xB
3409 3399
3410 call mult16x16 ; xC:4=xA:2*xB:2 3400 call mult16x16 ; xC:4=xA:2*xB:2
3411 3401