comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 353:b5b030c1ae7e

Avoid spurious switch-depth stops with 3 or more gas.
author JeanDo
date Tue, 07 Jun 2011 01:16:55 +0200
parents 6bdf80d7276c
children 88660a400338
comparison
equal deleted inserted replaced
349:ed137d66ac65 353:b5b030c1ae7e
558 movff EEDATA, char_I_N2_ratio ; = N2! 558 movff EEDATA, char_I_N2_ratio ; = N2!
559 bsf manual_gas_changed ; set event flag 559 bsf manual_gas_changed ; set event flag
560 bsf event_occured ; set global event flag 560 bsf event_occured ; set global event flag
561 bsf is_bailout ;=1: CC mode, but bailout active! 561 bsf is_bailout ;=1: CC mode, but bailout active!
562 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail" 562 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail"
563 movff lo,char_I_const_ppO2 563 movff lo,char_I_const_ppO2
564 movlw 6
565 movff WREG,char_I_current_gas ; Current gas is Gas6 (manual setting).
564 bra timeout_divemenu2 ; quit underwater menu! 566 bra timeout_divemenu2 ; quit underwater menu!
565 567
566 divemenu_set_gas: 568 divemenu_set_gas:
567 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? 569 btfsc FLAG_const_ppO2_mode ; in ppO2 mode?
568 bra divemenu_set_setpoint ; Yes, display SetPoint list 570 bra divemenu_set_setpoint ; Yes, display SetPoint list
625 divemenu_set_gas2a: 627 divemenu_set_gas2a:
626 movlw d'6' 628 movlw d'6'
627 cpfseq menupos ; At the "Gas 6.." position? 629 cpfseq menupos ; At the "Gas 6.." position?
628 bra divemenu_set_gas2b ; No, select Gas1-5 (Stored in Menupos) 630 bra divemenu_set_gas2b ; No, select Gas1-5 (Stored in Menupos)
629 bra divemode_set_xgas ; Configure the extra gas 631 bra divemode_set_xgas ; Configure the extra gas
632
630 divemenu_set_gas2b: 633 divemenu_set_gas2b:
631 bsf is_bailout ;=1: CC mode, but bailout active! 634 bsf is_bailout ;=1: CC mode, but bailout active!
632 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail" 635 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail"
633 movff lo,char_I_const_ppO2 636 movff lo,char_I_const_ppO2
634 637
655 subfwb wait_temp,W ; minus He 658 subfwb wait_temp,W ; minus He
656 subfwb EEDATA,F ; minus O2 659 subfwb EEDATA,F ; minus O2
657 movff EEDATA, char_I_N2_ratio ; = N2! 660 movff EEDATA, char_I_N2_ratio ; = N2!
658 bsf stored_gas_changed ; set event flag 661 bsf stored_gas_changed ; set event flag
659 bsf event_occured ; set global event flag 662 bsf event_occured ; set global event flag
663
664 movff menupos,char_I_current_gas ; Inform deco code too.
660 bra timeout_divemenu2 ; quit menu! 665 bra timeout_divemenu2 ; quit menu!
661 666
662 timeout_divemenu: 667 timeout_divemenu:
663 btfss menubit ; is the Dive mode menu displayed? 668 btfss menubit ; is the Dive mode menu displayed?
664 return ; No 669 return ; No