Mercurial > public > hwos_code
comparison src/divemode.asm @ 376:e99bb91f6f92
CHANGE: Do not show ppO2 in warning area if already shown in custom view
BUGFIX: Logbook list view for more then 100 stored dives
author | heinrichsweikamp |
---|---|
date | Mon, 07 Sep 2015 13:58:23 +0200 |
parents | 5c6da9fa5cb0 |
children | 6f3530eb48f9 |
comparison
equal
deleted
inserted
replaced
375:a9e35c1327aa | 376:e99bb91f6f92 |
---|---|
1633 movff PRODH,sub_a+1 | 1633 movff PRODH,sub_a+1 |
1634 call subU16 | 1634 call subU16 |
1635 btfsc neg_flag | 1635 btfsc neg_flag |
1636 bra check_ppO2_0 ; Not too low | 1636 bra check_ppO2_0 ; Not too low |
1637 ; ppO2 low | 1637 ; ppO2 low |
1638 incf warning_counter,F ; increase counter | 1638 rcall check_ppo2_display ; display if not already shown in custom view |
1639 call TFT_display_ppo2 ; Show ppO2 | |
1640 movlw d'4' ; Type of Alarm (ppO2 low) | 1639 movlw d'4' ; Type of Alarm (ppO2 low) |
1641 movwf AlarmType ; Copy to Alarm Register | 1640 movwf AlarmType ; Copy to Alarm Register |
1642 bsf event_occured ; Set Event Flag | 1641 bsf event_occured ; Set Event Flag |
1643 bsf warning_active ; Set Warning flag | 1642 bsf warning_active ; Set Warning flag |
1644 return ; Done. | 1643 return ; Done. |
1653 movff PRODH,sub_a+1 | 1652 movff PRODH,sub_a+1 |
1654 call subU16 | 1653 call subU16 |
1655 btfss neg_flag | 1654 btfss neg_flag |
1656 return ; No Display, no warning | 1655 return ; No Display, no warning |
1657 ; Display ppO2, but warn? | 1656 ; Display ppO2, but warn? |
1658 incf warning_counter,F ; increase counter | 1657 rcall check_ppo2_display ; display if not already shown in custom view |
1659 call TFT_display_ppo2 ; Show ppO2 | |
1660 | 1658 |
1661 ;check if we are within our warning thresholds! | 1659 ;check if we are within our warning thresholds! |
1662 movff xC+0,sub_b+0 | 1660 movff xC+0,sub_b+0 |
1663 movff xC+1,sub_b+1 | 1661 movff xC+1,sub_b+1 |
1664 movff opt_ppO2_max,WREG ; PPO2 Max for MOD calculation and color coding in divemode | 1662 movff opt_ppO2_max,WREG ; PPO2 Max for MOD calculation and color coding in divemode |
1674 bsf event_occured ; Set Event Flag | 1672 bsf event_occured ; Set Event Flag |
1675 bsf warning_active ; Set Warning flag | 1673 bsf warning_active ; Set Warning flag |
1676 return ; Done. | 1674 return ; Done. |
1677 | 1675 |
1678 check_ppO2_1: ; ppO2 very high | 1676 check_ppO2_1: ; ppO2 very high |
1679 incf warning_counter,F ; increase counter | 1677 rcall check_ppo2_display ; display if not already shown in custom view |
1680 call TFT_display_ppo2 ; Show ppO2 | |
1681 movlw d'5' ; Type of Alarm | 1678 movlw d'5' ; Type of Alarm |
1682 movwf AlarmType ; Copy to Alarm Register | 1679 movwf AlarmType ; Copy to Alarm Register |
1683 bsf event_occured ; Set Event Flag | 1680 bsf event_occured ; Set Event Flag |
1684 bsf warning_active ; Set Warning flag | 1681 bsf warning_active ; Set Warning flag |
1685 return ; Done. | 1682 return ; Done. |
1683 | |
1684 check_ppo2_display: | |
1685 movlw .9 | |
1686 cpfseq menupos3 ; ppO2 shown in Custom View? | |
1687 bra check_ppO2_a ; No | |
1688 return ; Yes, do not show twice (in custom view and in warning area) | |
1689 check_ppO2_a: | |
1690 incf warning_counter,F ; increase counter | |
1691 call TFT_display_ppo2 ; Show ppO2 | |
1692 return | |
1693 | |
1686 | 1694 |
1687 global check_cns_violation | 1695 global check_cns_violation |
1688 check_cns_violation: | 1696 check_cns_violation: |
1689 ; Check if CNS should be displayed | 1697 ; Check if CNS should be displayed |
1690 movff int_O_CNS_fraction+1,lo ; copy into bank1 | 1698 movff int_O_CNS_fraction+1,lo ; copy into bank1 |