Mercurial > public > hwos_code
comparison src/simulator.asm @ 296:af13a18a233b
Slight more efficient bail deco, Test with 2 bail tanks.
author | jDG |
---|---|
date | Sun, 31 May 2015 02:47:50 +0200 |
parents | 7027d735ac62 |
children | 2fe34fc0e2ae |
comparison
equal
deleted
inserted
replaced
295:7027d735ac62 | 296:af13a18a233b |
---|---|
375 | 375 |
376 deco_planer_endloop: | 376 deco_planer_endloop: |
377 banksel char_I_step_is_1min | 377 banksel char_I_step_is_1min |
378 clrf char_I_step_is_1min ; Back to 2sec loops | 378 clrf char_I_step_is_1min ; Back to 2sec loops |
379 | 379 |
380 ;---- BAILOUT: Switch to OC gases for ascent cycles -------------------------- | |
381 banksel common | |
382 btfss is_bailout ; Doing a bailout decoplan ? | |
383 bra deco_planer_finishing ; NO: keep gases | |
384 | |
385 rcall deco_setup_oc_gases ; Switch to OC gas and no const_ppO2 | |
386 | |
380 ;---- Wait until status reach zero ------------------------------------------- | 387 ;---- Wait until status reach zero ------------------------------------------- |
381 deco_planer_finishing: | 388 deco_planer_finishing: |
382 btg LEDg | 389 btg LEDg |
383 ; clrf TMR5L | 390 ; clrf TMR5L |
384 ; clrf TMR5H ; 30,51757813µs/bit in TMR5L:TMR5H | 391 ; clrf TMR5H ; 30,51757813µs/bit in TMR5L:TMR5H |
386 | 393 |
387 banksel char_O_deco_status ; Bank 2 | 394 banksel char_O_deco_status ; Bank 2 |
388 movf char_O_deco_status,W | 395 movf char_O_deco_status,W |
389 bnz deco_planer_finishing | 396 bnz deco_planer_finishing |
390 | 397 |
391 ;---- Optional extra cycle to recompute stops in bailout mode --------------- | 398 ;---- Done: add CNS from decoplan, and restore tissues |
392 banksel common | |
393 btfss is_bailout ; Doing a bailout decoplan ? | |
394 bra deco_planer_finished ; NO: so we are done. | |
395 | |
396 rcall deco_setup_oc_gases ; Switch to OC gas and no const_ppO2 | |
397 | |
398 movlw .3 ; restart 2sec cycles. | |
399 movff WREG,char_O_deco_status | |
400 call deco_calc_hauptroutine ; Reset + simulate first 2secs. | |
401 | |
402 deco_planer_bail_loop: | |
403 btg LEDg | |
404 ; clrf TMR5L | |
405 ; clrf TMR5H ; 30,51757813µs/bit in TMR5L:TMR5H | |
406 call deco_calc_hauptroutine ; Simulate 2sec more | |
407 | |
408 banksel char_O_deco_status ; Bank 2 | |
409 movf char_O_deco_status,W | |
410 bnz deco_planer_bail_loop | |
411 | |
412 deco_planer_finished: | |
413 call deco_calc_CNS_planning | 399 call deco_calc_CNS_planning |
414 movff int_O_CNS_fraction+0,decoplan_CNS+0 | 400 movff int_O_CNS_fraction+0,decoplan_CNS+0 |
415 movff int_O_CNS_fraction+1,decoplan_CNS+1 | 401 movff int_O_CNS_fraction+1,decoplan_CNS+1 |
416 call deco_pull_tissues_from_vault | 402 call deco_pull_tissues_from_vault |
417 bcf LEDg | 403 bcf LEDg |