comparison src/divemode.asm @ 472:4fdf6886004b

CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign NEW: Show battery type in information menu (T0:1.5V AA, T1:3.6V AA, T2:3.6V/0.8A LiIon, T3:Internal 18650, T4:Internal 16650)
author heinrichsweikamp
date Sun, 18 Dec 2016 18:20:39 +0100
parents 9edb1359ce43
children c6f36c55b4f6
comparison
equal deleted inserted replaced
471:9edb1359ce43 472:4fdf6886004b
1649 return ; Done. 1649 return ; Done.
1650 1650
1651 global check_warn_battery 1651 global check_warn_battery
1652 check_warn_battery: 1652 check_warn_battery:
1653 movff batt_percent,lo 1653 movff batt_percent,lo
1654 movlw battery_show_level+1 1654 movlw battery_show_level+1
1655 cpfslt lo 1655 cpfslt lo
1656 return ; No Display, no warning 1656 return ; No Display, no warning
1657 ; Display Battery, but warn? 1657 ; Display Battery, but warn?
1658 incf warning_counter,F ; increase counter 1658 movff batt_percent,lo
1659 movlw color_code_battery_low+1
1660 cpfsgt lo ;
1661 bsf warning_active ; Set Warning flag
1662
1663 movlw .4
1664 cpfseq menupos3 ; ppO2 shown in Custom View 4?
1665 bra check_warn_battery2 ; No
1666 return ; Yes, do not show twice (in custom view and in warning area)
1667 check_warn_battery2:
1668 incf warning_counter,F ; increase counter
1659 call TFT_update_batt_percent_divemode ; Show percent 1669 call TFT_update_batt_percent_divemode ; Show percent
1660 1670 return
1661 movff batt_percent,lo 1671
1662 movlw color_code_battery_low+1
1663 cpfslt lo ;
1664 return ; No warning
1665 bsf warning_active ; Set Warning flag
1666 return
1667
1668 check_divetimeout: 1672 check_divetimeout:
1669 btfsc divemode2 1673 btfsc divemode2
1670 return ; displayed divetime is not running 1674 return ; displayed divetime is not running
1671 incf warning_counter,F ; increase counter 1675 incf warning_counter,F ; increase counter
1672 goto TFT_divetimeout ; Show timeout counter (and return) 1676 goto TFT_divetimeout ; Show timeout counter (and return)
1749 bsf warning_active ; Set Warning flag 1753 bsf warning_active ; Set Warning flag
1750 return ; Done. 1754 return ; Done.
1751 1755
1752 check_ppo2_display: 1756 check_ppo2_display:
1753 movlw .9 1757 movlw .9
1754 cpfseq menupos3 ; ppO2 shown in Custom View? 1758 cpfseq menupos3 ; ppO2 shown in Custom View 9?
1755 bra check_ppO2_a ; No 1759 bra check_ppO2_a ; No
1756 return ; Yes, do not show twice (in custom view and in warning area) 1760 return ; Yes, do not show twice (in custom view and in warning area)
1757 check_ppO2_a: 1761 check_ppO2_a:
1758 movlw .11 1762 movlw .11
1759 cpfseq menupos3 ; ppO2 shown in Custom View? 1763 cpfseq menupos3 ; ppO2 shown in Custom View 11?
1760 bra check_ppO2_b ; No 1764 bra check_ppO2_b ; No
1761 return ; Yes, do not show twice (in custom view and in warning area) 1765 return ; Yes, do not show twice (in custom view and in warning area)
1762 check_ppO2_b: 1766 check_ppO2_b:
1763 incf warning_counter,F ; increase counter 1767 incf warning_counter,F ; increase counter
1764 goto TFT_display_ppo2 ; Show ppO2 (and return) 1768 goto TFT_display_ppo2 ; Show ppO2 (and return)