annotate src/tft_outputs.asm @ 562:8b7ea27ea1fa

seperate desat and sat multipliers for GF and Non-GF modes. Set to 100/100 as default in GF mode
author heinrichsweikamp
date Sat, 03 Feb 2018 15:17:01 +0100
parents b7eb98dbd800
children 54346c651b6a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3 ; File tft_outputs.asm REFACTORED VERSION V2.95a1
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Startup subroutines
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-08-07 : [mH] moving from OSTC code
heinrichsweikamp
parents:
diff changeset
11
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 262
diff changeset
12 #include "hwos.inc" ; Mandatory header
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
13 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
14 #include "tft.inc"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
15 #include "start.inc"
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
16 #include "wait.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
17 #include "strings.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
18 #include "convert.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
19 #include "varargs.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
20 #include "math.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
21 #include "isr.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
22 #include "eeprom_rs232.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
23 #include "adc_lightsensor.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
24 #include "surfmode.inc"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
25 #include "divemode.inc"
0
heinrichsweikamp
parents:
diff changeset
26 #include "external_flash.inc"
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
27 #include "ghostwriter.inc"
0
heinrichsweikamp
parents:
diff changeset
28 #include "customview.inc"
heinrichsweikamp
parents:
diff changeset
29 #include "i2c.inc"
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
30 #include "colorschemes.inc"
229
e1e5876bd777 minor cleanup
mh@mh-THINK
parents: 227
diff changeset
31 #include "calibrate.inc"
0
heinrichsweikamp
parents:
diff changeset
32
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
33
0
heinrichsweikamp
parents:
diff changeset
34 extern aa_wordprocessor
heinrichsweikamp
parents:
diff changeset
35
heinrichsweikamp
parents:
diff changeset
36 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
37
heinrichsweikamp
parents:
diff changeset
38 gui CODE
heinrichsweikamp
parents:
diff changeset
39 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
40
heinrichsweikamp
parents:
diff changeset
41 global TFT_divemask_color
heinrichsweikamp
parents:
diff changeset
42 TFT_divemask_color:
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
43 movlw color_green
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
44 btfsc divemode ; in Divemode?
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
45 rcall TFT_divemask_color_dive
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
46 bra TFT_standard_color0
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
47
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
48 TFT_divemask_color_dive:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
49 movff opt_dive_color_scheme,WREG ; 0-3
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
50 incf WREG
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
51 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
52 retlw color_scheme_divemode_mask1 ;0
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
53 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
54 retlw color_scheme_divemode_mask2 ;1
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
55 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
56 retlw color_scheme_divemode_mask3 ;2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
57 retlw color_scheme_divemode_mask4 ;3
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
58
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
59
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
60 global TFT_attention_color
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
61 TFT_attention_color:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
62 movlw color_yellow ; TODO
0
heinrichsweikamp
parents:
diff changeset
63 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
64 TFT_attention_color_dive:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
65 retlw color_yellow ; TODO
0
heinrichsweikamp
parents:
diff changeset
66
heinrichsweikamp
parents:
diff changeset
67 global TFT_warnings_color
heinrichsweikamp
parents:
diff changeset
68 TFT_warnings_color:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
69 movlw color_red ; TODO
0
heinrichsweikamp
parents:
diff changeset
70 bra TFT_standard_color0
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
71 TFT_warnings_color_dive:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
72 retlw color_red ; TODO
0
heinrichsweikamp
parents:
diff changeset
73
heinrichsweikamp
parents:
diff changeset
74 global TFT_disabled_color
heinrichsweikamp
parents:
diff changeset
75 TFT_disabled_color:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
76 movlw color_grey ; Default to OSTC grey (dark blue)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
77 btfsc divemode ; in Divemode?
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
78 rcall TFT_disabled_color_dive
0
heinrichsweikamp
parents:
diff changeset
79 bra TFT_standard_color0
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
80 TFT_disabled_color_dive:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
81 movff opt_dive_color_scheme,WREG ; 0-3
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
82 incf WREG
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
83 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
84 retlw color_scheme_divemode_dis1 ;0
87
82750b8dfcee CHANGE: Color schemes improved
heinrichsweikamp
parents: 85
diff changeset
85 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
86 retlw color_scheme_divemode_dis2 ;1
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
87 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
88 retlw color_scheme_divemode_dis3 ;2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
89 retlw color_scheme_divemode_dis4 ;3
0
heinrichsweikamp
parents:
diff changeset
90
heinrichsweikamp
parents:
diff changeset
91 global TFT_standard_color
heinrichsweikamp
parents:
diff changeset
92 TFT_standard_color:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
93 setf WREG ; Default white
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
94 btfsc divemode ; in Divemode?
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
95 rcall TFT_standard_color_dive
0
heinrichsweikamp
parents:
diff changeset
96 TFT_standard_color0:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
97 goto TFT_set_color ; and return...
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
98 TFT_standard_color_dive:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
99 movff opt_dive_color_scheme,WREG ; 0-3
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
100 incf WREG
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
101 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
102 retlw color_scheme_divemode_std1 ;0
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
103 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
104 retlw color_scheme_divemode_std2 ;1
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
105 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
106 retlw color_scheme_divemode_std3 ;2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
107 retlw color_scheme_divemode_std4 ;3
0
heinrichsweikamp
parents:
diff changeset
108
heinrichsweikamp
parents:
diff changeset
109 TFT_color_code macro color_code_temp
heinrichsweikamp
parents:
diff changeset
110 movlw color_code_temp
heinrichsweikamp
parents:
diff changeset
111 call TFT_color_code1
heinrichsweikamp
parents:
diff changeset
112 endm
heinrichsweikamp
parents:
diff changeset
113
heinrichsweikamp
parents:
diff changeset
114 global TFT_color_code1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
115 TFT_color_code1: ; Color-codes the output, if required
0
heinrichsweikamp
parents:
diff changeset
116 dcfsnz WREG
heinrichsweikamp
parents:
diff changeset
117 bra TFT_color_code_depth ; depth_warn_mbar [mbar], 16Bit
heinrichsweikamp
parents:
diff changeset
118 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
119 bra TFT_color_code_cns ; color-code CNS values (CNS in hi:lo [%])
0
heinrichsweikamp
parents:
diff changeset
120 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
121 bra TFT_color_code_gf ; color-code GF value [%]
0
heinrichsweikamp
parents:
diff changeset
122 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
123 bra TFT_color_code_ppo2 ; Color-code ppO2 values (ppO2 in hi:lo [cbar]) by its warning flags
0
heinrichsweikamp
parents:
diff changeset
124 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
125 bra TFT_color_code_ceiling ; Color-code the ceiling depth
0
heinrichsweikamp
parents:
diff changeset
126 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
127 bra TFT_color_code_gaslist ; Color-code current row in Gaslist (%O2 in hi) according to current amb_pressure
0
heinrichsweikamp
parents:
diff changeset
128 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
129 bra TFT_color_code_ppo2_hud ; Color-code ppO2 values (ppO2 in --:lo [cbar]) by its value
0
heinrichsweikamp
parents:
diff changeset
130 dcfsnz WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
131 bra TFT_color_code_battery ; Color-code the battery display
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
132 dcfsnz WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
133 bra TFT_color_code_stop ; Color-code the stop depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
134
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
135
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
136 TFT_color_code_gaslist: ; %O2 in hi
0
heinrichsweikamp
parents:
diff changeset
137 ; Check very high ppO2 manually
heinrichsweikamp
parents:
diff changeset
138 SAFE_2BYTE_COPY amb_pressure,xA
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
139 movlw d'10'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
140 movwf xB+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
141 clrf xB+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
142 call div16x16 ; xC=p_amb/10
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
143 movff xC+0,xA+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
144 movff xC+1,xA+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
145 movff hi,xB+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
146 clrf xB+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
147 call mult16x16 ; hi * p_amb/10
0
heinrichsweikamp
parents:
diff changeset
148 ; Check if ppO2>6,55bar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
149 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
150 bra TFT_warnings_color ; Yes, warn in warning color
0
heinrichsweikamp
parents:
diff changeset
151 ; Check if ppO2>3,30bar
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
152 btfsc xC+1,7
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
153 bra TFT_warnings_color ; Yes, warn in warning color
0
heinrichsweikamp
parents:
diff changeset
154 ; Check for low ppo2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
155 movff xC+0,sub_a+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
156 movff xC+1,sub_a+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
157 movff char_I_ppO2_min,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
158 mullw d'100' ; char_I_ppO2_min*100
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
159 movff PRODL,sub_b+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
160 movff PRODH,sub_b+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
161 call subU16
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
162 btfsc neg_flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
163 bra TFT_warnings_color ; too low -> Warning Color!
0
heinrichsweikamp
parents:
diff changeset
164 ; Check for high ppo2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
165 movff gaslist_gas_global,WREG ; Read current gas O2 ratio
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
166 lfsr FSR1,opt_gas_type ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
167 movff PLUSW1,xA+0 ; xA+0 used as temp here -> holds type
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
168 movff char_I_ppO2_max_deco,xB+1 ; xB+1 used as temp here
507
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
169 movlw .3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
170 cpfseq xA+0 ; Deco?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
171 movff char_I_ppO2_max,xB+1 ; No, overwrite with travel/bottom max
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
172 movf xB+1,W ; Result in WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
173 mullw d'100' ; char_I_ppO2_max*100
526
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
174 movff PRODL,sub_b+0
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
175 movff PRODH,sub_b+1
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
176 infsnz sub_a+0,F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
177 incf sub_a+1,F ; add 1mbar to avoid warning on equal
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
178 call subU16 ; sub_c = sub_a - sub_b
526
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
179 btfss neg_flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
180 bra TFT_warnings_color ; too high -> Warning Color!
0
heinrichsweikamp
parents:
diff changeset
181 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
182
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
183
0
heinrichsweikamp
parents:
diff changeset
184 TFT_color_code_ceiling:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
185 btfsc hi,char_invalid_flag ; is the invalid flag set? (bit 7 here)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
186 bra TFT_color_code_ceiling_1 ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
187 SAFE_2BYTE_COPY rel_pressure,sub_a ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
188 movff lo,sub_b+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
189 movff hi,sub_b+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
190 call subU16 ; sub_c = sub_a - sub_b : sub_c = rel_pressure [cm] - int_O_ceiling [mbar => cm]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
191 btfsc neg_flag ; is ceiling > current depth?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
192 bra TFT_warnings_color ; YES - set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
193 bra TFT_standard_color ; NO - set to standard color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
194 TFT_color_code_ceiling_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
195 bcf hi,char_invalid_flag ; clear the invalid flag (bit 7 here)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
196 bra TFT_disabled_color ; set to disabled color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
197
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
198
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
199 TFT_color_code_stop:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
200 movff char_O_deco_gas+0,WREG ; get flag for invalid deco data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
201 btfsc WREG,char_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
202 bra TFT_disabled_color ; set to disabled color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
203 SAFE_2BYTE_COPY rel_pressure,xA ; get current pressure in mbar = cm
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
204 movlw LOW d'100'
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
205 movwf xB+0
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
206 clrf xB+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
207 call div16x16 ; xA/xB=xC with xA as remainder: Divide/100 => xC+0 = current depth in meters
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
208 movff char_O_first_deco_depth,WREG; get stop depth in m into WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
209 subwf xC+0,W ; compute current depth - stop depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
210 btfsc STATUS,C ; result negative?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
211 bra TFT_standard_color ; NO - set to standard color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
212 bra TFT_warnings_color ; YES - set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
213
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
214
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
215
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
216 TFT_color_code_depth: ; with depth as rel_pressure in [mbar] in hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
217 movff lo,sub_a+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
218 movff hi,sub_a+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
219 movlw LOW depth_warn_mbar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
220 movwf sub_b+0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
221 movlw HIGH depth_warn_mbar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
222 movwf sub_b+1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
223 call subU16 ; sub_c = sub_a - sub_b
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
224 TSTOSS opt_modwarning ; 0=standard, 1=blink
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
225 bra TFT_color_code_depth_std
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
226 btfss neg_flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
227 bra TFT_color_code_depth_warn ; set to warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
228 bra TFT_color_code_depth_ppO2 ; check depth against MOD and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
229 TFT_color_code_depth_std:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
230 btfss neg_flag
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
231 bra TFT_warnings_color ; set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
232 bra TFT_standard_color ; set to standard color and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
233 TFT_color_code_depth_ppO2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
234 movff opt_dive_mode,WREG ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
235 decfsz WREG,F ; are we in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
236 bra TFT_color_code_depth_no_ccr ; NO - continue checking for ppO2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
237 btfsc is_bailout ; YES - check if in bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
238 bra TFT_color_code_depth_no_ccr ; YES - continue checking for ppO2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
239 ; no warning by depth for all CCR modes when not in bailout ## V2.94
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
240 ;movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
241 ;decfsz WREG,F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
242 ;bra TFT_color_code_ppo2_depth_no_ccr ; Not Sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
243 bcf blinking_depth_warning ; reset warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
244 bra TFT_standard_color ; no color coding, return.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
245 TFT_color_code_depth_no_ccr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
246 movff int_O_breathed_ppO2+1,WREG ; get upper byte of currently breathed ppO2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
247 btfsc WREG,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
248 bra TFT_color_code_depth_warn ; YES - animate in warning design
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
249 bcf blinking_depth_warning ; NO - reset warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
250 bra TFT_standard_color ; set standard color and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
251 TFT_color_code_depth_warn:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
252 bsf blinking_depth_warning ; set warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
253 bra TFT_warnings_color ; set to warning color and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
254
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
255
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
256 TFT_color_code_cns: ; with CNS% in hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
257 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
258 bra TFT_color_code_cns_1 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
259 bcf hi,int_invalid_flag ; YES - clear invalid flag ## Todo: use ~bitmask and AND
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
260 bcf hi,int_warning_flag ; clear warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
261 bcf hi,int_prewarning_flag ; clear pre-warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
262 bra TFT_disabled_color ; set to disabled color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
263 TFT_color_code_cns_1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
264 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
265 bra TFT_color_code_cns_2 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
266 bcf hi,int_warning_flag ; YES - clear warning ## Todo: use ~bitmask and AND
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
267 bcf hi,int_prewarning_flag ; clear pre-warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
268 bra TFT_warnings_color ; set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
269 TFT_color_code_cns_2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
270 bcf hi,int_prewarning_flag ; clear pre-warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
271 bra TFT_standard_color ; set to standard color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
272
0
heinrichsweikamp
parents:
diff changeset
273
heinrichsweikamp
parents:
diff changeset
274 TFT_color_code_gf:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
275 btfsc hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
276 bra TFT_warnings_color ; YES - set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
277 btfsc hi,int_prewarning_flag ; is the attention flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
278 bra TFT_attention_color ; YES - set to attention color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
279 bra TFT_standard_color ; NO - set to normal color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
280
0
heinrichsweikamp
parents:
diff changeset
281
heinrichsweikamp
parents:
diff changeset
282 TFT_color_code_ppo2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
283 btfss hi,int_warning_flag ; is the warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
284 bra TFT_color_code_ppo2_1 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
285 bcf hi,int_warning_flag ; YES - clear warning flag ## Todo: use ~bitmask and AND
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
286 bcf hi,int_prewarning_flag ; clear pre-warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
287 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
288 bcf hi,int_low_flag ; clear low warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
289 bra TFT_warnings_color ; warn in warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
290 TFT_color_code_ppo2_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
291 bcf hi,int_prewarning_flag ; clear pre-warning flag (it may be set) ## Todo: use ~bitmask and AND
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
292 bcf hi,int_high_flag ; clear high warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
293 bcf hi,int_low_flag ; clear low warning flag (it may be set)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
294 bra TFT_standard_color ; set to standard color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
295
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
296
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
297 TFT_color_code_ppo2_hud: ; With ppO2 [cbar] in --:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
298 movff char_O_deco_warnings,WREG ; get the deco warnings vector
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
299 btfss WREG,deco_flag ; are we in deco?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
300 bra TFT_color_code_ppo2_hud_a ; NO - load normal max value as threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
301 movff char_I_ppO2_max_deco,WREG ; YES - load deco value as threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
302 bra TFT_color_code_ppo2_hud_b
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
303 TFT_color_code_ppo2_hud_a:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
304 movff char_I_ppO2_max,WREG ; ppO2 max while not in deco
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
305 TFT_color_code_ppo2_hud_b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
306 cpfsgt lo ; lo > threshold?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
307 bra TFT_color_code_ppo2_hud1 ; NO - continue with checking for ppO2 low
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
308 bra TFT_warnings_color ; YES - set warning color and return
0
heinrichsweikamp
parents:
diff changeset
309 TFT_color_code_ppo2_hud1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
310 movff opt_dive_mode,WREG ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
311 decfsz WREG,F ; now: 0=CC, 1=Gauge, 2=Apnea, 3=PSCR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
312 bra TFT_color_code_ppo2_hud_nocc; not CCR...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
313 btfsc is_bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
314 bra TFT_color_code_ppo2_hud_nocc; is bailout, hence not loop mode...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
315 movff char_I_ppO2_min_loop,WREG ; ppO2 min loop mode color coding
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
316 bra TFT_color_code_ppo2_hud_cont
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
317 TFT_color_code_ppo2_hud_nocc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
318 movff char_I_ppO2_min,WREG ; PPO2 min for all other modes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
319 TFT_color_code_ppo2_hud_cont:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
320 cpfslt lo ; lo < char_I_ppO2_min?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
321 bra TFT_standard_color ; NO - set standard color and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
322 bra TFT_warnings_color ; Yes - set warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
323
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
324
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
325 TFT_color_code_battery: ; With battery percent in lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
326 movlw color_code_battery_low ; get warning threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
327 cpfsgt lo ; is battery percent < threshold?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
328 bra TFT_warnings_color ; YES - set to warning color and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
329 bra TFT_standard_color ; NO - set to standard color and return
0
heinrichsweikamp
parents:
diff changeset
330
heinrichsweikamp
parents:
diff changeset
331 ; ****************************************************************************
heinrichsweikamp
parents:
diff changeset
332
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
333 global TFT_show_OC_startgas_surface
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
334 TFT_show_OC_startgas_surface: ; Show first gas and "OSTC2-like" active gases
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
335 ; Show first gas
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
336 WIN_SMALL surf_decotype_column+.1,surf_decotype_row+.30
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
337 extern get_first_gas_to_WREG,gaslist_strcat_gas
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
338 call get_first_gas_to_WREG ; Gets first gas (1-5) into WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
339 decf WREG,W ; 1-5 -> 0-4
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
340 movwf PRODL
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
341 call gaslist_strcat_gas ; Input: PRODL : gas number (0..4), Output: Text appended into buffer pointed by FSR2.
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
342 STRCAT_PRINT ""
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
343 ; Show boxes
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
344 WIN_TOP surf_decotype_row+.30+.25
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
345 WIN_LEFT surf_decotype_boxes_left1+.1
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
346 rcall TFT_disabled_color
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
347 movff opt_gas_type+0,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
348 tstfsz hi
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
349 rcall TFT_standard_color
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
350 STRCPY_PRINT "1"
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
351 decfsz hi,F ; Type = 1 (First)?
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
352 bra DISP_active_gas_surfmode3 ; No, skip box
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
353 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left1, surf_decotype_boxes_left1+.8 ;top, bottom, left, right
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
354 DISP_active_gas_surfmode3:
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
355 rcall TFT_disabled_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
356 movff opt_gas_type+1,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
357 tstfsz hi
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
358 rcall TFT_standard_color
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
359 WIN_LEFT surf_decotype_boxes_left2+.1
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
360 STRCPY_PRINT "2"
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
361 decfsz hi,F ; Type = 1 (First)?
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
362 bra DISP_active_gas_surfmode4 ; No, skip box
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
363 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left2, surf_decotype_boxes_left2+.8 ;top, bottom, left, right
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
364 DISP_active_gas_surfmode4:
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
365 rcall TFT_disabled_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
366 movff opt_gas_type+2,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
367 tstfsz hi
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
368 rcall TFT_standard_color
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
369 WIN_LEFT surf_decotype_boxes_left3+.1
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
370 STRCPY_PRINT "3"
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
371 decfsz hi,F ; Type = 1 (First)?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
372 bra DISP_active_gas_surfmode5 ; No, skip box
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
373 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left3, surf_decotype_boxes_left3+.8 ;top, bottom, left, right
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
374 DISP_active_gas_surfmode5:
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
375 rcall TFT_disabled_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
376 movff opt_gas_type+3,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
377 tstfsz hi
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
378 rcall TFT_standard_color
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
379 WIN_LEFT surf_decotype_boxes_left4+.1
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
380 STRCPY_PRINT "4"
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
381 decfsz hi,F ; Type = 1 (First)?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
382 bra DISP_active_gas_surfmode6 ; No, skip box
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
383 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left4, surf_decotype_boxes_left4+.8 ;top, bottom, left, right
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
384 DISP_active_gas_surfmode6:
394
642e927520eb BUGFIX: minor text allignment in CCR mode
heinrichsweikamp
parents: 386
diff changeset
385 rcall TFT_disabled_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
386 movff opt_gas_type+4,hi ; 0=Disabled, 1=First, 2=Travel, 3=Deco
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
387 tstfsz hi
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
388 rcall TFT_standard_color
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
389 WIN_LEFT surf_decotype_boxes_left5+.1
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
390 STRCPY_PRINT "5"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
391 rcall TFT_standard_color ; Reset color
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
392 decfsz hi,F ; Type = 1 (First)?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
393 return ; no, Done.
234
57155164faad Show OSTC2-like active gas boxes in surface mode
heinrichsweikamp
parents: 231
diff changeset
394 WIN_FRAME_STD surf_decotype_boxes_top, surf_decotype_boxes_bottom, surf_decotype_boxes_left5, surf_decotype_boxes_left5+.8 ;top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
395 return ; Done.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
396
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
397
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
398 global TFT_show_color_schemes
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
399 TFT_show_color_schemes: ; update the color schemes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
400 bsf divemode ; put in divemode
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
401 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
402 WIN_TINY .12,.40
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
403 STRCAT_TEXT_PRINT tDepth
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
404 WIN_TINY .62,.40
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
405 STRCAT_TEXT_PRINT tMaxDepth
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
406 WIN_TINY .122,.40
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
407 STRCAT_TEXT_PRINT tDivetime
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
408
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
409 ; Show some demo screen
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
410
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
411 ; Depth demo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
412 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
413 WIN_MEDIUM .3,.54
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
414 movlw LOW .5172
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
415 movwf lo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
416 movlw HIGH .5172
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
417 movwf hi
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
418 bsf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
419 bsf ignore_digit4
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
420 output_16 ; Full meters in Big font
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
421 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
422 STRCAT_PRINT "" ; Display full meters
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
423 WIN_SMALL .25,.66
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
424 movlw LOW .5172
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
425 movwf lo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
426 movlw HIGH .5172
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
427 movwf hi
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
428 PUTC "."
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
429 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
430 movwf ignore_digits
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
431 bsf ignore_digit5
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
432 output_16dp d'0' ; .1m in SMALL font
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
433 STRCAT_PRINT "" ; Display decimeters
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
434 WIN_FONT FT_SMALL
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
435
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
436 ; Max. Depth demo
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
437 WIN_MEDIUM .64,.54
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
438 bsf ignore_digit4 ; no 0.1m
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
439 bsf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
440 movlw LOW .6349
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
441 movwf lo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
442 movlw HIGH .6349
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
443 movwf hi
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
444 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
445 STRCAT_PRINT "" ; Display full meters
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
446 bcf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
447 ; .1m in SMALL font
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
448 WIN_SMALL .87,.66
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
449 PUTC "."
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
450 movlw d'4'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
451 movwf ignore_digits
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
452 bsf ignore_digit5
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
453 bsf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
454 movlw LOW .6349
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
455 movwf lo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
456 movlw HIGH .6349
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
457 movwf hi
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
458 output_16dp d'0'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
459 STRCAT_PRINT "" ; Display decimeters
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
460 bcf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
461
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
462 ; Divetime demo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
463 movff mins,lo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
464 clrf hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
465 WIN_MEDIUM .103, .54
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
466 output_16_3 ; limit to 999 and display only (0-999)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
467 STRCAT_PRINT "" ; Show minutes in large font
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
468 WIN_SMALL .139, .66 ; left position for two sec figures
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
469 PUTC ':'
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
470 bsf leftbind
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
471 movff secs,lo
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
472 output_99x
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
473 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
474 STRCAT_PRINT "" ; Show seconds in small font
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
475
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
476 bcf divemode ; don't stay in divemode
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
477 return
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
478
0
heinrichsweikamp
parents:
diff changeset
479 global TFT_divemode_mask
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
480 TFT_divemode_mask: ; Displays mask in divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
481 bcf FLAG_TFT_divemode_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
482 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
483 WIN_TINY dm_mask_depth_column,dm_mask_depth_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
484 STRCAT_TEXT_PRINT tDepth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
485 WIN_TINY dm_mask_maxdepth_column,dm_mask_maxdepth_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
486 TSTOSS opt_vsigraph ; 0=skip, 1=draw
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
487 WIN_TINY dm_mask_maxdepth_column_nvsi,dm_mask_maxdepth_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
488 STRCAT_TEXT_PRINT tMaxDepth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
489 WIN_TINY dm_mask_divetime_column,dm_mask_divetime_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
490 STRCAT_TEXT_PRINT tDivetime
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
491 bra TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
492
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
493 global TFT_divemode_mask_alternative
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
494 TFT_divemode_mask_alternative: ; Alt. mask for divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
495 bcf FLAG_TFT_divemode_mask_alt
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
496 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
497 WIN_TINY dm_mask_depth_column,dm_mask_depth_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
498 STRCAT_TEXT_PRINT tDepth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
499 WIN_TINY dm_mask_divetime_column-.30,dm_mask_divetime_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
500 STRCAT_TEXT_PRINT tDivetime
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
501 bra TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
502
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
503 global TFT_draw_gassep_line
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
504 TFT_draw_gassep_line:
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
505 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
506 return
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
507 btfsc divemode_menu ; Is the dive mode menu shown?
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
508 return ; Yes, return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
509 bra TFT_standard_color ; and return...
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
510
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
511 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
512
0
heinrichsweikamp
parents:
diff changeset
513 global TFT_display_velocity
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
514 TFT_display_velocity: ; With divA+0 = m/min, neg_flag_velocity: ascend=1, descend=0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
515 bcf STATUS,C
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
516 movlw velocity_display_threshold_1 ; lowest threshold for display vertical velocity
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
517 subwf divA+0,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
518 btfss STATUS,C
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
519 bra TFT_velocity_clear ; lower then threshold. Clear text and graph (If active)
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
520
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
521 ; We have something to display
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
522 bsf display_velocity ; Set flag
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
523 ; check if descending: no warning color if descending
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
524 rcall TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
525 btfsc neg_flag_velocity ; Ignore for descent!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
526 rcall TFT_velocity_set_color ; Set color for text and set threshold for graph
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
527
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
528 rcall TFT_velocity_disp ; Show the text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
529
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
530 TSTOSS opt_vsigraph ; =1: draw the graphical VSI bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
531 bra TFT_display_velocity_done ; No graph
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
532
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
533 btfsc alternative_divelayout ; Alternative layout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
534 bra TFT_display_velocity_done ; Yes, no graph! (no room when divetime minutes is three figures)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
535
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
536 btfsc neg_flag_velocity ; Ignore for descent!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
537 rcall TFT_velocity_graph ; Show the graph
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
538 btfss neg_flag_velocity ; Ignore for descent!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
539 rcall TFT_velocity_clear_graph ; Clear the graph for descent
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
540
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
541 TFT_display_velocity_done:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
542 bra TFT_standard_color ; and return!
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
543
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
544 TFT_speed_table:
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
545 ; use a depth-dependent ascent rate warning
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
546 ; depth(ft): <20 >20 >40 >60 >75 >88 >101 >115 >128 >144 >164
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
547 ; speed(ft/min): 23 26 29 33 36 43 49 56 59 62 66
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
548 ; depth(m): <=6 >6 >12 >18 >23 >27 >31 >35 >39 >44 >50
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
549 ; speed(m/min): 7 8 9 10 11 13 15 17 18 19 20 (warning)
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
550 ; speed(m/min): 5 6 7 8 8 10 12 13 14 15 15 (attention)
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
551
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
552 ; <xx m, warning speed, attention speed, unused
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
553 DB .6,.7,.5,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
554 DB .12,.8,.6,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
555 DB .18,.9,.7,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
556 DB .23,.10,.8,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
557 DB .27,.11,.8,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
558 DB .31,.13,.10,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
559 DB .35,.15,.12,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
560 DB .39,.17,.13,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
561 DB .44,.18,.14,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
562 DB .50,.19,.15,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
563 DB .200,.20,.15,.0
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
564
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
565 TFT_velocity_set_color: ; Set color based on speed table or use static thresholds, with divA+0 = m/min
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
566 ; check if old/new ascend logic is used
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
567 TSTOSS opt_vsitextv2 ; 0=standard, 1=dynamic
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
568 bra TFT_velocity_set_color_static ; static ascend rate limit
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
569
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
570 ; get the actual depth in m
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
571 SAFE_2BYTE_COPY rel_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
572 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
573 movff hi,xA+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
574 movff lo,xA+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
575 movlw LOW d'100'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
576 movwf xB+0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
577 clrf xB+1 ; Devide/100 -> xC+0 = Depth in m
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
578 call div16x16 ; xA/xB=xC with xA as remainder
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
579 ;movf xC+0,W ; Depth in m
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
580
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
581 ; point to speed table
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
582 movlw LOW (TFT_speed_table-.3)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
583 movwf TBLPTRL
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
584 movlw HIGH (TFT_speed_table-.3)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
585 movwf TBLPTRH
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
586 movlw UPPER (TFT_speed_table-.3)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
587 movwf TBLPTRU
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
588
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
589 TFT_velocity_set_color_skip:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
590 TBLRD*+ ; 3 dummy reads
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
591 TBLRD*+
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
592 TBLRD*+
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
593
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
594 TBLRD*+ ; Get speed threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
595 movf xC+0,W ; Depth in m
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
596 cpfsgt TABLAT ; Threshold > current depth ?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
597 bra TFT_velocity_set_color_skip ; No
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
598
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
599 TBLRD*+ ; Get warning speed threshold
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
600 movf TABLAT,W
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
601 movwf divA+1 ; Copy for graph routine
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
602 cpfslt divA+0 ; smaller then actual value (in m/min)?
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
603 bra TFT_warnings_color ; Set Warning color (And return)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
604 TBLRD*+ ; Get attention speed threshold
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
605 movf TABLAT,W
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
606 cpfslt divA+0 ; smaller then actual value (in m/min)?
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
607 bra TFT_attention_color ; Set Attention color (And return)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
608 bra TFT_standard_color ; ...and return
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
609
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
610 TFT_velocity_set_color_static:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
611 movlw color_code_velocity_warn_high ; in m/min
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
612 movwf divA+1 ; Copy for graph routine
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
613 cpfslt divA+0 ; smaller then actual value (in m/min)?
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
614 bra TFT_warnings_color ; Set Warning color (And return)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
615 movlw color_code_velocity_attn_high ; in m/min
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
616 cpfslt divA+0 ; smaller then actual value (in m/min)?
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
617 bra TFT_attention_color ; Set Attention color (And return)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
618 bra TFT_standard_color ; ...and return
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
619
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
620 TFT_velocity_disp:
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
621 WIN_SMALL dm_velocity_text_column, dm_velocity_text_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
622 TSTOSS opt_units ; 0=Meters, 1=Feets
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
623 bra TFT_velocity_metric
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
624 ;TFT_velocity_imperial:
0
heinrichsweikamp
parents:
diff changeset
625 movff divA+0,WREG ; divA+0 = m/min
heinrichsweikamp
parents:
diff changeset
626 mullw .100 ; PRODL:PRODH = mbar/min
heinrichsweikamp
parents:
diff changeset
627 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
628 movff PRODH,hi
heinrichsweikamp
parents:
diff changeset
629 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
heinrichsweikamp
parents:
diff changeset
630 movlw '-'
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
631 btfsc neg_flag_velocity
0
heinrichsweikamp
parents:
diff changeset
632 movlw '+'
heinrichsweikamp
parents:
diff changeset
633 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
634 bsf leftbind
heinrichsweikamp
parents:
diff changeset
635 output_16
heinrichsweikamp
parents:
diff changeset
636 bcf leftbind
heinrichsweikamp
parents:
diff changeset
637 STRCAT_TEXT_PRINT tVelImperial ; Unit switch
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
638 return
0
heinrichsweikamp
parents:
diff changeset
639
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
640 TFT_velocity_metric:
0
heinrichsweikamp
parents:
diff changeset
641 movff divA+0,lo ; divA+0 = m/min
heinrichsweikamp
parents:
diff changeset
642 movlw '-'
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
643 btfsc neg_flag_velocity
0
heinrichsweikamp
parents:
diff changeset
644 movlw '+'
heinrichsweikamp
parents:
diff changeset
645 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
646 output_99
heinrichsweikamp
parents:
diff changeset
647 STRCAT_TEXT_PRINT tVelMetric ; Unit switch
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
648 return
310
453a3d13570f VSIbar #2: ascend bar + max-depth title alignment. Debug: bar-frame, zero-line, sim+- 0.1m
janos_kovacs <kovjanos@gmail.com>
parents: 309
diff changeset
649
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
650 TFT_velocity_graph: ; divA+0 = m/min
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
651 ; divA+0 holding the ascend speed in m/min
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
652 movff divA+0,hi ; Copy
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
653 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right -> outer frame
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
654 rcall TFT_divemask_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
655 WIN_FRAME_COLOR dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;inner frame
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
656 rcall TFT_divemask_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
657 WIN_FRAME_COLOR dm_velobar_top+.10, dm_velobar_bot-.10, dm_velobar_lft, dm_velobar_rgt ;inner frame
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
658 rcall TFT_divemask_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
659 WIN_FRAME_COLOR dm_velobar_top+.20, dm_velobar_bot-.20, dm_velobar_lft, dm_velobar_rgt ;inner frame
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
660 rcall TFT_divemask_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
661 WIN_FRAME_COLOR dm_velobar_top+.30, dm_velobar_bot-.30, dm_velobar_lft, dm_velobar_rgt ;inner frame
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
662
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
663 movff divA+1,xA+0 ; m/min for warning level (upper two blocks)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
664 clrf xA+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
665 movlw .5
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
666 movwf xB+0 ; Threshold for color warning (5 color normal + 2 color warning)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
667 clrf xB+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
668 call div16x16 ;xA/xB=xC with xA as remainder
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
669 ; xC+0 holds stepsize in m/min (e.g. =3 for 15m/min warning treshold)
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
670 movff hi,xA+0 ; Velocity in m/min
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
671 clrf xA+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
672 movff xC+0,xB+0 ; Step size
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
673 clrf xB+1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
674 call div16x16 ;xA/xB=xC with xA as remainder
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
675 ; xC+0 now holds amount of segments to show
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
676
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
677 movff hi,divA+0 ; Copy back for numeric output
399
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
678 movlw d'7'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
679 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
680 bra DISP_graph_vel_7
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
681 movlw d'6'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
682 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
683 bra DISP_graph_vel_6
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
684 movlw d'5'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
685 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
686 bra DISP_graph_vel_5
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
687 movlw d'4'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
688 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
689 bra DISP_graph_vel_4
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
690 movlw d'3'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
691 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
692 bra DISP_graph_vel_3
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
693 movlw d'2'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
694 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
695 bra DISP_graph_vel_2
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
696 movlw d'1'
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
697 cpfslt xC+0
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
698 bra DISP_graph_vel_1
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
699 bra DISP_graph_vel_0 ; Should not happen...
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
700
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
701 DISP_graph_vel_7:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
702 rcall TFT_warnings_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
703 WIN_BOX_COLOR dm_velobar_top+.2, dm_velobar_top+.8, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
704 DISP_graph_vel_6:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
705 rcall TFT_warnings_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
706 WIN_BOX_COLOR dm_velobar_top+.12, dm_velobar_top+.18, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
707 DISP_graph_vel_5:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
708 rcall TFT_attention_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
709 WIN_BOX_COLOR dm_velobar_top+.22, dm_velobar_top+.28, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
710 DISP_graph_vel_4:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
711 rcall TFT_standard_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
712 WIN_BOX_COLOR dm_velobar_top+.32, dm_velobar_top+.38, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
713 DISP_graph_vel_3:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
714 rcall TFT_standard_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
715 WIN_BOX_COLOR dm_velobar_top+.42, dm_velobar_top+.48, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
716 DISP_graph_vel_2:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
717 rcall TFT_standard_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
718 WIN_BOX_COLOR dm_velobar_top+.52, dm_velobar_top+.58, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
719 DISP_graph_vel_1:
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
720 rcall TFT_standard_color_dive ; Color -> WREG
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
721 WIN_BOX_COLOR dm_velobar_top+.62, dm_velobar_top+.68, dm_velobar_lft+.2, dm_velobar_rgt-.2 ;top, bottom, left, right
db25f2028074 CHANGE: New segmented speed graph in divemode
heinrichsweikamp
parents: 398
diff changeset
722 DISP_graph_vel_0:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
723 return ; Done.
326
d21b172d5a7a VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents: 321
diff changeset
724
315
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
725 global TFT_velocity_clear
4f83470dcece VSIbar #3: remaining changes for the split style bar
Janos Kovacs <kovjanos@gmail.com>
parents: 310
diff changeset
726 TFT_velocity_clear:
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
727 btfss display_velocity ; Velocity was not displayed, do not delete
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
728 return
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
729 bcf display_velocity ; Velocity was displayed, delete velocity now
0
heinrichsweikamp
parents:
diff changeset
730 ; Clear Text
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
731 WIN_BOX_BLACK dm_velocity_text_row, dm_velocity_text_bot, dm_velocity_text_column, dm_velocity_text_rgt ; top, bottom, left, right
398
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
732
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
733 TSTOSS opt_vsigraph ; =1: draw the graphical VSI bar
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
734 return ; No graph to clear
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
735 TFT_velocity_clear_graph:
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
736 ; Clear Graph
1f2e35f5a5aa BUGFIX: Make sure SP1 is always selected on start in Auto-SP mode
heinrichsweikamp
parents: 394
diff changeset
737 WIN_BOX_BLACK dm_velobar_top, dm_velobar_bot, dm_velobar_lft, dm_velobar_rgt ;top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
738 return
heinrichsweikamp
parents:
diff changeset
739
307
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
740 ;=========================================================================
14719662fb95 Merged Screen layout work #4 into VSItextv2
Janos Kovacs <kovjanos@gmail.com>
parents: 303
diff changeset
741
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
742 global TFT_clear_decoarea
0
heinrichsweikamp
parents:
diff changeset
743 TFT_clear_decoarea:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
744 WIN_BOX_BLACK dm_decostop_1st_stop_row, .239, dm_decostop_1st_stop_column, .159 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
745 return
heinrichsweikamp
parents:
diff changeset
746
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
747
0
heinrichsweikamp
parents:
diff changeset
748 global TFT_clear_divemode_menu
heinrichsweikamp
parents:
diff changeset
749 TFT_clear_divemode_menu:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
750 WIN_BOX_BLACK dm_menu_row, dm_menu_lower, dm_menu_left, dm_menu_right ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
751 return
heinrichsweikamp
parents:
diff changeset
752
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
753
0
heinrichsweikamp
parents:
diff changeset
754 global TFT_display_ndl_mask
heinrichsweikamp
parents:
diff changeset
755 TFT_display_ndl_mask:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
756 bcf FLAG_TFT_display_ndl_mask
0
heinrichsweikamp
parents:
diff changeset
757 btfsc divemode_menu ; Is the dive mode menu shown?
heinrichsweikamp
parents:
diff changeset
758 return ; Yes, return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
759 call TFT_clear_decoarea ; Clear Dekostop and Dekosum
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
760 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
761 WIN_STD dm_ndl_text_column, dm_ndl_text_row
0
heinrichsweikamp
parents:
diff changeset
762 STRCPY_TEXT_PRINT tNDL ; NDL
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
763 bra TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
764
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
765
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
766 global TFT_display_tts
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
767 TFT_display_tts:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
768 bcf FLAG_TFT_display_tts
0
heinrichsweikamp
parents:
diff changeset
769 btfsc divemode_menu ; Is the dive mode menu shown?
heinrichsweikamp
parents:
diff changeset
770 return ; Yes, return
heinrichsweikamp
parents:
diff changeset
771 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
772 movff int_O_ascenttime+0,lo ; TTS
heinrichsweikamp
parents:
diff changeset
773 movff int_O_ascenttime+1,hi ; on 16bits
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
774 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
775 bra TFT_display_tts_1 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
776 bcf hi,int_invalid_flag ; YES - clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
777 call TFT_disabled_color ; switch to disabled color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
778 TFT_display_tts_1:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
779 WIN_MEDIUM dm_tts_value_column, dm_tts_value_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
780 output_16_3 ; Displays only 0...999
0
heinrichsweikamp
parents:
diff changeset
781 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
782 return
heinrichsweikamp
parents:
diff changeset
783
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
784
0
heinrichsweikamp
parents:
diff changeset
785 global TFT_display_ndl
heinrichsweikamp
parents:
diff changeset
786 TFT_display_ndl:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
787 bcf FLAG_TFT_display_ndl
0
heinrichsweikamp
parents:
diff changeset
788 btfsc divemode_menu ; Is the dive mode menu shown?
heinrichsweikamp
parents:
diff changeset
789 return ; Yes, return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
790 WIN_MEDIUM dm_ndl_value_column, dm_ndl_value_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
791 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
792 movff char_O_nullzeit,lo ; Get NDL from C-code
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
793 output_8
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
794 STRCAT_PRINT "'"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
795 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
796
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
797
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
798 global TFT_big_deco_alt ; The big deco
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
799 TFT_big_deco_alt:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
800 bcf FLAG_TFT_big_deco_alt
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
801
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
802 btfss decostop_active ; deco?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
803 bra TFT_big_deco_ndl_alt ; NDL
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
804
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
805 ; Deco
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
806 bcf FLAG_TFT_display_deko
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
807 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
808 WIN_STD .70,.165
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
809 STRCPY_TEXT_PRINT tTTS ; TTS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
810 rcall TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
811
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
812 ; TTS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
813 WIN_LARGE .97,.170
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
814 movff int_O_ascenttime+0,lo ; TTS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
815 movff int_O_ascenttime+1,hi ; on 16bits
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
816 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
817 bra TFT_display_tts_alt_1 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
818 bcf hi,int_invalid_flag ; YES - clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
819 call TFT_disabled_color ; switch to disabled color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
820 TFT_display_tts_alt_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
821 output_16_3 ; Displays only 0...999
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
822 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
823
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
824 ; 1st Stop
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
825 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
826 WIN_STD .25,dm_customview_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
827 STRCPY_TEXT_PRINT tDiveSafetyStop ; "Stop"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
828
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
829 WIN_LARGE .60,.95
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
830 TFT_color_code warn_stop ; Color-code Output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
831 movff char_O_first_deco_depth,lo ; stop depth in m
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
832 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
833 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
834
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
835 ; m or ft after the stop depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
836 WIN_MEDIUM .100,.118
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
837 TSTOSS opt_units ; 0=m, 1=ft
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
838 bra TFT_display_tts_alt_1_metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
839 STRCAT_TEXT_PRINT tFeets1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
840 bra TFT_display_tts_alt_1_com
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
841 TFT_display_tts_alt_1_metric:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
842 STRCAT_TEXT_PRINT tMeters
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
843 TFT_display_tts_alt_1_com:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
844 WIN_LARGE .117,.95
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
845 movff char_O_first_deco_time,lo ; length of first stop in min
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
846 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
847 output_99
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
848 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
849 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
850
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
851 TFT_big_deco_ndl_alt:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
852 ; NDL
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
853 bcf FLAG_TFT_display_ndl
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
854 bcf decostop_active ; clear flag (again)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
855 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
856 WIN_STD .70,.165
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
857 STRCPY_TEXT_PRINT tNDL ; NDL
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
858 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
859 WIN_LARGE .97,.170
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
860 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
861 movff char_O_nullzeit,lo ; Get NDL from C-code
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
862 output_8
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
863 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
864
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
865 btfsc FLAG_TFT_show_safety_stop
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
866 bra TFT_show_safety_stop_alt ; Show safety stop (And return)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
867 ; Clear any safety stop or Decostop
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
868 TFT_no_more_safety_stop_alt:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
869 WIN_BOX_BLACK dm_customview_row, .150, .0, .159 ; top, bottom, left, right
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
870 WIN_BOX_BLACK dm_customview_row, .164, .60, .159 ; top, bottom, left, right
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
871 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
872
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
873 TFT_show_safety_stop_alt:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
874 bcf FLAG_TFT_show_safety_stop
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
875 tstfsz safety_stop_countdown ; Countdown at zero?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
876 bra TFT_show_safety_stop_alt2 ; No, show stop
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
877 bcf show_safety_stop ; Clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
878 btfss safety_stop_active ; Displayed?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
879 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
880 bcf safety_stop_active ; Clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
881 bra TFT_no_more_safety_stop_alt ; Yes, Clear stop ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
882
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
883 TFT_show_safety_stop_alt2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
884 bsf safety_stop_active ; Set flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
885 decf safety_stop_countdown,F ; Reduce countdown
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
886
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
887 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
888 WIN_STD .50,dm_customview_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
889 STRCPY_TEXT_PRINT tDiveSafetyStop
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
890 call TFT_attention_color ; show in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
891 WIN_LARGE .90,.95
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
892 movff safety_stop_countdown,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
893 clrf hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
894 call convert_time ; converts hi:lo in seconds to mins (hi) and seconds (lo)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
895 movf hi,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
896 movff lo,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
897 movwf lo ; exchange lo and hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
898 bsf leftbind
0
heinrichsweikamp
parents:
diff changeset
899 output_8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
900 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
901 WIN_MEDIUM .112,.120
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
902 STRCAT_PRINT ":"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
903 WIN_LARGE .117,.95
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
904 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
905 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
906 output_99x
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
907 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
908 WIN_FONT FT_SMALL
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
909 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
910
0
heinrichsweikamp
parents:
diff changeset
911
heinrichsweikamp
parents:
diff changeset
912 global TFT_divemode_warning
heinrichsweikamp
parents:
diff changeset
913 TFT_divemode_warning:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
914 bcf FLAG_TFT_divemode_warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
915 bsf dive_warning_displayed ; =1: The warning sign is shown
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
916 WIN_TOP dm_warning_icon_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
917 WIN_LEFT dm_warning_icon_column
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
918 TFT_WRITE_PROM_IMAGE dive_warning2_block ; Show Warning icon
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
919 return
0
heinrichsweikamp
parents:
diff changeset
920
heinrichsweikamp
parents:
diff changeset
921 global TFT_divemode_warning_clear
heinrichsweikamp
parents:
diff changeset
922 TFT_divemode_warning_clear:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
923 bcf FLAG_TFT_divemode_warning_clear
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
924 btfss dive_warning_displayed ; =1: The warning sign is shown
0
heinrichsweikamp
parents:
diff changeset
925 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
926 bcf dive_warning_displayed ; clear only once
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
927 WIN_BOX_BLACK dm_warning_icon_row, dm_warning_icon_bot, dm_warning_icon_column, dm_warning_icon_rgt ; top, bottom, left, right
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
928 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
929
0
heinrichsweikamp
parents:
diff changeset
930
heinrichsweikamp
parents:
diff changeset
931 global TFT_display_deko_mask
heinrichsweikamp
parents:
diff changeset
932 TFT_display_deko_mask:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
933 bcf FLAG_TFT_display_deko_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
934 btfsc divemode_menu ; Is the dive mode menu shown?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
935 return ; Yes, return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
936 rcall TFT_clear_decoarea ; Clear Dekostop and Dekosum (and NDL in this case)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
937 WIN_STD dm_tts_text_column, dm_tts_text_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
938 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
939 STRCPY_TEXT_PRINT tTTS ; TTS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
940 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
941 bcf show_safety_stop ; Clear safety stop flag
0
heinrichsweikamp
parents:
diff changeset
942 return
heinrichsweikamp
parents:
diff changeset
943
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
944
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
945 TFT_display_deko_output_depth: ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (for ft)
0
heinrichsweikamp
parents:
diff changeset
946 TSTOSS opt_units ; 0=m, 1=ft
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
947 bra TFT_display_deko_output_metric
0
heinrichsweikamp
parents:
diff changeset
948 ;TFT_display_deko_output_imperial:
heinrichsweikamp
parents:
diff changeset
949 movf lo,W ; lo = m
heinrichsweikamp
parents:
diff changeset
950 mullw .100 ; PRODL:PRODH = mbar
heinrichsweikamp
parents:
diff changeset
951 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
952 movff PRODH,hi
heinrichsweikamp
parents:
diff changeset
953 ; Convert with 334feet/100m to have 10ft, 20ft, 30ft stops...
heinrichsweikamp
parents:
diff changeset
954 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
955 movff hi,xA+1
heinrichsweikamp
parents:
diff changeset
956 movlw LOW d'334' ; 334feet/100m
heinrichsweikamp
parents:
diff changeset
957 movwf xB+0
heinrichsweikamp
parents:
diff changeset
958 movlw HIGH d'334'
heinrichsweikamp
parents:
diff changeset
959 movwf xB+1
heinrichsweikamp
parents:
diff changeset
960 call mult16x16 ; xA*xB=xC (lo:hi * 328)
heinrichsweikamp
parents:
diff changeset
961 movlw d'50' ; round up
heinrichsweikamp
parents:
diff changeset
962 addwf xC+0,F
heinrichsweikamp
parents:
diff changeset
963 movlw 0
heinrichsweikamp
parents:
diff changeset
964 addwfc xC+1,F
heinrichsweikamp
parents:
diff changeset
965 addwfc xC+2,F
heinrichsweikamp
parents:
diff changeset
966 addwfc xC+3,F
heinrichsweikamp
parents:
diff changeset
967 movlw d'100'
heinrichsweikamp
parents:
diff changeset
968 movwf xB+0
heinrichsweikamp
parents:
diff changeset
969 clrf xB+1
heinrichsweikamp
parents:
diff changeset
970 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
heinrichsweikamp
parents:
diff changeset
971 movff xC+0,lo
heinrichsweikamp
parents:
diff changeset
972 movff xC+1,hi ; restore lo and hi with updated value
heinrichsweikamp
parents:
diff changeset
973 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
974 btfsc alternative_divelayout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
975 bsf leftbind ; left for alternative layout mode
0
heinrichsweikamp
parents:
diff changeset
976 bsf ignore_digit4 ; Only full feet
heinrichsweikamp
parents:
diff changeset
977 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
978 btfsc alternative_divelayout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
979 return ; Not for alternative layout mode
0
heinrichsweikamp
parents:
diff changeset
980 STRCAT_TEXT tFeets1
heinrichsweikamp
parents:
diff changeset
981 return
heinrichsweikamp
parents:
diff changeset
982
heinrichsweikamp
parents:
diff changeset
983 TFT_display_deko_output_metric:
heinrichsweikamp
parents:
diff changeset
984 output_99
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
985 btfsc alternative_divelayout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
986 return ; Not for alternative layout mode
0
heinrichsweikamp
parents:
diff changeset
987 STRCAT_TEXT tMeters
heinrichsweikamp
parents:
diff changeset
988 PUTC ' '
heinrichsweikamp
parents:
diff changeset
989 return
heinrichsweikamp
parents:
diff changeset
990
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
991
0
heinrichsweikamp
parents:
diff changeset
992 global TFT_display_deko
heinrichsweikamp
parents:
diff changeset
993 TFT_display_deko:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
994 bcf FLAG_TFT_display_deko
0
heinrichsweikamp
parents:
diff changeset
995 btfsc divemode_menu ; Is the dive mode menu shown?
heinrichsweikamp
parents:
diff changeset
996 return ; Yes, return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
997 WIN_MEDIUM dm_decostop_1st_stop_column, dm_decostop_1st_stop_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
998 TFT_color_code warn_stop ; Color-code Output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
999 movff char_O_first_deco_depth,lo ; stop depth in m
0
heinrichsweikamp
parents:
diff changeset
1000 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
heinrichsweikamp
parents:
diff changeset
1001 movff char_O_first_deco_time,lo ; length of first stop in min
heinrichsweikamp
parents:
diff changeset
1002 output_99
heinrichsweikamp
parents:
diff changeset
1003 STRCAT_PRINT "'"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1004 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1005
0
heinrichsweikamp
parents:
diff changeset
1006
heinrichsweikamp
parents:
diff changeset
1007 global TFT_decoplan
heinrichsweikamp
parents:
diff changeset
1008 TFT_decoplan:
heinrichsweikamp
parents:
diff changeset
1009 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1010 WIN_TINY dm_custom_decoplan_title_column, dm_custom_decoplan_title_row
0
heinrichsweikamp
parents:
diff changeset
1011 STRCPY_TEXT_PRINT tDiveDecoplan
526
0d1cda9f2d43 BUGFIX: Skip MOD Test for CCR in Sensor modes (OSTC cR and OSTC3 only)
heinrichsweikamp
parents: 517
diff changeset
1012 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1013 movff char_O_deco_depth+1,lo
heinrichsweikamp
parents:
diff changeset
1014 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1015 bra TFT_display_deko2 ; Yes
heinrichsweikamp
parents:
diff changeset
1016 ; No, clear output and return
heinrichsweikamp
parents:
diff changeset
1017 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1018 WIN_SMALL dm_cust_dstop_4th_stop_column,dm_cust_dstop_4th_stop_row
97
53a99a2dc6a1 CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents: 96
diff changeset
1019 STRCPY_PRINT " --- "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1020 WIN_BOX_BLACK dm_cust_dstop_2nd_stop_row, dm_customview_bot-.2, dm_cust_dstop_2nd_stop_column, dm_cust_dstop_4th_stop_column ; top, bottom, left, right
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1021 WIN_BOX_BLACK dm_cust_dstop_5th_stop_row, dm_customview_bot, dm_cust_dstop_5th_stop_column, dm_cust_dstop_6th_stop_column ; top, bottom, left, right
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1022 WIN_BOX_BLACK dm_cust_dstop_6th_stop_row, dm_customview_bot, dm_cust_dstop_6th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1023 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1024
0
heinrichsweikamp
parents:
diff changeset
1025 TFT_display_deko2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1026 movff char_O_deco_gas+0,lo ; get flag for invalid deco data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1027 btfsc lo,char_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1028 call TFT_disabled_color ; YES - set to disabled color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1029 WIN_SMALL dm_cust_dstop_2nd_stop_column, dm_cust_dstop_2nd_stop_row
0
heinrichsweikamp
parents:
diff changeset
1030 movff char_O_deco_depth+1,lo ; stop in m
heinrichsweikamp
parents:
diff changeset
1031 bcf lo,7 ; Clear GAS_SWITCH bit
heinrichsweikamp
parents:
diff changeset
1032 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
heinrichsweikamp
parents:
diff changeset
1033 movff char_O_deco_time+1,lo ; length of stop in min
heinrichsweikamp
parents:
diff changeset
1034 output_99
heinrichsweikamp
parents:
diff changeset
1035 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1036 movff char_O_deco_depth+2,lo
heinrichsweikamp
parents:
diff changeset
1037 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1038 bra TFT_display_deko3 ; Yes
heinrichsweikamp
parents:
diff changeset
1039 ; No, clear output and return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1040 WIN_BOX_BLACK dm_cust_dstop_3rd_stop_row, dm_customview_bot-.2, dm_cust_dstop_2nd_stop_column, dm_cust_dstop_4th_stop_column ; top, bottom, left, right
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1041 WIN_BOX_BLACK dm_cust_dstop_4th_stop_row, dm_customview_bot, dm_cust_dstop_4th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1042 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
1043
heinrichsweikamp
parents:
diff changeset
1044 TFT_display_deko3:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1045 WIN_SMALL dm_cust_dstop_3rd_stop_column, dm_cust_dstop_3rd_stop_row
0
heinrichsweikamp
parents:
diff changeset
1046 movff char_O_deco_depth+2,lo ; stop in m
heinrichsweikamp
parents:
diff changeset
1047 bcf lo,7 ; Clear GAS_SWITCH bit
heinrichsweikamp
parents:
diff changeset
1048 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
heinrichsweikamp
parents:
diff changeset
1049 movff char_O_deco_time+2,lo ; length of stop in min
heinrichsweikamp
parents:
diff changeset
1050 output_99
heinrichsweikamp
parents:
diff changeset
1051 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1052 movff char_O_deco_depth+3,lo
heinrichsweikamp
parents:
diff changeset
1053 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1054 bra TFT_display_deko4 ; Yes
heinrichsweikamp
parents:
diff changeset
1055 ; No, clear output and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1056 WIN_BOX_BLACK dm_cust_dstop_4th_stop_row, dm_customview_bot, dm_cust_dstop_4th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1057 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
1058
heinrichsweikamp
parents:
diff changeset
1059 TFT_display_deko4:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1060 WIN_SMALL dm_cust_dstop_4th_stop_column, dm_cust_dstop_4th_stop_row
0
heinrichsweikamp
parents:
diff changeset
1061 movff char_O_deco_depth+3,lo ; stop in m
heinrichsweikamp
parents:
diff changeset
1062 bcf lo,7 ; Clear GAS_SWITCH bit
heinrichsweikamp
parents:
diff changeset
1063 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
heinrichsweikamp
parents:
diff changeset
1064 movff char_O_deco_time+3,lo ; length of stop in min
heinrichsweikamp
parents:
diff changeset
1065 output_99
heinrichsweikamp
parents:
diff changeset
1066 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1067
heinrichsweikamp
parents:
diff changeset
1068 movff char_O_deco_depth+4,lo
heinrichsweikamp
parents:
diff changeset
1069 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1070 bra TFT_display_deko5 ; Yes
heinrichsweikamp
parents:
diff changeset
1071 ; No, clear output and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1072 WIN_BOX_BLACK dm_cust_dstop_5th_stop_row, dm_customview_bot, dm_cust_dstop_5th_stop_column, dm_cust_dstop_6th_stop_column ; top, bottom, left, right
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1073 WIN_BOX_BLACK dm_cust_dstop_6th_stop_row, dm_customview_bot, dm_cust_dstop_6th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1074 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
1075
heinrichsweikamp
parents:
diff changeset
1076 TFT_display_deko5:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1077 WIN_SMALL dm_cust_dstop_5th_stop_column, dm_cust_dstop_5th_stop_row
0
heinrichsweikamp
parents:
diff changeset
1078 movff char_O_deco_depth+4,lo ; stop in m
heinrichsweikamp
parents:
diff changeset
1079 bcf lo,7 ; Clear GAS_SWITCH bit
heinrichsweikamp
parents:
diff changeset
1080 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
heinrichsweikamp
parents:
diff changeset
1081 movff char_O_deco_time+4,lo ; length of stop in min
heinrichsweikamp
parents:
diff changeset
1082 output_99
heinrichsweikamp
parents:
diff changeset
1083 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1084 movff char_O_deco_depth+5,lo
heinrichsweikamp
parents:
diff changeset
1085 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1086 bra TFT_display_deko6 ; Yes
heinrichsweikamp
parents:
diff changeset
1087 ; No, clear output and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1088 WIN_BOX_BLACK dm_cust_dstop_6th_stop_row, dm_customview_bot, dm_cust_dstop_6th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1089 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1090
0
heinrichsweikamp
parents:
diff changeset
1091 TFT_display_deko6:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1092 WIN_SMALL dm_cust_dstop_6th_stop_column, dm_cust_dstop_6th_stop_row
0
heinrichsweikamp
parents:
diff changeset
1093 movff char_O_deco_depth+5,lo ; stop in m
heinrichsweikamp
parents:
diff changeset
1094 bcf lo,7 ; Clear GAS_SWITCH bit
heinrichsweikamp
parents:
diff changeset
1095 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
heinrichsweikamp
parents:
diff changeset
1096 movff char_O_deco_time+5,lo ; length of stop in min
heinrichsweikamp
parents:
diff changeset
1097 output_99
heinrichsweikamp
parents:
diff changeset
1098 STRCAT_PRINT "'"
heinrichsweikamp
parents:
diff changeset
1099 movff char_O_deco_depth+6,lo
heinrichsweikamp
parents:
diff changeset
1100 tstfsz lo ; Show another stop?
heinrichsweikamp
parents:
diff changeset
1101 bra TFT_display_deko7 ; Yes
heinrichsweikamp
parents:
diff changeset
1102 ; No, clear output and return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1103 WIN_BOX_BLACK dm_cust_dstop_7th_stop_row, dm_customview_bot, dm_cust_dstop_7th_stop_column, .159 ; top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1104 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1105
0
heinrichsweikamp
parents:
diff changeset
1106 TFT_display_deko7:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1107 WIN_SMALL dm_cust_dstop_7th_stop_column, dm_cust_dstop_7th_stop_row
0
heinrichsweikamp
parents:
diff changeset
1108 movff char_O_deco_depth+6,lo ; stop in m
heinrichsweikamp
parents:
diff changeset
1109 bcf lo,7 ; Clear GAS_SWITCH bit
heinrichsweikamp
parents:
diff changeset
1110 rcall TFT_display_deko_output_depth ; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
heinrichsweikamp
parents:
diff changeset
1111 movff char_O_deco_time+6,lo ; length of stop in min
heinrichsweikamp
parents:
diff changeset
1112 output_99
heinrichsweikamp
parents:
diff changeset
1113 STRCAT_PRINT "'"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1114 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1115
0
heinrichsweikamp
parents:
diff changeset
1116
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1117 global TFT_clear_safety_stop
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1118 TFT_clear_safety_stop:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1119 bcf FLAG_TFT_clear_safety_stop ; clear flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1120 WIN_BOX_BLACK dm_safetystop_row, dm_safetystop_bot, dm_safetystop_text_column, .159 ; top, bottom, left, right
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1121 return
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1122
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1123 global TFT_show_safety_stop
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1124 TFT_show_safety_stop:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1125 bcf FLAG_TFT_show_safety_stop
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1126 tstfsz safety_stop_countdown ; Countdown at zero?
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1127 bra TFT_show_safety_stop2 ; No, show stop
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1128 bcf show_safety_stop ; Clear flag
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1129 btfss safety_stop_active ; Displayed?
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1130 return ; No
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1131 bcf safety_stop_active ; Clear flag
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1132 btfsc divemode_menu ; Is the dive mode menu shown?
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1133 return ; Yes, return
428
eccae727702f some cleanup
heinrichsweikamp
parents: 413
diff changeset
1134 bra TFT_clear_safety_stop ; Yes, Clear stop ; and return...
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1135 TFT_show_safety_stop2:
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1136 bsf safety_stop_active ; Set flag
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1137 decf safety_stop_countdown,F ; Reduce countdown
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1138 btfsc divemode_menu ; Is the dive mode menu shown?
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1139 return ; Yes, return
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1140 ;btfsc menuview
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1141 ;bra TFT_show_safety_stop3 ; No room when menuview=1...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1142 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1143 WIN_STD dm_safetystop_text_column, dm_safetystop_text_row
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1144 STRCPY_TEXT_PRINT tDiveSafetyStop
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1145 TFT_show_safety_stop3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1146 call TFT_attention_color ; show in yellow
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1147 WIN_MEDIUM dm_safetystop_column, dm_safetystop_row
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1148 movff safety_stop_countdown,lo
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1149 clrf hi
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1150 call convert_time ; converts hi:lo in seconds to mins (hi) and seconds (lo)
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1151 movf hi,W
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1152 movff lo,hi
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1153 movwf lo ; exchange lo and hi
131
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1154 bsf leftbind
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1155 output_8
35b9da423de6 NEW: Update warnings every second
heinrichsweikamp
parents: 130
diff changeset
1156 bcf leftbind
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1157 PUTC ':'
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1158 movff hi,lo
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1159 output_99x
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1160 STRCAT_PRINT ""
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 102
diff changeset
1161 WIN_FONT FT_SMALL
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1162 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1163
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1164
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1165 global TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch
0
heinrichsweikamp
parents:
diff changeset
1166 TFT_mask_avr_stopwatch:
heinrichsweikamp
parents:
diff changeset
1167 ; The mask
heinrichsweikamp
parents:
diff changeset
1168 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1169 WIN_TINY dm_custom_avr_stop_title_column1,dm_custom_avr_stop_title_row
437
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1170 STRCPY_TEXT_PRINT tDiveTotalAvg
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1171 WIN_TINY dm_custom_avr_stop_title_column2,dm_custom_avr_stop_title_row
0
heinrichsweikamp
parents:
diff changeset
1172 STRCPY_TEXT_PRINT tDiveStopwatch
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1173 WIN_TINY dm_custom_avr_stop_title_column3,dm_custom_avr_stop_title_row
437
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1174 STRCPY_TEXT_PRINT tDiveStopAvg
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1175 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1176
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1177 global TFT_update_avr_stopwatch ; Update average depth and stopwatch
0
heinrichsweikamp
parents:
diff changeset
1178 TFT_update_avr_stopwatch:
heinrichsweikamp
parents:
diff changeset
1179 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
1180 SAFE_2BYTE_COPY average_divesecs,lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1181 call convert_time ; lo=secs, hi=mins
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1182 WIN_MEDIUM dm_custom_avr_stop_column2,dm_custom_avr_stop_row
0
heinrichsweikamp
parents:
diff changeset
1183 bsf leftbind
heinrichsweikamp
parents:
diff changeset
1184 movf hi,W
heinrichsweikamp
parents:
diff changeset
1185 movff lo,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1186 movwf lo ; exchange lo and hi
0
heinrichsweikamp
parents:
diff changeset
1187 output_8
heinrichsweikamp
parents:
diff changeset
1188 PUTC ':'
heinrichsweikamp
parents:
diff changeset
1189 movff hi,lo
heinrichsweikamp
parents:
diff changeset
1190 output_99x
heinrichsweikamp
parents:
diff changeset
1191 movlw .5
heinrichsweikamp
parents:
diff changeset
1192 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
heinrichsweikamp
parents:
diff changeset
1193 clrf WREG
heinrichsweikamp
parents:
diff changeset
1194 movff WREG,buffer+.5 ; limit to 5 chars
heinrichsweikamp
parents:
diff changeset
1195 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
1196
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1197 TSTOSS opt_units ; 0=m, 1=ft
0
heinrichsweikamp
parents:
diff changeset
1198 bra TFT_update_avr_stopwatch_metric
heinrichsweikamp
parents:
diff changeset
1199 ;TFT_update_avr_stopwatch_imperial
437
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1200 movff avg_rel_pressure_total+0,lo
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1201 movff avg_rel_pressure_total+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1202 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
0
heinrichsweikamp
parents:
diff changeset
1203 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1204 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
0
heinrichsweikamp
parents:
diff changeset
1205 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1206 output_16 ; yxz
0
heinrichsweikamp
parents:
diff changeset
1207 STRCAT_PRINT " "
heinrichsweikamp
parents:
diff changeset
1208 ; Stopped average depth
437
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1209 movff avg_rel_pressure+0,lo
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1210 movff avg_rel_pressure+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1211 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
0
heinrichsweikamp
parents:
diff changeset
1212 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1213 WIN_MEDIUM dm_custom_avr_stop_column3,dm_custom_avr_stop_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1214 output_16 ; yxz
0
heinrichsweikamp
parents:
diff changeset
1215 bcf leftbind
465
025a0ce21f8b BUGFIX: Minor layout corrections in imperial units dive screen
heinrichsweikamp
parents: 458
diff changeset
1216 PUTC " "
025a0ce21f8b BUGFIX: Minor layout corrections in imperial units dive screen
heinrichsweikamp
parents: 458
diff changeset
1217 clrf WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1218 movff WREG,buffer+.3 ; limit string length to 3
465
025a0ce21f8b BUGFIX: Minor layout corrections in imperial units dive screen
heinrichsweikamp
parents: 458
diff changeset
1219 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
1220 return
heinrichsweikamp
parents:
diff changeset
1221
heinrichsweikamp
parents:
diff changeset
1222 TFT_update_avr_stopwatch_metric:
heinrichsweikamp
parents:
diff changeset
1223 ; Non-resettable average depth
437
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1224 movff avg_rel_pressure_total+0,lo
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1225 movff avg_rel_pressure_total+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1226 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1227 WIN_MEDIUM dm_custom_avr_stop_column1,dm_custom_avr_stop_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1228 bsf ignore_digit5 ; no cm
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1229 output_16dp .3 ; yxz.a
231
834e1c35160c BUGFIX: Show average depth with one decimal digit only
mh@mh-THINK
parents: 229
diff changeset
1230 STRCAT_PRINT " "
0
heinrichsweikamp
parents:
diff changeset
1231 ; Stopped average depth
437
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1232 movff avg_rel_pressure+0,lo
23b58c4bc6aa CHANGE: Language fixes, 2.08 release
heinrichsweikamp
parents: 432
diff changeset
1233 movff avg_rel_pressure+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1234 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1235 WIN_MEDIUM dm_custom_avr_stop_column3,dm_custom_avr_stop_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1236 bsf ignore_digit5 ; no cm
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1237 output_16dp .3 ; yxz.a
0
heinrichsweikamp
parents:
diff changeset
1238 bcf leftbind
heinrichsweikamp
parents:
diff changeset
1239 bcf ignore_digit5
369
ca32cf2435c6 fixing some layout issues
heinrichsweikamp
parents: 353
diff changeset
1240 clrf WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1241 movff WREG,buffer+.4 ; limit string length to 4
369
ca32cf2435c6 fixing some layout issues
heinrichsweikamp
parents: 353
diff changeset
1242 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
1243 return
heinrichsweikamp
parents:
diff changeset
1244
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1245
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1246 global TFT_ceiling_mask ; The ceiling mask
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1247 TFT_ceiling_mask:
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1248 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1249 WIN_TINY dm_custom_ceiling_text_column,dm_custom_ceiling_text_row
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1250 STRCPY_TEXT_PRINT tCeiling
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1251 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1252
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1253 global TFT_ceiling ; Ceiling
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1254 TFT_ceiling:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1255 WIN_MEDIUM dm_custom_ceiling_value_column,dm_custom_ceiling_value_row
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1256 movff int_O_ceiling+0,lo
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1257 movff int_O_ceiling+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1258 TFT_color_code warn_ceiling ; color-code the output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1259 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1260 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1261 TSTOSS opt_units ; 0=m, 1=ft
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1262 bra TFT_ceiling_metric
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1263 ;TFT_ceiling_imperial
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1264 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1265 output_16 ; yxz
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1266 bcf leftbind
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1267 STRCAT_PRINT " "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1268 goto TFT_standard_color
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1269
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1270 TFT_ceiling_metric:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1271 bsf ignore_digit5 ; no cm
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1272 output_16dp .3 ; yxz.a
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1273 bcf leftbind
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1274 bcf ignore_digit5
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1275 STRCAT_PRINT " "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1276 goto TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1277
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1278
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1279 global TFT_CNS_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1280 TFT_CNS_mask:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1281 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1282 WIN_TINY dm_custom_gf_title_col1, dm_custom_gf_title_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1283 STRCPY_TEXT_PRINT tCNSsurf
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1284 WIN_TINY dm_custom_gf_title_col2, dm_custom_gf_title_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1285 btfsc FLAG_ccr_mode ; in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1286 bra TFT_CNS_mask_1 ; YES - proceed with checking for bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1287 btfsc FLAG_pscr_mode ; NO - in pSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1288 bra TFT_CNS_mask_1 ; YES - proceed with checking for bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1289 bra TFT_CNS_mask_2 ; NO - must be OC then
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1290 TFT_CNS_mask_1: ; in CCR or pSCR mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1291 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1292 bra TFT_CNS_mask_2 ; YES - print fTTS label (label will be printed, but a fTTS will actually not be calculated)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1293 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1294 bra TFT_CNS_mask_2 ; NO - print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1295 STRCPY_TEXT_PRINT tCNSBO ; YES - print bailout label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1296 bra TFT_CNS_mask_3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1297 TFT_CNS_mask_2: ; OC or bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1298 STRCPY_TEXT_PRINT tCNSfTTS ; print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1299 TFT_CNS_mask_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1300 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1301 STRCPY_TEXT_PRINT tCNSnow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1302 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1303
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1304 global TFT_CNS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1305 TFT_CNS:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1306 ; CNS at end of normal dive
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1307 WIN_STD dm_custom_hud_sensor1_column+.5,dm_custom_hud_data_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1308 movff int_O_normal_CNS_fraction+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1309 movff int_O_normal_CNS_fraction+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1310 TFT_color_code warn_cns
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1311 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1312 output_16_3 ; output as xxx
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1313 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1314 STRCAT_PRINT "% "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1315 ; fTTS / Bailout CNS, if enabled
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1316 WIN_STD dm_custom_hud_sensor2_column+.2,dm_custom_hud_data_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1317 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1318 bra TFT_CNS_3 ; YES - show "---"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1319 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1320 bra TFT_CNS_1 ; NO - continue checking fTTS extra time
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1321 btfsc FLAG_ccr_mode ; YES - in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1322 bra TFT_CNS_2 ; YES - skip test for fTTS extra time and show CNS%
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1323 btfsc FLAG_pscr_mode ; in pSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1324 bra TFT_CNS_2 ; YES - skip test for fTTS extra time and show CNS%
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1325 TFT_CNS_1: ; not in bailout, no volume calculation
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1326 TSTOSS char_I_extra_time ; fTTS extra time fTTS configured?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1327 bra TFT_CNS_3 ; NO - show "---"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1328 TFT_CNS_2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1329 movff int_O_alternate_CNS_fraction+0,lo ; YES - show CNS%
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1330 movff int_O_alternate_CNS_fraction+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1331 TFT_color_code warn_cns
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1332 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1333 output_16_3 ; output as xxx
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1334 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1335 STRCAT_PRINT "% "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1336 bra TFT_CNS_4
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1337 TFT_CNS_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1338 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1339 STRCPY_PRINT "--- "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1340 TFT_CNS_4:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1341 ; current CNS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1342 WIN_STD dm_custom_hud_sensor3_column,dm_custom_hud_data_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1343 movff int_O_CNS_fraction+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1344 movff int_O_CNS_fraction+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1345 TFT_color_code warn_cns
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1346 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1347 output_16_3 ; output as xxx
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1348 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1349 STRCAT_PRINT "%"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1350 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1351 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1352
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1353
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1354 global TFT_hud_mask ; The HUD mask
0
heinrichsweikamp
parents:
diff changeset
1355 TFT_hud_mask:
heinrichsweikamp
parents:
diff changeset
1356 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1357 WIN_TINY dm_custom_hud_column1,dm_custom_hud_row
0
heinrichsweikamp
parents:
diff changeset
1358 STRCPY_TEXT_PRINT tDiveHudMask1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1359 WIN_TINY dm_custom_hud_column2,dm_custom_hud_row
0
heinrichsweikamp
parents:
diff changeset
1360 STRCPY_TEXT_PRINT tDiveHudMask2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1361 WIN_TINY dm_custom_hud_column3,dm_custom_hud_row
0
heinrichsweikamp
parents:
diff changeset
1362 STRCPY_TEXT_PRINT tDiveHudMask3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1363 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1364
102
37275e0fa7f5 NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents: 99
diff changeset
1365
192
efe70488a04b voting logic for external monitoring
heinrichsweikamp
parents: 191
diff changeset
1366 global TFT_update_ppo2_sensors ; Update Sensor data
efe70488a04b voting logic for external monitoring
heinrichsweikamp
parents: 191
diff changeset
1367 TFT_update_ppo2_sensors:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1368 ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1369 ; Definition of the output:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1370 ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1371 ; sensorX use voting o2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1372 ; _calibrated _O2 _logic _ppo2 Output Color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1373 ; _ok _sensorX _sensorX _sensorX
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1374 ;-----------------------------------------------------------------------------------------------
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1375 ; 0 -/- -/- -/- "----" TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1376 ; 1 0 -/- = 0 o2_ppo2_sensorX TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1377 ; 1 0 -/- > 0 o2_ppo2_sensorX TFT_disabled_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1378 ; 1 1 0 -/- o2_ppo2_sensorX TFT_color_code warn_ppo2_hud + win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1379 ; 1 1 1 -/- o2_ppo2_sensorX TFT_color_code warn_ppo2_hud
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1380 ;
0
heinrichsweikamp
parents:
diff changeset
1381 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1382 ; sensor 1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1383 btfsc sensor1_calibrated_ok ; valid calibration?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1384 bra TFT_update_hud1b ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1385 ; no valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1386 WIN_STD dm_custom_hud_sensor1_column+.7, dm_custom_hud_data_row+.5
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1387 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1388 STRCPY_PRINT "---"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1389 bra TFT_update_hud2a ; continue with sensor 2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1390 TFT_update_hud1b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1391 ; sensor has a valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1392 WIN_MEDIUM dm_custom_hud_sensor1_column,dm_custom_hud_data_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1393 movff o2_ppo2_sensor1,lo ; load ppO2 value into transfer storage for output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1394 clrf hi ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1395 btfsc use_O2_sensor1 ; in use?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1396 bra TFT_update_hud1d ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1397 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1398 tstfsz o2_ppo2_sensor1 ; sensor value = 0?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1399 bra TFT_update_hud1c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1400 ; valid calibration, not in use and value = 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1401 call TFT_attention_color ; output in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1402 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1403 TFT_update_hud1c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1404 ; sensor has valid calibration, is not in use and has a value > 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1405 call TFT_disabled_color ; output in light blue
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1406 bra TFT_update_hud1e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1407 TFT_update_hud1d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1408 ; sensor has valid calibration and is in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1409 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1410 btfsc voting_logic_sensor1 ; sensor value agrees with other sensor's values?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1411 bra TFT_update_hud1e ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1412 ; valid calibration, in use, but value does not agree with other sensors
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1413 bsf win_invert ; invert output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1414 TFT_update_hud1e:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1415 ; all coloring is set up now, let's write the value to the display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1416 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1417 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1418 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
1419 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1420 bcf win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1421
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1422 TFT_update_hud2a: ; sensor 2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1423 btfsc sensor2_calibrated_ok ; valid calibration?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1424 bra TFT_update_hud2b ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1425 ; no valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1426 WIN_STD dm_custom_hud_sensor2_column+.7, dm_custom_hud_data_row+.5
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1427 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1428 STRCPY_PRINT "---"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1429 bra TFT_update_hud3a ; continue with sensor 3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1430 TFT_update_hud2b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1431 ; sensor has a valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1432 WIN_MEDIUM dm_custom_hud_sensor2_column,dm_custom_hud_data_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1433 movff o2_ppo2_sensor2,lo ; load ppO2 value into transfer storage for output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1434 clrf hi ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1435 btfsc use_O2_sensor2 ; in use?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1436 bra TFT_update_hud2d ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1437 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1438 tstfsz o2_ppo2_sensor2 ; sensor value = 0?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1439 bra TFT_update_hud2c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1440 ; valid calibration, not in use and value = 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1441 call TFT_attention_color ; output in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1442 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1443 TFT_update_hud2c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1444 ; sensor has valid calibration, is not in use and has a value > 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1445 call TFT_disabled_color ; output in light blue
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1446 bra TFT_update_hud2e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1447 TFT_update_hud2d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1448 ; sensor has valid calibration and is in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1449 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1450 btfsc voting_logic_sensor2 ; sensor value agrees with other sensor's vlaues?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1451 bra TFT_update_hud2e ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1452 ; valid calibration, in use, but value does not agree with other sensors
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1453 bsf win_invert ; invert output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1454 TFT_update_hud2e:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1455 ; all coloring is set up now, let's write the value to the display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1456 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1457 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1458 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
1459 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1460 bcf win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1461
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1462 TFT_update_hud3a: ; sensor 3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1463 btfsc sensor3_calibrated_ok ; valid calibration?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1464 bra TFT_update_hud3b ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1465 ; no valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1466 WIN_STD dm_custom_hud_sensor3_column+.7, dm_custom_hud_data_row+.5
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1467 call TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
1468 STRCPY_PRINT "---"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1469 bra TFT_update_hud4 ; done
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1470 TFT_update_hud3b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1471 ; sensor has a valid calibration
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1472 WIN_MEDIUM dm_custom_hud_sensor3_column,dm_custom_hud_data_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1473 movff o2_ppo2_sensor3,lo ; load ppO2 value into transfer storage for output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1474 clrf hi ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1475 btfsc use_O2_sensor3 ; in use?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1476 bra TFT_update_hud3d ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1477 ; valid calibration, but not in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1478 tstfsz o2_ppo2_sensor3 ; sensor value = 0?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1479 bra TFT_update_hud3c ; no
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1480 ; valid calibration, not in use and value = 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1481 call TFT_attention_color ; output in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1482 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1483 TFT_update_hud3c:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1484 ; sensor has valid calibration, is not in use and has a value > 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1485 call TFT_disabled_color ; output in light blue
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1486 bra TFT_update_hud3e
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1487 TFT_update_hud3d:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1488 ; sensor has valid calibration and is in use
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1489 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1490 btfsc voting_logic_sensor3 ; sensor value agrees with other sensor's vlaues?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1491 bra TFT_update_hud3e ; yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1492 ; valid calibration, in use, but value does not agree with other sensors
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1493 bsf win_invert ; invert output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1494 TFT_update_hud3e:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1495 ; all coloring is set up now, let's write the value to the display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1496 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1497 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1498 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
1499 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1500 bcf win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1501
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1502 TFT_update_hud4: ; closure
0
heinrichsweikamp
parents:
diff changeset
1503 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1504 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1505
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1506
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1507 global TFT_surface_sensor ; Update Sensor data in surface mode
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1508 TFT_surface_sensor:
249
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 248
diff changeset
1509 movf hardware_flag,W
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1510 sublw 0x11 ; 2 with BLE
249
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 248
diff changeset
1511 btfsc STATUS,Z
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1512 return ; Ignore for 0x11
0
heinrichsweikamp
parents:
diff changeset
1513 ; show three sensors
heinrichsweikamp
parents:
diff changeset
1514 bsf leftbind
heinrichsweikamp
parents:
diff changeset
1515 WIN_SMALL surf_hud_sensor1_column,surf_hud_sensor1_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1516 btfsc sensor1_calibrated_ok
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1517 bra TFT_surface_sensor1 ; Yes
0
heinrichsweikamp
parents:
diff changeset
1518 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
1519 STRCPY_PRINT "--- "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1520 bra TFT_surface_sensor2 ; Skip Sensor 1
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1521 TFT_surface_sensor1:
192
efe70488a04b voting logic for external monitoring
heinrichsweikamp
parents: 191
diff changeset
1522 movff o2_ppo2_sensor1,lo
0
heinrichsweikamp
parents:
diff changeset
1523 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo
heinrichsweikamp
parents:
diff changeset
1524 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1525 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1526 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1527 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
1528 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1529 TFT_surface_sensor2:
0
heinrichsweikamp
parents:
diff changeset
1530 WIN_SMALL surf_hud_sensor2_column,surf_hud_sensor2_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1531 btfsc sensor2_calibrated_ok
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1532 bra TFT_surface_sensor3 ; Yes
0
heinrichsweikamp
parents:
diff changeset
1533 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
1534 STRCPY_PRINT "--- "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1535 bra TFT_surface_sensor4 ; Skip Sensor 2
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1536 TFT_surface_sensor3:
192
efe70488a04b voting logic for external monitoring
heinrichsweikamp
parents: 191
diff changeset
1537 movff o2_ppo2_sensor2,lo
0
heinrichsweikamp
parents:
diff changeset
1538 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo
heinrichsweikamp
parents:
diff changeset
1539 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1540 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1541 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1542 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
1543 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1544 TFT_surface_sensor4:
0
heinrichsweikamp
parents:
diff changeset
1545 WIN_SMALL surf_hud_sensor3_column,surf_hud_sensor3_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1546 btfsc sensor3_calibrated_ok
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1547 bra TFT_surface_sensor5 ; Yes
0
heinrichsweikamp
parents:
diff changeset
1548 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
1549 STRCPY_PRINT "--- "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1550 bra TFT_surface_sensor6 ; Skip Sensor 3
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1551 TFT_surface_sensor5:
192
efe70488a04b voting logic for external monitoring
heinrichsweikamp
parents: 191
diff changeset
1552 movff o2_ppo2_sensor3,lo
0
heinrichsweikamp
parents:
diff changeset
1553 TFT_color_code warn_ppo2_hud ; With ppO2 [cbar] in lo
heinrichsweikamp
parents:
diff changeset
1554 clrf hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1555 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1556 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1557 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
1558 STRCAT_PRINT ""
188
ebc28381f17d NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents: 187
diff changeset
1559 TFT_surface_sensor6:
0
heinrichsweikamp
parents:
diff changeset
1560 bcf leftbind
428
eccae727702f some cleanup
heinrichsweikamp
parents: 413
diff changeset
1561 goto TFT_standard_color; and return...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1562
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1563
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1564 global TFT_sensor_mV
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1565 TFT_sensor_mV:
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1566 call TFT_standard_color
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1567 bsf leftbind
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1568 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor1_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1569 movff o2_mv_sensor1+0,lo ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1570 movff o2_mv_sensor1+1,hi ; in 0.1mV steps
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1571 STRCAT "1: "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1572 output_16dp .4 ; xxx.y mV
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1573 STRCAT_PRINT "mV "
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1574
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1575 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor2_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1576 movff o2_mv_sensor2+0,lo ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1577 movff o2_mv_sensor2+1,hi ; in 0.1mV steps
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1578 STRCAT "2: "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1579 output_16dp .4 ; xxx.y mV
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1580 STRCAT_PRINT "mV "
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1581
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1582 WIN_SMALL surf_mV_sensor_column,surf_mV_sensor3_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1583 movff o2_mv_sensor3+0,lo ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1584 movff o2_mv_sensor3+1,hi ; in 0.1mV steps
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1585 STRCAT "3: "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1586 output_16dp .4 ; xxx.y mV
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1587 STRCAT_PRINT "mV "
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
1588 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1589 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1590
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1591
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1592 global TFT_sensor_surface_warning
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1593 TFT_sensor_surface_warning:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1594 call TFT_warnings_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1595 btfss sensor1_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1596 bra TFT_sensor_mV2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1597 movff opt_x_s1+1,lo ; into bank1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1598 movf lo,W ; when opt_x_s1 > 255 the sensor will just give 8 mV at a ppO2 of 0,21 any more
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1599 bz TFT_sensor_mV2 ; the sensor is not too bad yet for a warning
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1600 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor1_row-.5
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1601 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1602 TFT_sensor_mV2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1603 btfss sensor2_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1604 bra TFT_sensor_mV3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1605 movff opt_x_s2+1,lo ; into bank1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1606 movf lo,W ; when opt_x_s2 > 255 the sensor will just give 8 mV at a ppO2 of 0,21 any more
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1607 bz TFT_sensor_mV3 ; the sensor is not too bad yet for a warning
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1608 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor2_row-.5
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1609 STRCPY_PRINT "\xb8" ; mark sensor as being at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1610 TFT_sensor_mV3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1611 btfss sensor3_calibrated_ok ; do not show end of lifetime arrow if sensor failed calibration at all
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1612 bra TFT_sensor_mV4
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1613 movff opt_x_s3+1,lo ; into bank1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1614 movf lo,W ; when opt_x_s3 > 255 the sensor will just give 8 mV at a ppO2 of 0,21 any more
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1615 bz TFT_sensor_mV4 ; the sensor is not too bad yet for a warning
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1616 WIN_SMALL surf_mV_sensor_status_column,surf_mV_sensor3_row-.5
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1617 STRCPY_PRINT "\xb8" ; mark sensor as beeing at end of lifetime
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
1618 TFT_sensor_mV4:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1619 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1620
0
heinrichsweikamp
parents:
diff changeset
1621
187
669b5d00706d CHANGE: Longer timeout (4 min) for calibration menu
heinrichsweikamp
parents: 180
diff changeset
1622 global TFT_menu_calibrate
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1623 TFT_menu_calibrate: ; update mV data in calibration menu
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1624 btfss s8_digital ; =1: Digital I/O
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1625 bra TFT_menu_calibrate_analog ; use analog
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1626 TFT_menu_calibrate_wait:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1627 btfss new_s8_data_available ; =1: New data frame recieved
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1628 bra TFT_menu_calibrate_wait
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1629 call compute_mvolts_for_all_sensors
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1630 bra TFT_menu_calibrate_common
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1631 TFT_menu_calibrate_analog:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1632 call get_analog_inputs
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1633 TFT_menu_calibrate_common:
113
heinrichsweikamp
parents: 106
diff changeset
1634 call TFT_attention_color ; show in yellow
heinrichsweikamp
parents: 106
diff changeset
1635 bsf leftbind
heinrichsweikamp
parents: 106
diff changeset
1636 WIN_SMALL surf_menu_sensor1_column,surf_menu2_sensor1_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1637 movff o2_mv_sensor1+0,lo ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1638 movff o2_mv_sensor1+1,hi ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1639 output_16dp .4 ; xxx.y mV
113
heinrichsweikamp
parents: 106
diff changeset
1640 STRCAT_PRINT "mV "
heinrichsweikamp
parents: 106
diff changeset
1641 WIN_SMALL surf_menu_sensor2_column,surf_menu2_sensor2_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1642 movff o2_mv_sensor2+0,lo ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1643 movff o2_mv_sensor2+1,hi ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1644 output_16dp .4 ; xxx.y mV
113
heinrichsweikamp
parents: 106
diff changeset
1645 STRCAT_PRINT "mV "
heinrichsweikamp
parents: 106
diff changeset
1646 WIN_SMALL surf_menu_sensor3_column,surf_menu2_sensor3_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1647 movff o2_mv_sensor3+0,lo ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1648 movff o2_mv_sensor3+1,hi ; in 0.1mV steps
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1649 output_16dp .4 ; xxx.y mV
113
heinrichsweikamp
parents: 106
diff changeset
1650 STRCAT_PRINT "mV "
428
eccae727702f some cleanup
heinrichsweikamp
parents: 413
diff changeset
1651 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1652 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1653
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1654
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1655 global TFT_clock
0
heinrichsweikamp
parents:
diff changeset
1656 TFT_clock:
48
7c7d7644ca37 Time and Date in normal (Not tiny) font
heinrichsweikamp
parents: 42
diff changeset
1657 WIN_SMALL surf_clock_column,surf_clock_row
0
heinrichsweikamp
parents:
diff changeset
1658 TFT_clock2: ; called from divemode clock
heinrichsweikamp
parents:
diff changeset
1659 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
1660 movff hours,lo
heinrichsweikamp
parents:
diff changeset
1661 output_99
heinrichsweikamp
parents:
diff changeset
1662 movlw ':'
heinrichsweikamp
parents:
diff changeset
1663 btfss secs,0 ; blinking every second
heinrichsweikamp
parents:
diff changeset
1664 movlw ' '
heinrichsweikamp
parents:
diff changeset
1665 movwf POSTINC2
heinrichsweikamp
parents:
diff changeset
1666 movff mins,lo
heinrichsweikamp
parents:
diff changeset
1667 output_99x
heinrichsweikamp
parents:
diff changeset
1668 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
1669 return
heinrichsweikamp
parents:
diff changeset
1670
heinrichsweikamp
parents:
diff changeset
1671 global TFT_show_time_date_menu
heinrichsweikamp
parents:
diff changeset
1672 TFT_show_time_date_menu:
heinrichsweikamp
parents:
diff changeset
1673 call speed_fastest
heinrichsweikamp
parents:
diff changeset
1674 WIN_SMALL .15,.30
heinrichsweikamp
parents:
diff changeset
1675 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
1676 movff hours,lo
heinrichsweikamp
parents:
diff changeset
1677 output_99
heinrichsweikamp
parents:
diff changeset
1678 PUTC ':'
heinrichsweikamp
parents:
diff changeset
1679 movff mins,lo
heinrichsweikamp
parents:
diff changeset
1680 output_99x
heinrichsweikamp
parents:
diff changeset
1681 PUTC ':'
heinrichsweikamp
parents:
diff changeset
1682 movff secs,lo
heinrichsweikamp
parents:
diff changeset
1683 output_99x
heinrichsweikamp
parents:
diff changeset
1684 STRCAT " - "
heinrichsweikamp
parents:
diff changeset
1685 movff month,convert_value_temp+0
heinrichsweikamp
parents:
diff changeset
1686 movff day,convert_value_temp+1
heinrichsweikamp
parents:
diff changeset
1687 movff year,convert_value_temp+2
heinrichsweikamp
parents:
diff changeset
1688 call TFT_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
heinrichsweikamp
parents:
diff changeset
1689 STRCAT_PRINT " "
heinrichsweikamp
parents:
diff changeset
1690 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1691
0
heinrichsweikamp
parents:
diff changeset
1692 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
1693
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1694 global TFT_surface_decosettings ; Show all deco settings
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1695 TFT_surface_decosettings:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1696 ; Deco Mode
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1697 call TFT_standard_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1698 WIN_SMALL surf_gaslist_column,surf_gaslist_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1699 STRCAT_PRINT "ZH-L16"
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1700 movff char_I_deco_model,WREG
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1701 iorwf WREG
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1702 bnz TFT_surface_decosettings1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1703 ; Display ZH-L16 sat/desat model
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1704 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1705 lfsr FSR2,buffer
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1706 movff char_I_desaturation_multiplier,lo
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1707 bsf leftbind
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1708 output_8
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1709 STRCAT "%/"
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1710 movff char_I_saturation_multiplier,lo
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1711 output_8
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1712 STRCAT_PRINT "%"
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1713 bra TFT_surface_decosettings2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1714 ; Display ZH-L16-GF low/high model
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1715 TFT_surface_decosettings1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1716 TEXT_SMALL surf_gaslist_column+.43,surf_gaslist_row,tZHL16GF
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1717 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1718 STRCPY_TEXT tGF ; GF:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1719 movff opt_GF_low,lo
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1720 output_99x
42
mh@mh-THINK.fritz.box
parents: 41
diff changeset
1721 STRCAT "/"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1722 movff opt_GF_high,lo
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1723 output_99x
42
mh@mh-THINK.fritz.box
parents: 41
diff changeset
1724 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1725 TFT_surface_decosettings2: ; fTTS
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1726 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1727 STRCPY_TEXT tFTTSMenu
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1728 movff char_I_extra_time,lo
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1729 bsf leftbind
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1730 output_8
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1731 STRCAT_TEXT_PRINT tMinutes
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1732 ; Last Stop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1733 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1734 STRCPY_TEXT tLastDecostop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1735 movff opt_last_stop,lo
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1736 output_8
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1737 STRCAT_TEXT_PRINT tMeters
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1738 ; Salinity
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1739 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
41
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1740 STRCPY_TEXT tDvSalinity
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1741 movff opt_salinity,lo
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1742 output_8
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1743 bcf leftbind
5041477eee79 Surface customview with important deco settings
mh@mh-THINK
parents: 40
diff changeset
1744 STRCAT_TEXT_PRINT tPercent
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1745 return
0
heinrichsweikamp
parents:
diff changeset
1746
heinrichsweikamp
parents:
diff changeset
1747 global TFT_debug_output
heinrichsweikamp
parents:
diff changeset
1748 TFT_debug_output:
490
8dfb93e80338 NEW: Deep Sleep mode for OSTC Plus and OSTC 2 (2017) (Entered automatically)
heinrichsweikamp
parents: 487
diff changeset
1749 return
474
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1750 WIN_TINY .80,.0
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1751 call TFT_standard_color
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1752 lfsr FSR2,buffer
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1753 movff analog_sw1,lo
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1754 output_8
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1755 PUTC ","
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1756 movff analog_sw2,lo
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1757 output_8
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1758 STRCAT_PRINT ""
123
d076e9c02438 add ceiling display
heinrichsweikamp
parents: 122
diff changeset
1759 return
0
heinrichsweikamp
parents:
diff changeset
1760
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1761 global TFT_divetimeout ; Show timeout counter
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1762 TFT_divetimeout:
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1763 call TFT_warning_set_window ; Sets the row and column for the current warning
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1764 tstfsz WREG ; Is there room for the warning?
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1765 return ; No
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1766 call TFT_standard_color
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1767 STRCPY 0x94 ; "End of dive" icon
444
d93d75ae01bf Adjustable timeout for Divemode (Config 0x48)
heinrichsweikamp
parents: 437
diff changeset
1768 movff opt_diveTimeout,WREG ; in [min]
d93d75ae01bf Adjustable timeout for Divemode (Config 0x48)
heinrichsweikamp
parents: 437
diff changeset
1769 mullw .60
d93d75ae01bf Adjustable timeout for Divemode (Config 0x48)
heinrichsweikamp
parents: 437
diff changeset
1770 movff PRODL,sub_a+0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1771 movff PRODH,sub_a+1 ; in [s]
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1772 movff timeout_counter,sub_b+0
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1773 movff timeout_counter2,sub_b+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1774 call subU16 ; sub_c = sub_a - sub_b (with UNSIGNED values)
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1775 movff sub_c+0, lo
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1776 movff sub_c+1, hi
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1777 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1778 movf hi,W
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1779 movff lo,hi
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1780 movwf lo ; exchange lo and hi
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1781 output_99x
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1782 PUTC ':'
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1783 movff hi,lo
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1784 output_99x
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1785 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1786 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1787 STRCAT_PRINT ""
341
0740bd920c51 Show ppo2 <1bar with leading zero
heinrichsweikamp
parents: 339
diff changeset
1788 bcf win_invert
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1789 return
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
1790
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1791 global TFT_display_ftts
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1792 TFT_display_ftts:
0
heinrichsweikamp
parents:
diff changeset
1793 movff char_I_extra_time,lo
heinrichsweikamp
parents:
diff changeset
1794 tstfsz lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1795 bra TFT_display_ftts_a
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1796 return ; char_I_extra_time=0, return.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1797 TFT_display_ftts_a:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1798 movff int_O_alternate_ascenttime+0,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1799 movff int_O_alternate_ascenttime+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1800 iorwf hi,W ; int_O_alternate_ascenttime:2 == 0 ?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1801 bnz TFT_display_ftts_b
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1802 return ; No deco, do nothing
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1803 TFT_display_ftts_b:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1804 btfsc is_bailout ; check if we are in bailout mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1805 return ; YES - in bailout no fTTS will be computed, so nothing to display
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1806 incf warning_counter,F ; increase counter
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1807 call TFT_warning_set_window ; sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1808 tstfsz WREG ; is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1809 return ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1810 btfsc FLAG_ccr_mode ; in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1811 bra TFT_display_ftts_1 ; YES - print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1812 btfsc FLAG_pscr_mode ; NO - in pSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1813 bra TFT_display_ftts_1 ; YES - print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1814 bra TFT_display_ftts_2 ; NO - must be OC then
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1815 TFT_display_ftts_1: ; in CCR or pSCR mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1816 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1817 bra TFT_display_ftts_2 ; YES - print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1818 TSTOSS opt_calc_asc_gasvolume ; NO - bailout volume calculation requested?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1819 bra TFT_display_ftts_2 ; NO - print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1820 STRCPY "B/O" ; YES - print bailout label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1821 bra TFT_display_ftts_3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1822 TFT_display_ftts_2: ; OC or bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1823 STRCPY "@+" ; print fTTS label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1824 TFT_display_ftts_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1825 movff char_I_extra_time,lo
0
heinrichsweikamp
parents:
diff changeset
1826 bsf leftbind
heinrichsweikamp
parents:
diff changeset
1827 output_8
heinrichsweikamp
parents:
diff changeset
1828 PUTC ":"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1829 movff int_O_alternate_ascenttime+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1830 movff int_O_alternate_ascenttime+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1831 btfss hi,int_invalid_flag ; is the invalid flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1832 bra TFT_display_ftts1 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1833 bcf hi,int_invalid_flag ; YES - clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1834 call TFT_disabled_color ; switch to disabled color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1835 TFT_display_ftts1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1836 movf lo,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1837 iorwf hi,W ; extra_ascenttime == 0 ?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1838 bz TFT_display_ftts2 ; YES - show dashes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1839 btfsc hi,int_not_yet_computed ; is the not-computed-yet flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1840 bra TFT_display_ftts2 ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1841 output_16 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1842 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
1843 PUTC "'"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1844 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1845 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
1846 STRCAT_PRINT ""
341
0740bd920c51 Show ppo2 <1bar with leading zero
heinrichsweikamp
parents: 339
diff changeset
1847 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1848 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1849 TFT_display_ftts2:
0
heinrichsweikamp
parents:
diff changeset
1850 STRCAT "---"
heinrichsweikamp
parents:
diff changeset
1851 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1852 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1853 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
1854 STRCAT_PRINT ""
341
0740bd920c51 Show ppo2 <1bar with leading zero
heinrichsweikamp
parents: 339
diff changeset
1855 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1856 goto TFT_standard_color ; ...and return
0
heinrichsweikamp
parents:
diff changeset
1857
heinrichsweikamp
parents:
diff changeset
1858
heinrichsweikamp
parents:
diff changeset
1859 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1860
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1861 global TFT_temp_surfmode
0
heinrichsweikamp
parents:
diff changeset
1862 TFT_temp_surfmode:
heinrichsweikamp
parents:
diff changeset
1863 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1864 WIN_SMALL surf_temp_column+3*8,surf_temp_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1865 TSTOSS opt_units ; 0=°C, 1=°F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1866 bra TFT_temp_surfmode_metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1867 STRCAT_TEXT tLogTunitF ; °F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1868 bra TFT_temp_surfmode_common
0
heinrichsweikamp
parents:
diff changeset
1869 TFT_temp_surfmode_metric:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1870 STRCAT_TEXT tLogTunitC ; °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1871 TFT_temp_surfmode_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1872 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1873 WIN_SMALL surf_temp_column,surf_temp_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1874 bra TFT_temp_common
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1875
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1876 global TFT_temp_divemode
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1877 TFT_temp_divemode:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1878 bcf FLAG_TFT_temp_divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1879 btfsc divemode_menu ; Is the dive mode menu shown?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1880 return ; Yes, no update of temperature now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1881 btfsc blinking_better_gas ; blinking better Gas?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1882 return ; Yes, no update of temperature now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1883 WIN_SMALL dm_temp_column,dm_temp_row
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1884 TFT_temp_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1885 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1886 SAFE_2BYTE_COPY temperature,lo ; get current temperature
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1887 TSTOSS opt_units ; 0=°C, 1=°F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1888 bra TFT_temp_common_1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1889 call convert_celsius_to_fahrenheit ; convert value in lo:hi from celsius to fahrenheit
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1890 TFT_temp_common_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1891 rcall TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1892 btfsc neg_flag ; is the temperature negative?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1893 bra TFT_temp_common_2 ; YES - the minus sign has already been written
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1894 ; temp is positive, is it less then 10°C?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1895 tstfsz hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1896 bra TFT_temp_common_1a ; >25.5°C, skip here
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1897 movlw .100
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1898 cpfslt lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1899 bra TFT_temp_common_1a ; >10.0°C, skip here
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1900 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1901 output_16dp d'4' ; x.y°C
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1902 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1903 bra TFT_temp_common_3 ; Done.
553
2e70700774b9 Display dezimal for temperatures between 10 and 0?C
heinrichsweikamp
parents: 552
diff changeset
1904 TFT_temp_common_1a:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1905 PUTC " " ; NO - write a space instead of the minus sign
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1906 TFT_temp_common_2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1907 bsf ignore_digit5 ; ignore decimal
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1908 output_16_3 ; output 0-999 without decimal -> writes ' ' - 99
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1909 bcf ignore_digit5
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1910 movff buffer+2,lo ; get output from unit position
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1911 movlw " " ; load code of the space character
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1912 cpfseq lo ; is there a space sign on the unit position? (happens between +1 and -1)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1913 bra TFT_temp_common_3 ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1914 movff WREG,buffer+0 ; YES - replace potential minus sign with a space (temps from -0.9° to -0.1° else would appear as '- 0')
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1915 movlw "0" ; load code of the zero character
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1916 movff WREG,buffer+2 ; replace space with a zero
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1917 TFT_temp_common_3:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1918 btfss divemode ; are we in dive mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1919 bra TFT_temp_common_5 ; NO - no unit to append
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1920 TSTOSS opt_units ; YES - check unit type: 0=°C, 1=°F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1921 bra TFT_temp_common_4 ; go metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1922 STRCAT_TEXT tLogTunitF ; append °F
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1923 bra TFT_temp_common_5
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1924 TFT_temp_common_4:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1925 STRCAT_TEXT tLogTunitC ; append °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
1926 TFT_temp_common_5:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1927 STRCAT_PRINT "" ; output to screen
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1928 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1929
0
heinrichsweikamp
parents:
diff changeset
1930 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1931
0
heinrichsweikamp
parents:
diff changeset
1932 global TFT_divemode_menu_cursor
heinrichsweikamp
parents:
diff changeset
1933 TFT_divemode_menu_cursor:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1934 WIN_BOX_BLACK dm_menu_row+.1, dm_menu_lower-.1, dm_menu_item1_column-.8, dm_menu_item1_column-.1
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1935 WIN_BOX_BLACK dm_menu_row+.1, dm_menu_lower-.1, dm_menu_item4_column-.8, dm_menu_item4_column-.1
0
heinrichsweikamp
parents:
diff changeset
1936 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
1937
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1938 movlw dm_menu_item1_column-.8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1939 btfsc menupos,2 ; >3?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1940 movlw dm_menu_item4_column-.8 ; Yes
0
heinrichsweikamp
parents:
diff changeset
1941 movff WREG,win_leftx2
heinrichsweikamp
parents:
diff changeset
1942
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1943 movff menupos,lo ; Copy menu pos
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1944 movlw dm_menu_item6_row
0
heinrichsweikamp
parents:
diff changeset
1945 dcfsnz lo,F
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1946 movlw dm_menu_item1_row
0
heinrichsweikamp
parents:
diff changeset
1947 dcfsnz lo,F
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1948 movlw dm_menu_item2_row
0
heinrichsweikamp
parents:
diff changeset
1949 dcfsnz lo,F
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1950 movlw dm_menu_item3_row
0
heinrichsweikamp
parents:
diff changeset
1951 dcfsnz lo,F
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1952 movlw dm_menu_item4_row
0
heinrichsweikamp
parents:
diff changeset
1953 dcfsnz lo,F
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1954 movlw dm_menu_item5_row
0
heinrichsweikamp
parents:
diff changeset
1955 movff WREG,win_top
heinrichsweikamp
parents:
diff changeset
1956 movlw FT_SMALL
heinrichsweikamp
parents:
diff changeset
1957 movff WREG,win_font
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1958 STRCPY_PRINT "\xb7" ; print cursor
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
1959 return
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
1960
0
heinrichsweikamp
parents:
diff changeset
1961 global TFT_active_gas_divemode
heinrichsweikamp
parents:
diff changeset
1962 TFT_active_gas_divemode: ; Display gas/Setpoint
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1963 bcf FLAG_TFT_active_gas_divemode
0
heinrichsweikamp
parents:
diff changeset
1964 btfsc divemode_menu ; Is the dive mode menu shown?
heinrichsweikamp
parents:
diff changeset
1965 return ; Yes, return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1966 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
1967 return
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
1968 btfsc FLAG_ccr_mode ; in CCR mode?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1969 bra TFT_active_setpoint ; Yes, show setpoint and gas mix
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1970 btfsc FLAG_pscr_mode ; in PSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1971 bra TFT_active_setpoint ; Yes, show setpoint and gas mix
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1972 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1973 btfss better_gas_available ; check if a better gas is available and a gas change is advised in divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1974 bra TFT_active_gas_divemode2 ; NO - print in normal rendering
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1975 btg blinking_better_gas ; YES - toggle blink bit
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1976 btfss blinking_better_gas ; blink now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1977 bra TFT_active_gas_divemode2 ; NO - print in normal rendering
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1978 call TFT_attention_color ; YES - blink in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1979 bsf win_invert ; set invert flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1980 TFT_active_gas_divemode2:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
1981 WIN_STD dm_active_gas_column, dm_active_gas_row
0
heinrichsweikamp
parents:
diff changeset
1982 movff char_I_O2_ratio,lo ; lo now stores O2 in %
heinrichsweikamp
parents:
diff changeset
1983 movff char_I_He_ratio,hi ; hi now stores He in %
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1984 call customview_show_mix ; put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1985 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1986 bcf win_invert ; reset invert flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1987 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1988
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1989 TFT_active_setpoint: ; Show setpoint
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1990 btfsc is_bailout ; are we in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1991 bra TFT_active_setpoint_bail ; YES - show "Bailout" instead of setpoint
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1992 movff int_O_breathed_ppO2+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1993 movff int_O_breathed_ppO2+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1994 TFT_color_code warn_ppo2 ; with ppO2 [cbar] in hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1995 btg blinking_setpoint ; toggle blink bit...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1996 btfss blinking_setpoint ; blink now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1997 bra TFT_active_setpoint_print ; NO - print ppO2 with normal rendering
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1998 btfsc setpoint_fallback ; YES - check if we are in fallback condition
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
1999 bra TFT_active_setpoint_fallb ; YES - process fallback case
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2000 movff int_O_breathed_ppO2+1,WREG ; NO - get flags again (have been cleared in hi:lo by TFT_color_code meanwhile)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2001 btfss WREG,int_warning_flag ; warning flag set?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2002 bra TFT_active_setpoint_print ; NO - ppO2 is ok, print ppO2 with normal rendering
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2003 bra TFT_active_setpoint_com ; YES - continue with blinking common part
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2004 TFT_active_setpoint_fallb: ; set up fallback case
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2005 movlw color_yellow ; text in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2006 call TFT_set_color ; overwrite setting done by TFT_color_code warn_ppo2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2007 TFT_active_setpoint_com: ; blinking common part
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2008 bsf win_invert ; set invert flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2009 TFT_active_setpoint_print:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2010 WIN_STD dm_active_gas_column, dm_active_gas_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2011 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2012 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2013 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2014 STRCAT_TEXT tbar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2015 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2016 sublw .1 ; opt_ccr_mode = 1 (Sensor)?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2017 bnz TFT_active_setpoint2_a ; NO - skip
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2018 PUTC "*" ; YES - add an astrix
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2019 TFT_active_setpoint2_a:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2020 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2021 bcf win_invert ; reset invert flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2022 call TFT_standard_color ; revert to standard color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2023 bra TFT_active_setpoint_diluent ; continue with showing diluent
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2024 TFT_active_setpoint_bail:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2025 WIN_SMALL dm_active_gas_column, dm_active_gas_row+.3 ; collides with diluent in FT_MEDIUM
0
heinrichsweikamp
parents:
diff changeset
2026 call TFT_standard_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2027 STRCPY_TEXT_PRINT tDiveBailout ; Bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2028 TFT_active_setpoint_diluent:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2029 btfss better_gas_available ; check if a better gas is available and a gas change is advised in divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2030 bra TFT_active_setpoint_diluent_show ; NO - print in normal rendering
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2031 btg blinking_better_gas ; YES - toggle blink bit...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2032 btfss blinking_better_gas ; blink now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2033 bra TFT_active_setpoint_diluent_show ; NO - print in normal rendering
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2034 movlw color_yellow ; YES - blink in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2035 call TFT_set_color ; set text color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2036 bsf win_invert ; set invert flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2037 TFT_active_setpoint_diluent_show:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2038 WIN_SMALL dm_active_dil_column, dm_active_dil_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2039 movff char_I_O2_ratio,lo ; lo now stores O2 in %
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2040 movff char_I_He_ratio,hi ; hi now stores He in %
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2041 call customview_show_mix ; put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
0
heinrichsweikamp
parents:
diff changeset
2042 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2043 bcf win_invert ; reset invert flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2044 goto TFT_standard_color ; ...and return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2045
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2046
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2047 global TFT_show_mode_divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2048 TFT_show_mode_divemode:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2049 WIN_TINY dm_active_dil_column+.45, dm_active_dil_row+.3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2050 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2051 return ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2052 btfsc FLAG_ccr_mode ; NO - in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2053 bra TFT_show_mode_divemode_ccr ; YES - write CCR label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2054 btfsc FLAG_pscr_mode ; NO - in pSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2055 bra TFT_show_mode_divemode_pscr ; YES - write pSCR label
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2056 return ; NO - done
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2057 TFT_show_mode_divemode_ccr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2058 call TFT_standard_color ; set standard color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2059 STRCPY_TEXT_PRINT tDvCCR ; print "CCR"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2060 return ; done
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2061 TFT_show_mode_divemode_pscr:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2062 call TFT_standard_color ; set standard color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2063 STRCPY_TEXT_PRINT tDvPSCR ; print "PSCR"
0
heinrichsweikamp
parents:
diff changeset
2064 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2065
0
heinrichsweikamp
parents:
diff changeset
2066
heinrichsweikamp
parents:
diff changeset
2067 global TFT_display_decotype_surface
heinrichsweikamp
parents:
diff changeset
2068 TFT_display_decotype_surface:
heinrichsweikamp
parents:
diff changeset
2069 WIN_STD surf_decotype_column,surf_decotype_row
heinrichsweikamp
parents:
diff changeset
2070 WIN_COLOR color_lightblue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2071 movff opt_dive_mode,lo ; 0=OC, 1=CC, 2=Gauge, 3=Apnea, 4=PSCR
0
heinrichsweikamp
parents:
diff changeset
2072 tstfsz lo
heinrichsweikamp
parents:
diff changeset
2073 bra TFT_display_decotype_surface2
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2074 TFT_display_decotype_surface0:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2075 STRCAT_TEXT_PRINT tDvOC ; OC
0
heinrichsweikamp
parents:
diff changeset
2076 bra TFT_display_decotype_exit
heinrichsweikamp
parents:
diff changeset
2077 TFT_display_decotype_surface2:
heinrichsweikamp
parents:
diff changeset
2078 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
2079 bra TFT_display_decotype_surface3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2080 STRCAT_TEXT_PRINT tDvCC ; CC
113
heinrichsweikamp
parents: 106
diff changeset
2081 call TFT_standard_color
heinrichsweikamp
parents: 106
diff changeset
2082 WIN_TINY surf_decotype_column+.18,surf_decotype_row+.12
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2083 TSTOSS opt_ccr_mode ; =0: Fixed SP, =1: Sensor, =2: Auto SP
113
heinrichsweikamp
parents: 106
diff changeset
2084 bra TFT_display_decotype_cc_fixed
337
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2085 ; Sensor mode or Auto
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2086 movff opt_ccr_mode,WREG
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2087 sublw .2
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2088 bz TFT_display_decotype_cc_auto
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2089 STRCPY_TEXT tCCRModeSensor ; Sensor
113
heinrichsweikamp
parents: 106
diff changeset
2090 bra TFT_display_decotype_cc_common
337
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2091 TFT_display_decotype_cc_auto:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2092 STRCPY_TEXT tCCRModeAutoSP ; Auto SP
337
508d7fb98b34 cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents: 333
diff changeset
2093 bra TFT_display_decotype_cc_common
113
heinrichsweikamp
parents: 106
diff changeset
2094 TFT_display_decotype_cc_fixed:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2095 STRCPY_TEXT tCCRModeFixedSP ; Fixed SP
113
heinrichsweikamp
parents: 106
diff changeset
2096 TFT_display_decotype_cc_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2097 clrf WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2098 movff WREG,buffer+.8 ; limit string length to 8
113
heinrichsweikamp
parents: 106
diff changeset
2099 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
2100 bra TFT_display_decotype_exit
heinrichsweikamp
parents:
diff changeset
2101 TFT_display_decotype_surface3:
heinrichsweikamp
parents:
diff changeset
2102 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
2103 bra TFT_display_decotype_surface4
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2104 TFT_display_decotype_surface3_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2105 STRCAT_TEXT_PRINT tDvGauge ; Gauge
0
heinrichsweikamp
parents:
diff changeset
2106 bra TFT_display_decotype_exit
heinrichsweikamp
parents:
diff changeset
2107 TFT_display_decotype_surface4:
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2108 decfsz lo,F
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2109 bra TFT_display_decotype_surface5
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2110 TFT_display_decotype_surface4_1:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2111 STRCAT_TEXT_PRINT tDvApnea ; Apnea
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2112 bra TFT_display_decotype_exit
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2113 TFT_display_decotype_surface5:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2114 STRCAT_TEXT_PRINT tDvPSCR ; PSCR
0
heinrichsweikamp
parents:
diff changeset
2115 TFT_display_decotype_exit:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2116 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2117
40
1e2d2b0bca5b Bugfix: Simulator in CC mode
mh@mh-THINK.fritz.box
parents: 38
diff changeset
2118
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2119 global TFT_display_decotype_surface1 ; Used from logbook!
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2120 TFT_display_decotype_surface1: ; Used from logbook!
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2121 tstfsz lo
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2122 bra TFT_display_decotype_surface1_2
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2123 bra TFT_display_decotype_surface0 ;OC
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2124 TFT_display_decotype_surface1_2:
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2125 decfsz lo,F
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2126 bra TFT_display_decotype_surface1_3
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2127 STRCAT_TEXT_PRINT tDvCC ; CC (w/o Sensor/Fixed Display)
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2128 TFT_display_decotype_surface1_3:
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2129 decfsz lo,F
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2130 bra TFT_display_decotype_surface1_4
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2131 bra TFT_display_decotype_surface3_1 ; Gauge
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2132 TFT_display_decotype_surface1_4:
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2133 decfsz lo,F
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2134 bra TFT_display_decotype_surface4_1 ; Apnea
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
2135 bra TFT_display_decotype_surface5 ; PSCR
116
737d6f488729 show decomode in logbook and simulator w/o sensor type
heinrichsweikamp
parents: 113
diff changeset
2136
0
heinrichsweikamp
parents:
diff changeset
2137 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2138
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2139 global TFT_splist_surfmode ; Show Setpoint list
0
heinrichsweikamp
parents:
diff changeset
2140 extern gaslist_strcat_setpoint
heinrichsweikamp
parents:
diff changeset
2141 TFT_splist_surfmode:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2142 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
0
heinrichsweikamp
parents:
diff changeset
2143 ;SP 1
heinrichsweikamp
parents:
diff changeset
2144 WIN_SMALL surf_gaslist_column,surf_gaslist_row
heinrichsweikamp
parents:
diff changeset
2145 clrf PRODL
heinrichsweikamp
parents:
diff changeset
2146 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
heinrichsweikamp
parents:
diff changeset
2147 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2148 ;SP 2
heinrichsweikamp
parents:
diff changeset
2149 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
heinrichsweikamp
parents:
diff changeset
2150 movlw .1
heinrichsweikamp
parents:
diff changeset
2151 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2152 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
heinrichsweikamp
parents:
diff changeset
2153 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2154 ;SP 3
heinrichsweikamp
parents:
diff changeset
2155 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
heinrichsweikamp
parents:
diff changeset
2156 movlw .2
heinrichsweikamp
parents:
diff changeset
2157 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2158 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
heinrichsweikamp
parents:
diff changeset
2159 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2160 ;SP 4
heinrichsweikamp
parents:
diff changeset
2161 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
heinrichsweikamp
parents:
diff changeset
2162 movlw .3
heinrichsweikamp
parents:
diff changeset
2163 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2164 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
heinrichsweikamp
parents:
diff changeset
2165 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2166 ;SP 5
heinrichsweikamp
parents:
diff changeset
2167 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
heinrichsweikamp
parents:
diff changeset
2168 movlw .4
heinrichsweikamp
parents:
diff changeset
2169 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2170 call gaslist_strcat_setpoint ; Show SP#+1 of PRODL#
heinrichsweikamp
parents:
diff changeset
2171 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2172 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2173 return
heinrichsweikamp
parents:
diff changeset
2174
heinrichsweikamp
parents:
diff changeset
2175 global TFT_gaslist_surfmode
heinrichsweikamp
parents:
diff changeset
2176 TFT_gaslist_surfmode: ; Displays Gas List
heinrichsweikamp
parents:
diff changeset
2177 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
heinrichsweikamp
parents:
diff changeset
2178 extern gaslist_strcat_gas_mod
heinrichsweikamp
parents:
diff changeset
2179 ;Gas 1
heinrichsweikamp
parents:
diff changeset
2180 WIN_SMALL surf_gaslist_column,surf_gaslist_row
386
3c55627d5f8f some cleanups, jump to 1.90 stable
heinrichsweikamp
parents: 369
diff changeset
2181 clrf PRODL
0
heinrichsweikamp
parents:
diff changeset
2182 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
heinrichsweikamp
parents:
diff changeset
2183 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2184 ;Gas 2
heinrichsweikamp
parents:
diff changeset
2185 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)
heinrichsweikamp
parents:
diff changeset
2186 movlw .1
heinrichsweikamp
parents:
diff changeset
2187 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2188 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
heinrichsweikamp
parents:
diff changeset
2189 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2190 ;Gas 3
heinrichsweikamp
parents:
diff changeset
2191 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)
heinrichsweikamp
parents:
diff changeset
2192 movlw .2
heinrichsweikamp
parents:
diff changeset
2193 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2194 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
heinrichsweikamp
parents:
diff changeset
2195 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2196 ;Gas 4
heinrichsweikamp
parents:
diff changeset
2197 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.3)
heinrichsweikamp
parents:
diff changeset
2198 movlw .3
heinrichsweikamp
parents:
diff changeset
2199 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2200 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
heinrichsweikamp
parents:
diff changeset
2201 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2202 ;Gas 5
heinrichsweikamp
parents:
diff changeset
2203 WIN_SMALL surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.4)
heinrichsweikamp
parents:
diff changeset
2204 movlw .4
heinrichsweikamp
parents:
diff changeset
2205 movwf PRODL
heinrichsweikamp
parents:
diff changeset
2206 call gaslist_strcat_gas_mod ;Append gas description of gas #PRODL (0-4) to current string
heinrichsweikamp
parents:
diff changeset
2207 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2208 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2209 return
heinrichsweikamp
parents:
diff changeset
2210
heinrichsweikamp
parents:
diff changeset
2211 global TFT_dillist_surfmode
heinrichsweikamp
parents:
diff changeset
2212 TFT_dillist_surfmode: ; Displays Diluent List
heinrichsweikamp
parents:
diff changeset
2213 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
175
d097e10b383b CHANGE: Draw a frame around the dive mode menu
heinrichsweikamp
parents: 170
diff changeset
2214 bsf ccr_diluent_setup ; Use CCR Diluents...
d097e10b383b CHANGE: Draw a frame around the dive mode menu
heinrichsweikamp
parents: 170
diff changeset
2215 rcall TFT_gaslist_surfmode ; Use OC/BAIL routine
d097e10b383b CHANGE: Draw a frame around the dive mode menu
heinrichsweikamp
parents: 170
diff changeset
2216 bcf ccr_diluent_setup ; Clear flag
0
heinrichsweikamp
parents:
diff changeset
2217 return
heinrichsweikamp
parents:
diff changeset
2218
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2219 ;==================================================================
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2220
0
heinrichsweikamp
parents:
diff changeset
2221 global TFT_depth
heinrichsweikamp
parents:
diff changeset
2222 TFT_depth:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2223 bcf FLAG_TFT_depth
0
heinrichsweikamp
parents:
diff changeset
2224 SAFE_2BYTE_COPY rel_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2225 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2226
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2227 TFT_color_code warn_depth ; Color-code the output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2228 rcall TFT_depth_blink
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2229 WIN_LARGE dm_depth_column, dm_depth_row
0
heinrichsweikamp
parents:
diff changeset
2230
heinrichsweikamp
parents:
diff changeset
2231 TSTOSS opt_units ; 0=m, 1=ft
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2232 bra TFT_depth_metric
0
heinrichsweikamp
parents:
diff changeset
2233 ;TFT_depth_imperial
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2234 clrf sub_a+1 ; Display 0ft if lower then 30cm
0
heinrichsweikamp
parents:
diff changeset
2235 movlw d'30'
heinrichsweikamp
parents:
diff changeset
2236 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2237 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2238 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2239 call subU16 ; sub_c = sub_a - sub_b
heinrichsweikamp
parents:
diff changeset
2240 btfss neg_flag ; Depth lower then 0.4m?
heinrichsweikamp
parents:
diff changeset
2241 bra depth_less_0.3mtr_feet ; Yes, Show 0ft manually
heinrichsweikamp
parents:
diff changeset
2242
heinrichsweikamp
parents:
diff changeset
2243 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
heinrichsweikamp
parents:
diff changeset
2244 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2245 output_16 ; feet in Big font
heinrichsweikamp
parents:
diff changeset
2246 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2247 movlw .3 ; limit to three chars
heinrichsweikamp
parents:
diff changeset
2248 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
heinrichsweikamp
parents:
diff changeset
2249 STRCAT_PRINT "" ; Display feet
303
9b1b0b32e7d5 Add configuration option to control depth warning blinking
janos_kovacs <kovjanos@gmail.com>
parents: 300
diff changeset
2250 bcf win_invert ; Reset invert flag
0
heinrichsweikamp
parents:
diff changeset
2251 return
126
9e856337b225 fix depth<0m display, ceiling
heinrichsweikamp
parents: 124
diff changeset
2252
0
heinrichsweikamp
parents:
diff changeset
2253 depth_less_0.3mtr_feet:
heinrichsweikamp
parents:
diff changeset
2254 STRCAT_PRINT "0 " ; manual zero
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2255 bcf win_invert ; Reset invert flag
0
heinrichsweikamp
parents:
diff changeset
2256 return
heinrichsweikamp
parents:
diff changeset
2257
heinrichsweikamp
parents:
diff changeset
2258 TFT_depth_metric:
heinrichsweikamp
parents:
diff changeset
2259 movlw .039
heinrichsweikamp
parents:
diff changeset
2260 cpfslt hi
heinrichsweikamp
parents:
diff changeset
2261 bra depth_greater_99_84mtr
heinrichsweikamp
parents:
diff changeset
2262
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2263 btfsc depth_greater_100m ; Was depth>100m during last call
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2264 rcall TFT_clear_depth ; Yes, clear depth area
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2265 bcf depth_greater_100m ; Do this once only...
0
heinrichsweikamp
parents:
diff changeset
2266
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2267 movlw .039
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2268 cpfslt hi
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2269 bra depth_greater_99_84mtr
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2270
0
heinrichsweikamp
parents:
diff changeset
2271 movlw HIGH d'1000'
heinrichsweikamp
parents:
diff changeset
2272 movwf sub_a+1
heinrichsweikamp
parents:
diff changeset
2273 movlw LOW d'1000'
heinrichsweikamp
parents:
diff changeset
2274 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2275 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2276 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2277 incf sub_b+0,F
heinrichsweikamp
parents:
diff changeset
2278 movlw d'0'
heinrichsweikamp
parents:
diff changeset
2279 addwfc sub_b+1,F ; Add 1mbar offset
heinrichsweikamp
parents:
diff changeset
2280 call sub16 ; sub_c = sub_a - sub_b
heinrichsweikamp
parents:
diff changeset
2281 movlw ' '
heinrichsweikamp
parents:
diff changeset
2282 btfss neg_flag ; Depth lower then 10m?
heinrichsweikamp
parents:
diff changeset
2283 movwf POSTINC2 ; Yes, add extra space
heinrichsweikamp
parents:
diff changeset
2284
heinrichsweikamp
parents:
diff changeset
2285 clrf sub_a+1
heinrichsweikamp
parents:
diff changeset
2286 movlw d'99'
heinrichsweikamp
parents:
diff changeset
2287 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2288 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2289 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2290 call subU16 ; sub_c = sub_a - sub_b
heinrichsweikamp
parents:
diff changeset
2291 btfss neg_flag ; Depth lower then 1m?
heinrichsweikamp
parents:
diff changeset
2292 bra tft_depth2 ; Yes, display manual Zero
heinrichsweikamp
parents:
diff changeset
2293
heinrichsweikamp
parents:
diff changeset
2294 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2295 bsf ignore_digit4
heinrichsweikamp
parents:
diff changeset
2296 output_16 ; Full meters in Big font
heinrichsweikamp
parents:
diff changeset
2297 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2298 bra tft_depth3
heinrichsweikamp
parents:
diff changeset
2299
heinrichsweikamp
parents:
diff changeset
2300 tft_depth2:
153
heinrichsweikamp
parents: 151
diff changeset
2301 STRCAT "0" ; manual zero
0
heinrichsweikamp
parents:
diff changeset
2302
heinrichsweikamp
parents:
diff changeset
2303 tft_depth3:
heinrichsweikamp
parents:
diff changeset
2304 STRCAT_PRINT "" ; Display full meters
heinrichsweikamp
parents:
diff changeset
2305
heinrichsweikamp
parents:
diff changeset
2306 ; .1m in MEDIUM font
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2307 WIN_MEDIUM dm_depth_dm_column, dm_depth_dm_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2308
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2309 ; TODO - check if needed, depth should still be in hi:lo
0
heinrichsweikamp
parents:
diff changeset
2310 SAFE_2BYTE_COPY rel_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2311 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2312
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2313 TFT_color_code warn_depth ; Color-code the output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2314
0
heinrichsweikamp
parents:
diff changeset
2315 PUTC "."
heinrichsweikamp
parents:
diff changeset
2316 movlw HIGH d'30' ; Display 0.0m if lower then 30cm
heinrichsweikamp
parents:
diff changeset
2317 movwf sub_a+1
heinrichsweikamp
parents:
diff changeset
2318 movlw LOW d'30'
heinrichsweikamp
parents:
diff changeset
2319 movwf sub_a+0
heinrichsweikamp
parents:
diff changeset
2320 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2321 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2322 call subU16 ; sub_c = sub_a - sub_b
heinrichsweikamp
parents:
diff changeset
2323 btfss neg_flag ; Depth lower then 0.3m?
heinrichsweikamp
parents:
diff changeset
2324 bra depth_less_0.3mtr ; Yes, Show ".0" manually
heinrichsweikamp
parents:
diff changeset
2325
heinrichsweikamp
parents:
diff changeset
2326 movlw d'4'
heinrichsweikamp
parents:
diff changeset
2327 movwf ignore_digits
heinrichsweikamp
parents:
diff changeset
2328 bsf ignore_digit5
heinrichsweikamp
parents:
diff changeset
2329 output_16dp d'0'
heinrichsweikamp
parents:
diff changeset
2330 STRCAT_PRINT "" ; Display decimeters
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2331 bcf win_invert ; Reset invert flag
0
heinrichsweikamp
parents:
diff changeset
2332 WIN_FONT FT_SMALL
heinrichsweikamp
parents:
diff changeset
2333 return
heinrichsweikamp
parents:
diff changeset
2334
heinrichsweikamp
parents:
diff changeset
2335 depth_less_0.3mtr:
heinrichsweikamp
parents:
diff changeset
2336 STRCAT_PRINT "0" ; Display 0.0m manually
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2337 bcf win_invert ; Reset invert flag
0
heinrichsweikamp
parents:
diff changeset
2338 WIN_FONT FT_SMALL
heinrichsweikamp
parents:
diff changeset
2339 return
heinrichsweikamp
parents:
diff changeset
2340
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2341 depth_greater_99_84mtr: ; Display only in full meters
0
heinrichsweikamp
parents:
diff changeset
2342 btfss depth_greater_100m ; Is depth>100m already?
heinrichsweikamp
parents:
diff changeset
2343 rcall TFT_clear_depth ; No, clear depth area and set flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2344 TFT_color_code warn_depth
0
heinrichsweikamp
parents:
diff changeset
2345 ; Depth is already in hi:lo
heinrichsweikamp
parents:
diff changeset
2346 ; Show depth in Full meters
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2347 ; That means ignore digit 4 and 5
0
heinrichsweikamp
parents:
diff changeset
2348 lfsr FSR2,buffer
heinrichsweikamp
parents:
diff changeset
2349 bsf ignore_digit4
heinrichsweikamp
parents:
diff changeset
2350 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2351 output_16
heinrichsweikamp
parents:
diff changeset
2352 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2353 STRCAT_PRINT "" ; Display full meters only
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2354 bcf win_invert ; Reset invert flag
0
heinrichsweikamp
parents:
diff changeset
2355 WIN_FONT FT_SMALL
heinrichsweikamp
parents:
diff changeset
2356 return
heinrichsweikamp
parents:
diff changeset
2357
heinrichsweikamp
parents:
diff changeset
2358 TFT_clear_depth: ; No, clear depth area and set flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2359 WIN_BOX_BLACK dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
2360 bsf depth_greater_100m ; Set Flag
heinrichsweikamp
parents:
diff changeset
2361 return
heinrichsweikamp
parents:
diff changeset
2362
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2363 TFT_depth_blink:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2364 TSTOSS opt_modwarning ; 0=standard, 1=blink
303
9b1b0b32e7d5 Add configuration option to control depth warning blinking
janos_kovacs <kovjanos@gmail.com>
parents: 300
diff changeset
2365 return
9b1b0b32e7d5 Add configuration option to control depth warning blinking
janos_kovacs <kovjanos@gmail.com>
parents: 300
diff changeset
2366
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2367 ; check if previous cycle had the blinking warning or not
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2368 btfsc blinking_depth_prev ; did we have warning prev?
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2369 bra TFT_depth_blink_prevwarn ; Yes
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2370
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2371 ; No; check if it's set now
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2372 btfsc blinking_depth_warning ; do we have warning set now?
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2373 bra TFT_depth_blink_warn ; Yes - so we have warning now but not prev
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2374
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2375 ; no warning in previous cycle, no warning now, reset all flags
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2376 bcf blinking_depth_prev ; reset prev flag
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2377 bcf blinking_depth_toggle ; reset toggle
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2378 bcf win_invert
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2379 ; all done
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2380 return
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2381
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2382 TFT_depth_blink_prevwarn:
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2383 ; ...we had warning in previous cycle, check if we still have the warning set
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2384 btfss blinking_depth_warning ; do we still have the warning?
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2385 bra TFT_depth_blink_prevwarn_nowarn ; No, clear the depth area
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2386
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2387 ; we still have the warning, set previous flag for next cycle...
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2388 bsf blinking_depth_prev ; set prev flag
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2389 ; and set toggle and invert if required
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2390 btfss blinking_depth_toggle ; do we have the toggle set?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2391 bra TFT_depth_blink_set ; No: set inverse, do color_box, set flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2392 bra TFT_depth_blink_reset ; Yes: clear inverse, do black box, reset flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2393
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2394 TFT_depth_blink_prevwarn_nowarn:
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2395 ; we had warning, but not now... (e.g. ascended or switched to better gas)
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2396 ; reset the previous cycle flag for the next cycle...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2397 bcf blinking_depth_prev ; reset prev flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2398 ; clear it - just in case if we had a blinked before
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2399 bra TFT_depth_blink_reset ; Yes: clear inverse, do black box, reset flag
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2400
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2401 TFT_depth_blink_warn:
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2402 ; new blinking warning activated (had no warning in previous cycle)
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2403 bsf blinking_depth_prev ; set prev flag
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2404 ; set toggle and invert
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2405 bra TFT_depth_blink_set
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2406
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2407 TFT_depth_blink_set:
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2408 ; clear the area with color
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2409 movlw color_red ; that should not be hardcoded...
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2410 WIN_BOX_COLOR dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2411 ;set the invert color
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2412 bsf win_invert
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2413 ; set the toggle
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2414 bsf blinking_depth_toggle
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2415 ; all done
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2416 return
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2417
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2418 TFT_depth_blink_reset:
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2419 ; clear the area with black
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2420 WIN_BOX_BLACK dm_depth_row, dm_depth_bot, dm_depth_column, dm_depth_rgt ;top, bottom, left, right
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2421 ;reset the invert color
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2422 bcf win_invert
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2423 ; reset the toggle
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2424 bcf blinking_depth_toggle
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2425 ; if it's still warning...
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2426 btfsc blinking_depth_warning
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2427 call TFT_warnings_color
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2428 ; all done
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2429 return
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2430
0
heinrichsweikamp
parents:
diff changeset
2431 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2432
heinrichsweikamp
parents:
diff changeset
2433 global TFT_custom_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2434 TFT_custom_text: ; Show the custom text
0
heinrichsweikamp
parents:
diff changeset
2435 lfsr FSR0, opt_name ; Source
heinrichsweikamp
parents:
diff changeset
2436 WIN_SMALL surf_customtext_column,surf_customtext_row1 ; First row
heinrichsweikamp
parents:
diff changeset
2437 rcall TFT_custom_text_2 ; Show up to 12 chars and print
heinrichsweikamp
parents:
diff changeset
2438 incfsz lo,F ; Was lo=255?
heinrichsweikamp
parents:
diff changeset
2439 return ; No, all done.
heinrichsweikamp
parents:
diff changeset
2440 lfsr FSR0, opt_name+.12 ; Source
heinrichsweikamp
parents:
diff changeset
2441 WIN_SMALL surf_customtext_column,surf_customtext_row2 ; Second row
heinrichsweikamp
parents:
diff changeset
2442 rcall TFT_custom_text_2 ; Show up to 12 chars and print
heinrichsweikamp
parents:
diff changeset
2443 incfsz lo,F ; Was lo=255?
heinrichsweikamp
parents:
diff changeset
2444 return ; No, all done.
heinrichsweikamp
parents:
diff changeset
2445 lfsr FSR0, opt_name+.24 ; Source
heinrichsweikamp
parents:
diff changeset
2446 WIN_SMALL surf_customtext_column,surf_customtext_row3 ; Third row
heinrichsweikamp
parents:
diff changeset
2447 rcall TFT_custom_text_2 ; Show up to 12 chars and print
heinrichsweikamp
parents:
diff changeset
2448 incfsz lo,F ; Was lo=255?
heinrichsweikamp
parents:
diff changeset
2449 return ; No, all done.
heinrichsweikamp
parents:
diff changeset
2450 lfsr FSR0, opt_name+.36 ; Source
heinrichsweikamp
parents:
diff changeset
2451 WIN_SMALL surf_customtext_column,surf_customtext_row4 ; Forth row
heinrichsweikamp
parents:
diff changeset
2452 rcall TFT_custom_text_2 ; Show up to 12 chars and print
heinrichsweikamp
parents:
diff changeset
2453 incfsz lo,F ; Was lo=255?
heinrichsweikamp
parents:
diff changeset
2454 return ; No, all done.
heinrichsweikamp
parents:
diff changeset
2455 lfsr FSR0, opt_name+.48 ; Source
heinrichsweikamp
parents:
diff changeset
2456 WIN_SMALL surf_customtext_column,surf_customtext_row5 ; Fifth row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2457 bra TFT_custom_text_2 ; Show up to 12 chars and print ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2458
0
heinrichsweikamp
parents:
diff changeset
2459
heinrichsweikamp
parents:
diff changeset
2460 TFT_custom_text_2:
heinrichsweikamp
parents:
diff changeset
2461 lfsr FSR2, buffer ; destination
heinrichsweikamp
parents:
diff changeset
2462 movlw .12
heinrichsweikamp
parents:
diff changeset
2463 movwf lo ; length/line
heinrichsweikamp
parents:
diff changeset
2464 TFT_custom_text_3:
heinrichsweikamp
parents:
diff changeset
2465 movf POSTINC0,W ; Get byte
heinrichsweikamp
parents:
diff changeset
2466 bz TFT_custom_text_4 ; End if NULL
heinrichsweikamp
parents:
diff changeset
2467 movwf POSTINC2 ; NO: copy
heinrichsweikamp
parents:
diff changeset
2468 decfsz lo,F ; Max len reached ?
heinrichsweikamp
parents:
diff changeset
2469 bra TFT_custom_text_3 ; NO: loop
heinrichsweikamp
parents:
diff changeset
2470 setf lo ; lo=255 -> more to come
heinrichsweikamp
parents:
diff changeset
2471 TFT_custom_text_4:
heinrichsweikamp
parents:
diff changeset
2472 clrf POSTINC2 ; Mark end of string
heinrichsweikamp
parents:
diff changeset
2473 goto aa_wordprocessor ; print and return
heinrichsweikamp
parents:
diff changeset
2474
heinrichsweikamp
parents:
diff changeset
2475
heinrichsweikamp
parents:
diff changeset
2476 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2477
0
heinrichsweikamp
parents:
diff changeset
2478 global TFT_update_surf_press
heinrichsweikamp
parents:
diff changeset
2479 TFT_update_surf_press:
heinrichsweikamp
parents:
diff changeset
2480 WIN_SMALL surf_press_column,surf_press_row
heinrichsweikamp
parents:
diff changeset
2481 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2482 SAFE_2BYTE_COPY amb_pressure, lo
heinrichsweikamp
parents:
diff changeset
2483 movff lo,sub_a+0
heinrichsweikamp
parents:
diff changeset
2484 movff hi,sub_a+1
heinrichsweikamp
parents:
diff changeset
2485 movff last_surfpressure_30min+0,sub_b+0
heinrichsweikamp
parents:
diff changeset
2486 movff last_surfpressure_30min+1,sub_b+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2487 call subU16 ; sub_c = sub_a - sub_b
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2488 btfsc neg_flag ; Pressure lower?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2489 rcall update_surf_press2 ; Yes, test threshold
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2490 tstfsz sub_c+1 ; >255mbar difference?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2491 bra update_surf_press_common ; Yes, display!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2492 movlw d'11' ; 10mbar noise suppression
0
heinrichsweikamp
parents:
diff changeset
2493 subwf sub_c+0,W
heinrichsweikamp
parents:
diff changeset
2494 btfsc STATUS,C
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2495 bra update_surf_press_common ; Yes, display!
0
heinrichsweikamp
parents:
diff changeset
2496 SAFE_2BYTE_COPY last_surfpressure_30min, lo ; Overwrite with stable value...
heinrichsweikamp
parents:
diff changeset
2497 update_surf_press_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2498 movff lo,int_I_pres_surface+0 ; copy displayed value to C code to have pressure displayed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2499 movff hi,int_I_pres_surface+1 ; and pressure used for desaturation & no-fly time in sync
0
heinrichsweikamp
parents:
diff changeset
2500 output_16
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2501 ; Show only 4 digits
0
heinrichsweikamp
parents:
diff changeset
2502 movff buffer+1,buffer+0
heinrichsweikamp
parents:
diff changeset
2503 movff buffer+2,buffer+1
heinrichsweikamp
parents:
diff changeset
2504 movff buffer+3,buffer+2
heinrichsweikamp
parents:
diff changeset
2505 movff buffer+4,buffer+3
heinrichsweikamp
parents:
diff changeset
2506 movlw 0x00
heinrichsweikamp
parents:
diff changeset
2507 movff WREG,buffer+4
heinrichsweikamp
parents:
diff changeset
2508 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2509 call TFT_divemask_color
heinrichsweikamp
parents:
diff changeset
2510 WIN_SMALL surf_press_column+4*8,surf_press_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2511 STRCPY_TEXT_PRINT tMBAR ; mbar
0
heinrichsweikamp
parents:
diff changeset
2512 return
heinrichsweikamp
parents:
diff changeset
2513
heinrichsweikamp
parents:
diff changeset
2514 update_surf_press2:
heinrichsweikamp
parents:
diff changeset
2515 movff lo,sub_b+0
heinrichsweikamp
parents:
diff changeset
2516 movff hi,sub_b+1
heinrichsweikamp
parents:
diff changeset
2517 movff last_surfpressure_30min+0,sub_a+0
heinrichsweikamp
parents:
diff changeset
2518 movff last_surfpressure_30min+1,sub_a+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2519 goto subU16 ; sub_c = sub_a - sub_b ; and return...
0
heinrichsweikamp
parents:
diff changeset
2520
heinrichsweikamp
parents:
diff changeset
2521 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2522
heinrichsweikamp
parents:
diff changeset
2523 global TFT_update_batt_voltage
heinrichsweikamp
parents:
diff changeset
2524 TFT_update_batt_voltage:
heinrichsweikamp
parents:
diff changeset
2525 movff batt_percent,lo ; Get battery percent
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2526 TFT_color_code warn_battery ; Color-code battery percent
207
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2527 ; Setup charge indicator
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2528 btfsc cc_active
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2529 bsf win_invert
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2530 btfsc cc_active
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2531 movlw color_yellow
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2532 btfsc cv_active
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2533 movlw color_green
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2534 btfsc cc_active
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2535 call TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
2536 WIN_TINY batt_percent_column,batt_percent_row
heinrichsweikamp
parents:
diff changeset
2537 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2538 output_8
heinrichsweikamp
parents:
diff changeset
2539 bcf leftbind
88
2a992aba61ef fix minor display bug (battery percent)
heinrichsweikamp
parents: 87
diff changeset
2540 STRCAT "% "
2a992aba61ef fix minor display bug (battery percent)
heinrichsweikamp
parents: 87
diff changeset
2541 movlw 0x00
2a992aba61ef fix minor display bug (battery percent)
heinrichsweikamp
parents: 87
diff changeset
2542 movff WREG,buffer+4 ; Only "xxx%"
2a992aba61ef fix minor display bug (battery percent)
heinrichsweikamp
parents: 87
diff changeset
2543 STRCAT_PRINT ""
207
f5d909e03f52 charge indicator on surface screen
heinrichsweikamp
parents: 205
diff changeset
2544 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
2545 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2546 WIN_TINY batt_voltage_column,batt_voltage_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2547 movff battery_type,lo ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2548 PUTC "T"
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2549 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2550 output_8
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2551 PUTC ":"
0
heinrichsweikamp
parents:
diff changeset
2552 movff batt_voltage+0,lo
heinrichsweikamp
parents:
diff changeset
2553 movff batt_voltage+1,hi
heinrichsweikamp
parents:
diff changeset
2554 output_16dp .2
heinrichsweikamp
parents:
diff changeset
2555 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2556 PUTC 'V'
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2557 movff buffer+8,buffer+6
0
heinrichsweikamp
parents:
diff changeset
2558 movlw 0x00
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2559 movff WREG,buffer+7 ; Only "x.yV"
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 475
diff changeset
2560 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
2561 return
heinrichsweikamp
parents:
diff changeset
2562
heinrichsweikamp
parents:
diff changeset
2563 ;update_battery_debug:
heinrichsweikamp
parents:
diff changeset
2564 ; call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2565 ; WIN_TINY .70,.0
heinrichsweikamp
parents:
diff changeset
2566 ; movff battery_gauge+5,xC+3
heinrichsweikamp
parents:
diff changeset
2567 ; movff battery_gauge+4,xC+2
heinrichsweikamp
parents:
diff changeset
2568 ; movff battery_gauge+3,xC+1
heinrichsweikamp
parents:
diff changeset
2569 ; movff battery_gauge+2,xC+0
heinrichsweikamp
parents:
diff changeset
2570 ; ; battery_gauge:6 is nAs
heinrichsweikamp
parents:
diff changeset
2571 ; ; devide through 65536
heinrichsweikamp
parents:
diff changeset
2572 ; ; devide through 152
heinrichsweikamp
parents:
diff changeset
2573 ; ; Result is 0.01Ah in xC+1:xC+0
heinrichsweikamp
parents:
diff changeset
2574 ; movlw LOW .152
heinrichsweikamp
parents:
diff changeset
2575 ; movwf xB+0
heinrichsweikamp
parents:
diff changeset
2576 ; movlw HIGH .152
heinrichsweikamp
parents:
diff changeset
2577 ; movwf xB+1
heinrichsweikamp
parents:
diff changeset
2578 ; call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
heinrichsweikamp
parents:
diff changeset
2579 ; bsf leftbind
heinrichsweikamp
parents:
diff changeset
2580 ; movff xC+0,lo
heinrichsweikamp
parents:
diff changeset
2581 ; movff xC+1,hi
heinrichsweikamp
parents:
diff changeset
2582 ; output_16
heinrichsweikamp
parents:
diff changeset
2583 ; STRCAT_PRINT "x.01Ah"
heinrichsweikamp
parents:
diff changeset
2584 ; WIN_FONT FT_SMALL
heinrichsweikamp
parents:
diff changeset
2585 ; bcf leftbind
heinrichsweikamp
parents:
diff changeset
2586 ; return
heinrichsweikamp
parents:
diff changeset
2587
heinrichsweikamp
parents:
diff changeset
2588 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2589
heinrichsweikamp
parents:
diff changeset
2590 global TFT_convert_signed_16bit
heinrichsweikamp
parents:
diff changeset
2591 TFT_convert_signed_16bit:
heinrichsweikamp
parents:
diff changeset
2592 bcf neg_flag ; Positive temperature
heinrichsweikamp
parents:
diff changeset
2593 btfss hi,7 ; Negative temperature ?
heinrichsweikamp
parents:
diff changeset
2594 return ; No, return
heinrichsweikamp
parents:
diff changeset
2595 ; Yes, negative temperature!
heinrichsweikamp
parents:
diff changeset
2596 bsf neg_flag ; Negative temperature
heinrichsweikamp
parents:
diff changeset
2597 PUTC '-' ; Display "-"
heinrichsweikamp
parents:
diff changeset
2598 comf hi ; Then, 16bit sign changes.
heinrichsweikamp
parents:
diff changeset
2599 negf lo
heinrichsweikamp
parents:
diff changeset
2600 btfsc STATUS,C
heinrichsweikamp
parents:
diff changeset
2601 incf hi
heinrichsweikamp
parents:
diff changeset
2602 return ; and return
heinrichsweikamp
parents:
diff changeset
2603
heinrichsweikamp
parents:
diff changeset
2604 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2605
heinrichsweikamp
parents:
diff changeset
2606 global TFT_convert_date
heinrichsweikamp
parents:
diff changeset
2607 TFT_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
heinrichsweikamp
parents:
diff changeset
2608 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
heinrichsweikamp
parents:
diff changeset
2609 movwf EEDATA ; used as temp here
heinrichsweikamp
parents:
diff changeset
2610 tstfsz EEDATA
heinrichsweikamp
parents:
diff changeset
2611 bra TFT_convert_date1
heinrichsweikamp
parents:
diff changeset
2612 ; EEDATA was 0
heinrichsweikamp
parents:
diff changeset
2613 ; Use MMDDYY
heinrichsweikamp
parents:
diff changeset
2614 movff convert_value_temp+0,lo ;month
heinrichsweikamp
parents:
diff changeset
2615 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2616 output_99x
heinrichsweikamp
parents:
diff changeset
2617 PUTC '.'
heinrichsweikamp
parents:
diff changeset
2618 movff convert_value_temp+1,lo ;day
heinrichsweikamp
parents:
diff changeset
2619 bra TFT_convert_date1_common ;year
heinrichsweikamp
parents:
diff changeset
2620
heinrichsweikamp
parents:
diff changeset
2621 TFT_convert_date1: ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD)
heinrichsweikamp
parents:
diff changeset
2622 decfsz EEDATA,F
heinrichsweikamp
parents:
diff changeset
2623 bra TFT_convert_date2 ; EEDATA was 2
heinrichsweikamp
parents:
diff changeset
2624 ; EEDATA was 1
heinrichsweikamp
parents:
diff changeset
2625 ; Use DDMMYY
heinrichsweikamp
parents:
diff changeset
2626 movff convert_value_temp+1,lo ;day
heinrichsweikamp
parents:
diff changeset
2627 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2628 output_99x
heinrichsweikamp
parents:
diff changeset
2629 PUTC '.'
heinrichsweikamp
parents:
diff changeset
2630 movff convert_value_temp+0,lo ;month
heinrichsweikamp
parents:
diff changeset
2631
heinrichsweikamp
parents:
diff changeset
2632 TFT_convert_date1_common:
heinrichsweikamp
parents:
diff changeset
2633 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2634 output_99x
heinrichsweikamp
parents:
diff changeset
2635 PUTC '.'
heinrichsweikamp
parents:
diff changeset
2636 movff convert_value_temp+2,lo ;year
heinrichsweikamp
parents:
diff changeset
2637 output_99x
heinrichsweikamp
parents:
diff changeset
2638 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2639 return
heinrichsweikamp
parents:
diff changeset
2640
heinrichsweikamp
parents:
diff changeset
2641 TFT_convert_date2:
heinrichsweikamp
parents:
diff changeset
2642 ; Use YYMMDD
heinrichsweikamp
parents:
diff changeset
2643 movff convert_value_temp+2,lo ;year
heinrichsweikamp
parents:
diff changeset
2644 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2645 output_99x
heinrichsweikamp
parents:
diff changeset
2646 PUTC '.'
heinrichsweikamp
parents:
diff changeset
2647 movff convert_value_temp+0,lo ;month
heinrichsweikamp
parents:
diff changeset
2648 output_99x
heinrichsweikamp
parents:
diff changeset
2649 PUTC '.'
heinrichsweikamp
parents:
diff changeset
2650 movff convert_value_temp+1,lo ;day
heinrichsweikamp
parents:
diff changeset
2651 output_99x
heinrichsweikamp
parents:
diff changeset
2652 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2653 return
heinrichsweikamp
parents:
diff changeset
2654
heinrichsweikamp
parents:
diff changeset
2655 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2656
heinrichsweikamp
parents:
diff changeset
2657 global TFT_convert_date_short
heinrichsweikamp
parents:
diff changeset
2658 TFT_convert_date_short: ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2
heinrichsweikamp
parents:
diff changeset
2659 movff opt_dateformat,WREG ; =0:MMDDYY, =1:DDMMYY, =2:YYMMDD
heinrichsweikamp
parents:
diff changeset
2660 movwf EEDATA ; used as temp here
heinrichsweikamp
parents:
diff changeset
2661 tstfsz EEDATA
heinrichsweikamp
parents:
diff changeset
2662 bra TFT_convert_date_short1
heinrichsweikamp
parents:
diff changeset
2663 ; EEDATA was 0
heinrichsweikamp
parents:
diff changeset
2664 ; Use MMDDYY
heinrichsweikamp
parents:
diff changeset
2665 TFT_convert_date_short_common:
heinrichsweikamp
parents:
diff changeset
2666 movff convert_value_temp+0,lo ;month
heinrichsweikamp
parents:
diff changeset
2667 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2668 output_99x
heinrichsweikamp
parents:
diff changeset
2669 PUTC '.'
heinrichsweikamp
parents:
diff changeset
2670 movff convert_value_temp+1,lo ;day
heinrichsweikamp
parents:
diff changeset
2671 output_99x
heinrichsweikamp
parents:
diff changeset
2672 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2673 return
heinrichsweikamp
parents:
diff changeset
2674
heinrichsweikamp
parents:
diff changeset
2675 TFT_convert_date_short1:
heinrichsweikamp
parents:
diff changeset
2676 decfsz EEDATA,F
heinrichsweikamp
parents:
diff changeset
2677 bra TFT_convert_date_short_common ; EEDATA was 2 -> Use YYMMDD
heinrichsweikamp
parents:
diff changeset
2678 ; EEDATA was 1
heinrichsweikamp
parents:
diff changeset
2679 ; Use DDMMYY
heinrichsweikamp
parents:
diff changeset
2680 movff convert_value_temp+1,lo ;day
heinrichsweikamp
parents:
diff changeset
2681 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2682 output_99x
heinrichsweikamp
parents:
diff changeset
2683 PUTC '.'
heinrichsweikamp
parents:
diff changeset
2684 movff convert_value_temp+0,lo ;month
heinrichsweikamp
parents:
diff changeset
2685 output_99x
heinrichsweikamp
parents:
diff changeset
2686 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2687 return
heinrichsweikamp
parents:
diff changeset
2688
heinrichsweikamp
parents:
diff changeset
2689 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2690
heinrichsweikamp
parents:
diff changeset
2691 global TFT_date
heinrichsweikamp
parents:
diff changeset
2692 TFT_date:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2693 WIN_SMALL surf_date_column,surf_date_row ; Init new Wordprocessor
0
heinrichsweikamp
parents:
diff changeset
2694 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2695 movff month,convert_value_temp+0
heinrichsweikamp
parents:
diff changeset
2696 movff day,convert_value_temp+1
heinrichsweikamp
parents:
diff changeset
2697 movff year,convert_value_temp+2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2698 call TFT_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
0
heinrichsweikamp
parents:
diff changeset
2699 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2700 return
heinrichsweikamp
parents:
diff changeset
2701
heinrichsweikamp
parents:
diff changeset
2702 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2703
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2704 global TFT_max_depth_alternative
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2705 TFT_max_depth_alternative:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2706 bcf FLAG_TFT_max_depth_alt
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2707 ; The "mask"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2708 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2709 WIN_TINY dm_mask_depth_column, dm_max_alt_row-.14
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2710 STRCPY_TEXT_PRINT tMaxDepth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2711
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2712 ; The max. depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2713 SAFE_2BYTE_COPY max_pressure, lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2714 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2715 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2716 TSTOSS opt_units ; 0=m, 1=ft
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2717 bra TFT_max_depth_alt_metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2718 ;TFT_max_depth_alt_imperial:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2719 TFT_max_depth_alt_metric:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2720 WIN_LARGE dm_max_alt_column,dm_max_alt_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2721 bsf ignore_digit4 ; no 0.1m
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2722 output_16
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2723 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2724
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2725 WIN_MEDIUM dm_max_dm_alt_column,dm_max_alt_row+.25
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2726 SAFE_2BYTE_COPY max_pressure, lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2727 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2728 PUTC "."
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2729 movlw d'4'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2730 movwf ignore_digits
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2731 bsf ignore_digit5
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2732 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2733 output_16dp d'0'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2734 STRCAT_PRINT "" ; Display decimeters
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2735 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2736 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2737
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2738
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2739 global TFT_max_depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2740 TFT_max_depth:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2741 bcf FLAG_TFT_max_depth
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2742 btfsc FLAG_apnoe_mode ; different display in apnoe mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2743 bra TFT_max_depth_apnoe
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2744 TFT_max_depth2:
0
heinrichsweikamp
parents:
diff changeset
2745 SAFE_2BYTE_COPY max_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2746 TFT_max_depth3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2747 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2748 TSTOSS opt_units ; 0=m, 1=ft
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2749 bra TFT_max_depth2_metric
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2750 ;TFT_max_depth2_imperial:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2751 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2752 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2753 TSTOSS opt_vsigraph ; 0=skip, 1=draw
332
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2754 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
0
heinrichsweikamp
parents:
diff changeset
2755 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2756 output_16_3
heinrichsweikamp
parents:
diff changeset
2757 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2758 return
heinrichsweikamp
parents:
diff changeset
2759
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2760 TFT_max_depth2_metric:
332
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2761 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2762 TSTOSS opt_vsigraph ; 0=skip, 1=draw
332
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2763 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
309
efb53af0d62a VSIbar #1: layout position changes
janos_kovacs <kovjanos@gmail.com>
parents: 307
diff changeset
2764 call TFT_standard_color
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2765
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2766 movlw .039
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2767 cpfslt hi
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2768 bra max_depth_greater_99_84mtr
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2769
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2770 btfsc max_depth_greater_100m ; Was depth>100m during last call
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2771 rcall TFT_clear_max_depth ; Yes, clear depth area
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2772 bcf max_depth_greater_100m ; Do this once only...
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2773
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2774 movlw .039
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2775 cpfslt hi
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2776 bra max_depth_greater_99_84mtr
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2777
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2778 movlw HIGH d'1000'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2779 movwf sub_a+1
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2780 movlw LOW d'1000'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2781 movwf sub_a+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2782 movff hi,sub_b+1
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2783 movff lo,sub_b+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2784 incf sub_b+0,F
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2785 movlw d'0'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2786 addwfc sub_b+1,F ; Add 1mbar offset
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2787 call sub16 ; sub_c = sub_a - sub_b
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2788 movlw ' '
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2789 btfss neg_flag ; Depth lower then 10m?
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2790 movwf POSTINC2 ; Yes, add extra space
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2791
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2792 clrf sub_a+1
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2793 movlw d'99'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2794 movwf sub_a+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2795 movff hi,sub_b+1
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2796 movff lo,sub_b+0
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2797 call subU16 ; sub_c = sub_a - sub_b
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2798 btfss neg_flag ; Depth lower then 1m?
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2799 bra tft_max_depth2 ; Yes, display manual Zero
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2800
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2801 bsf ignore_digit4 ; no 0.1m
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2802 bsf leftbind
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2803 output_16
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2804 bra tft_max_depth3
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2805
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2806 tft_max_depth2:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2807 WIN_MEDIUM dm_max_depth_column, dm_max_depth_row
332
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2808 TSTOSS opt_vsigraph ; 0=skip, 1=draw
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2809 WIN_MEDIUM dm_max_depth_column_nvsi, dm_max_depth_row
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2810 STRCAT "0"
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2811
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2812 tft_max_depth3:
0
heinrichsweikamp
parents:
diff changeset
2813 call TFT_standard_color
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2814 STRCAT_PRINT "" ; Display full meters
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2815 bcf leftbind
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2816
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2817 ; .1m in SMALL font
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2818 WIN_SMALL dm_max_depth_dm_column, dm_max_depth_dm_row
332
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2819 TSTOSS opt_vsigraph ; 0=skip, 1=draw
0ff81ff290ce Fix positions if no VSI Bar displayed
Janos Kovacs <kovjanos@gmail.com>
parents: 328
diff changeset
2820 WIN_SMALL dm_max_depth_dm_column_nvsi, dm_max_depth_dm_row
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2821
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2822 SAFE_2BYTE_COPY max_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2823 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2824
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2825 PUTC "."
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2826
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2827 movlw d'4'
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2828 movwf ignore_digits
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2829 bsf ignore_digit5
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2830 bsf leftbind
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2831 output_16dp d'0'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2832 STRCAT_PRINT "" ; Display decimeters
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2833 bcf leftbind
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2834 return
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2835
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2836 max_depth_greater_99_84mtr: ; Display only in full meters
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2837 btfss max_depth_greater_100m ; Is max depth>100m already?
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2838 rcall TFT_clear_max_depth ; No, clear max depth area and set flag
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2839 ; Max. Depth is already in hi:lo
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2840 ; Show max. depth in Full meters
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2841 ; That means ignore figure 4 and 5
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2842 lfsr FSR2,buffer
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2843 bsf ignore_digit4
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2844 bsf leftbind
0
heinrichsweikamp
parents:
diff changeset
2845 output_16
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2846 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2847 STRCAT_PRINT "" ; Display full meters only
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2848 WIN_FONT FT_SMALL
0
heinrichsweikamp
parents:
diff changeset
2849 return
heinrichsweikamp
parents:
diff changeset
2850
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2851 TFT_clear_max_depth: ; No, clear max. depth area and set flag
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2852 WIN_BOX_BLACK dm_max_depth_row, dm_max_depth_bot, dm_max_depth_column, dm_max_depth_rgt ;top, bottom, left, right
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2853 bsf max_depth_greater_100m ; Set Flag
11
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2854 return
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2855
04794990b619 Show Max. Depth with 0.1m precision
heinrichsweikamp
parents: 0
diff changeset
2856
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2857 TFT_max_depth_apnoe:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2858 btfss FLAG_active_descent ; Are we descending?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2859 bra TFT_max_depth2 ; Yes, show normal max.
0
heinrichsweikamp
parents:
diff changeset
2860 SAFE_2BYTE_COPY apnoe_max_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2861 bra TFT_max_depth3 ; Show apnoe_max_pressure as max. depth
0
heinrichsweikamp
parents:
diff changeset
2862
heinrichsweikamp
parents:
diff changeset
2863 global TFT_display_apnoe_last_max
heinrichsweikamp
parents:
diff changeset
2864 TFT_display_apnoe_last_max:
heinrichsweikamp
parents:
diff changeset
2865 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2866 WIN_TINY dm_apnoe_last_max_depth_text_col, dm_apnoe_last_max_depth_text_row
0
heinrichsweikamp
parents:
diff changeset
2867 STRCPY_TEXT_PRINT tApnoeMax
heinrichsweikamp
parents:
diff changeset
2868
heinrichsweikamp
parents:
diff changeset
2869 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2870 SAFE_2BYTE_COPY max_pressure, lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2871 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mbar]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2872 TSTOSS opt_units ; 0=m, 1=ft
0
heinrichsweikamp
parents:
diff changeset
2873 bra TFT_display_apnoe_last_m_metric
heinrichsweikamp
parents:
diff changeset
2874 ;TFT_display_apnoe_last_max_imperial
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2875 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2876 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
0
heinrichsweikamp
parents:
diff changeset
2877 output_16
heinrichsweikamp
parents:
diff changeset
2878 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2879 return
heinrichsweikamp
parents:
diff changeset
2880
heinrichsweikamp
parents:
diff changeset
2881 TFT_display_apnoe_last_m_metric:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2882 WIN_MEDIUM dm_apnoe_last_max_depth_column, dm_apnoe_last_max_depth_row
0
heinrichsweikamp
parents:
diff changeset
2883 bsf ignore_digit5 ; do not display 1cm depth
heinrichsweikamp
parents:
diff changeset
2884 output_16dp d'3'
heinrichsweikamp
parents:
diff changeset
2885 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2886 return
heinrichsweikamp
parents:
diff changeset
2887
heinrichsweikamp
parents:
diff changeset
2888 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2889
0
heinrichsweikamp
parents:
diff changeset
2890 global TFT_divemins
heinrichsweikamp
parents:
diff changeset
2891 TFT_divemins:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2892 bcf FLAG_TFT_divemins ; Clear flag
0
heinrichsweikamp
parents:
diff changeset
2893 movff divemins+0,lo
heinrichsweikamp
parents:
diff changeset
2894 movff divemins+1,hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2895
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2896 ; Already showing divemins > 99min
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2897 btfsc no_more_divesecs ; Ignore seconds?
0
heinrichsweikamp
parents:
diff changeset
2898 bra TFT_divemins2 ; Show minutes only
heinrichsweikamp
parents:
diff changeset
2899
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2900 tstfsz hi ; hi = 0?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2901 bra TFT_divemins_clr ; No, show mins only
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2902
0
heinrichsweikamp
parents:
diff changeset
2903 movlw .99
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2904 cpfsgt lo ; bigger than 99?
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2905 bra TFT_divemins1 ; No show mins:secs
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2906
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2907 TFT_divemins_clr:
0
heinrichsweikamp
parents:
diff changeset
2908 ; Yes, remove second display for the rest of the dive and clear seconds
heinrichsweikamp
parents:
diff changeset
2909 bsf no_more_divesecs ; Set flag
heinrichsweikamp
parents:
diff changeset
2910 ; Clear rest of seconds
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2911 WIN_BOX_BLACK dm_divetime_row, dm_divetime_bot, dm_divetime_column, dm_divetime_rgt ;top, bottom, left, right
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2912 bra TFT_divemins2 ; Show minutes only
0
heinrichsweikamp
parents:
diff changeset
2913
heinrichsweikamp
parents:
diff changeset
2914 TFT_divemins1:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2915 ; Print out the minutes, up to 99min, only 2chars !
0
heinrichsweikamp
parents:
diff changeset
2916 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2917 WIN_MEDIUM dm_divetime_column, dm_divetime_row
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2918 output_99 ; displays only last two figures from a 8Bit value (0-99)
0
heinrichsweikamp
parents:
diff changeset
2919 STRCAT_PRINT "" ; Show minutes in large font
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2920
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2921 ; Print out the seconds
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2922 WIN_SMALL dm_divetime_secs_column, dm_divetime_secs_row ; left position for two sec figures
0
heinrichsweikamp
parents:
diff changeset
2923 PUTC ':'
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2924 bsf leftbind
0
heinrichsweikamp
parents:
diff changeset
2925 movff divesecs,lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2926 output_99x ; displays only last two figures from a 8Bit value with leading zero (00-99)
0
heinrichsweikamp
parents:
diff changeset
2927 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2928 STRCAT_PRINT "" ; Show seconds in small font
heinrichsweikamp
parents:
diff changeset
2929 return
heinrichsweikamp
parents:
diff changeset
2930
heinrichsweikamp
parents:
diff changeset
2931 TFT_divemins2:
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2932 ; Full minutes only
0
heinrichsweikamp
parents:
diff changeset
2933 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2934 WIN_MEDIUM dm_divetime_minsonly_column, dm_divetime_row
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2935 bcf leftbind
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2936 output_16_4
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2937 STRCAT_PRINT "" ; Show minutes in large font
405
08fea401be24 BUGFIX: Divetime >99mins was not displayed (Only OSTC2 with serial >= )
heinrichsweikamp
parents: 399
diff changeset
2938 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2939
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2940 global TFT_divemins_alternative
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2941 TFT_divemins_alternative:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2942 bcf FLAG_TFT_divemins ; Clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2943 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2944 ; Print out the minutes (0-999) in large
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2945 WIN_LARGE dm_divetime_alt_column, dm_divetime_alt_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2946 movff divemins+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2947 movff divemins+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2948 output_16_3 ; limit to 999 and display only (0-999)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2949 STRCAT_PRINT "" ; Show minutes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2950 ; Print out the seconds in medium
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2951 WIN_MEDIUM dm_divetime_alt_column+.60, dm_divetime_alt_row+.25
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2952 PUTC ":"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2953 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2954 movff divesecs,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2955 output_99x ; displays only last two figures from a 8Bit value with leading zero (00-99)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2956 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2957 STRCAT_PRINT "" ; Show seconds in small font
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2958 return
0
heinrichsweikamp
parents:
diff changeset
2959
heinrichsweikamp
parents:
diff changeset
2960 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2961
0
heinrichsweikamp
parents:
diff changeset
2962 global TFT_display_apnoe_surface
heinrichsweikamp
parents:
diff changeset
2963 TFT_display_apnoe_surface:
heinrichsweikamp
parents:
diff changeset
2964 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2965 WIN_TINY dm_apnoe_surface_time_text_col, dm_apnoe_surface_time_text_row
0
heinrichsweikamp
parents:
diff changeset
2966 STRCPY_TEXT_PRINT tApnoeSurface
heinrichsweikamp
parents:
diff changeset
2967
heinrichsweikamp
parents:
diff changeset
2968 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2969 WIN_MEDIUM dm_apnoe_surface_time_column, dm_apnoe_surface_time_row
0
heinrichsweikamp
parents:
diff changeset
2970 movff apnoe_surface_mins,lo
heinrichsweikamp
parents:
diff changeset
2971 output_8
heinrichsweikamp
parents:
diff changeset
2972 PUTC ':'
heinrichsweikamp
parents:
diff changeset
2973 movff apnoe_surface_secs,lo
heinrichsweikamp
parents:
diff changeset
2974 output_99x
heinrichsweikamp
parents:
diff changeset
2975 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
2976 return
heinrichsweikamp
parents:
diff changeset
2977
heinrichsweikamp
parents:
diff changeset
2978 global TFT_apnoe_clear_surface
heinrichsweikamp
parents:
diff changeset
2979 TFT_apnoe_clear_surface:
heinrichsweikamp
parents:
diff changeset
2980 ; Clear Surface timer....
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2981 WIN_BOX_BLACK dm_apnoe_surface_time_text_row, .239, dm_apnoe_surface_time_text_col, .159 ;top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
2982 return
heinrichsweikamp
parents:
diff changeset
2983
heinrichsweikamp
parents:
diff changeset
2984 global TFT_display_apnoe_descent
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2985 TFT_display_apnoe_descent: ; Descent divetime
0
heinrichsweikamp
parents:
diff changeset
2986 movff apnoe_mins,lo
heinrichsweikamp
parents:
diff changeset
2987 clrf hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
2988 WIN_MEDIUM dm_divetime_apnoe_column, dm_divetime_apnoe_row
0
heinrichsweikamp
parents:
diff changeset
2989 output_16_3 ; displays only last three figures from a 16Bit value (0-999)
heinrichsweikamp
parents:
diff changeset
2990 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
2991 STRCAT_PRINT "" ; Show minutes in large font
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
2992 WIN_SMALL dm_divetime_apnoe_secs_column, dm_divetime_apnoe_secs_row ; left position for two sec figures
0
heinrichsweikamp
parents:
diff changeset
2993 PUTC ':'
heinrichsweikamp
parents:
diff changeset
2994 bsf leftbind
heinrichsweikamp
parents:
diff changeset
2995 movff apnoe_secs,lo
heinrichsweikamp
parents:
diff changeset
2996 output_99x
heinrichsweikamp
parents:
diff changeset
2997 bcf leftbind
heinrichsweikamp
parents:
diff changeset
2998 STRCAT_PRINT "" ; Show seconds in small font
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
2999
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3000 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3001 WIN_TINY dm_total_apnoe_text_column,dm_total_apnoe_text_row
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3002 STRCPY_TEXT_PRINT tApnoeTotal
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3003 call TFT_standard_color
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3004 movff divemins,lo
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3005 clrf hi
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3006 WIN_MEDIUM dm_apnoe_total_divetime_column, dm_apnoe_total_divetime_row
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3007 output_16_3 ; displays only last three figures from a 16Bit value (0-999)
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3008 call TFT_standard_color
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3009 STRCAT_PRINT "" ; Show minutes in large font
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3010 WIN_SMALL dm_apnoe_total_divetime_secs_col, dm_apnoe_total_divetime_secs_row ; left position for two sec figures
38
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3011 PUTC ':'
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3012 bsf leftbind
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3013 movff divesecs,lo
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3014 output_99x
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3015 bcf leftbind
64976f1e0a1c Show total divetime in apnea mode
mh@mh-THINK.fritz.box
parents: 31
diff changeset
3016 STRCAT_PRINT "" ; Show seconds in small font
0
heinrichsweikamp
parents:
diff changeset
3017 return
heinrichsweikamp
parents:
diff changeset
3018
heinrichsweikamp
parents:
diff changeset
3019 ;=============================================================================
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 262
diff changeset
3020 ; Writes ostc #Serial and Firmware version in splash screen
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3021
0
heinrichsweikamp
parents:
diff changeset
3022 global TFT_serial
heinrichsweikamp
parents:
diff changeset
3023 TFT_serial:
213
3b5df65d53fc layout changes
heinrichsweikamp
parents: 207
diff changeset
3024 WIN_TINY .5,.225
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3025 STRCPY "OSTC" ; Won't translate that...
260
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3026
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3027 movlw 0x0A
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3028 cpfseq hardware_flag
200
dcd513840c6c cleanup
heinrichsweikamp
parents: 192
diff changeset
3029 bra TFT_serial2
dcd513840c6c cleanup
heinrichsweikamp
parents: 192
diff changeset
3030 STRCAT "3 #"
260
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3031 bra TFT_serial_common
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3032 TFT_serial2:
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3033 movlw 0x05
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3034 cpfseq hardware_flag
200
dcd513840c6c cleanup
heinrichsweikamp
parents: 192
diff changeset
3035 bra TFT_serial3
dcd513840c6c cleanup
heinrichsweikamp
parents: 192
diff changeset
3036 STRCAT " cR #"
260
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3037 bra TFT_serial_common
200
dcd513840c6c cleanup
heinrichsweikamp
parents: 192
diff changeset
3038 TFT_serial3:
260
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3039 movlw 0x11
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3040 cpfseq hardware_flag
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3041 bra TFT_serial4
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3042 STRCAT "2 #"
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3043 bra TFT_serial_common
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3044 TFT_serial4:
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3045 movlw 0x1A
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3046 cpfseq hardware_flag
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3047 bra TFT_serial5
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3048 STRCAT "3 #"
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3049 ; bra TFT_serial_common
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3050 TFT_serial5:
e1cd6848863d increase immunity against false Qi data
heinrichsweikamp
parents: 256
diff changeset
3051 TFT_serial_common:
0
heinrichsweikamp
parents:
diff changeset
3052 rcall TFT_cat_serial
heinrichsweikamp
parents:
diff changeset
3053 STRCAT " v"
180
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3054 WIN_COLOR color_greenish
0
heinrichsweikamp
parents:
diff changeset
3055 rcall TFT_cat_firmware
heinrichsweikamp
parents:
diff changeset
3056
heinrichsweikamp
parents:
diff changeset
3057 ifdef __DEBUG
heinrichsweikamp
parents:
diff changeset
3058 movlw color_grey ; Write header in blue when
heinrichsweikamp
parents:
diff changeset
3059 call TFT_set_color ; compiled in DEBUG mode...
heinrichsweikamp
parents:
diff changeset
3060 STRCAT_PRINT "DEBUG"
heinrichsweikamp
parents:
diff changeset
3061 else
76
a5ea132770db 1.21 release
heinrichsweikamp
parents: 67
diff changeset
3062 STRCAT_PRINT ""
189
e79bc535ef9e ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents: 188
diff changeset
3063 bcf win_invert ; Reset invert flag
0
heinrichsweikamp
parents:
diff changeset
3064 call TFT_standard_color
76
a5ea132770db 1.21 release
heinrichsweikamp
parents: 67
diff changeset
3065
0
heinrichsweikamp
parents:
diff changeset
3066 movlw softwareversion_beta ; =1: Beta, =0: Release
heinrichsweikamp
parents:
diff changeset
3067 decfsz WREG,F
heinrichsweikamp
parents:
diff changeset
3068 return ; Release version -> Return
heinrichsweikamp
parents:
diff changeset
3069
heinrichsweikamp
parents:
diff changeset
3070 call TFT_warnings_color
heinrichsweikamp
parents:
diff changeset
3071 WIN_LEFT .160-4*9/2 ; Right pad.
heinrichsweikamp
parents:
diff changeset
3072 STRCPY_TEXT_PRINT tBeta
heinrichsweikamp
parents:
diff changeset
3073 endif
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3074 call TFT_standard_color
551
33941d158069 Clear win_invert flag for all calls of TFT_cat_firmware
heinrichsweikamp
parents: 545
diff changeset
3075 bcf win_invert
33941d158069 Clear win_invert flag for all calls of TFT_cat_firmware
heinrichsweikamp
parents: 545
diff changeset
3076 return
0
heinrichsweikamp
parents:
diff changeset
3077
heinrichsweikamp
parents:
diff changeset
3078
heinrichsweikamp
parents:
diff changeset
3079 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
3080 ; For the Information menu: append firmware x.yy version.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3081
0
heinrichsweikamp
parents:
diff changeset
3082 global info_menu_firmware
heinrichsweikamp
parents:
diff changeset
3083 extern tFirmware
heinrichsweikamp
parents:
diff changeset
3084 info_menu_firmware:
heinrichsweikamp
parents:
diff changeset
3085 lfsr FSR1,tFirmware
heinrichsweikamp
parents:
diff changeset
3086 call strcat_text
180
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3087 rcall TFT_cat_firmware
458
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3088 ; Show language version
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3089 IFNDEF french_italian
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3090 STRCAT "_en+de"
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3091 ELSE
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3092 STRCAT "_fr+it"
b86f86ec570e show language version in information menu
heinrichsweikamp
parents: 454
diff changeset
3093 ENDIF
189
e79bc535ef9e ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents: 188
diff changeset
3094 bcf win_invert ; Reset invert flag
180
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3095 return
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3096
76
a5ea132770db 1.21 release
heinrichsweikamp
parents: 67
diff changeset
3097 global TFT_cat_firmware
0
heinrichsweikamp
parents:
diff changeset
3098 TFT_cat_firmware:
heinrichsweikamp
parents:
diff changeset
3099 movlw softwareversion_x
heinrichsweikamp
parents:
diff changeset
3100 movwf lo
heinrichsweikamp
parents:
diff changeset
3101 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3102 output_8
heinrichsweikamp
parents:
diff changeset
3103 PUTC '.'
heinrichsweikamp
parents:
diff changeset
3104 movlw softwareversion_y
heinrichsweikamp
parents:
diff changeset
3105 movwf lo
heinrichsweikamp
parents:
diff changeset
3106 output_99x
heinrichsweikamp
parents:
diff changeset
3107 bcf leftbind
180
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3108 ; Check firmware date
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3109 movlw firmware_expire_year-.1
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3110 cpfsgt year ; > threshold?
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3111 return
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3112 movlw firmware_expire_month-.1
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3113 cpfsgt month ; > threshold?
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3114 return
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3115 movlw firmware_expire_day-.1
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3116 cpfsgt day ; > threshold?
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3117 return
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3118
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3119 ; Show in "change firmware" style
abc429e8b46a 1.60 work...
heinrichsweikamp
parents: 175
diff changeset
3120 movlw color_yellow
428
eccae727702f some cleanup
heinrichsweikamp
parents: 413
diff changeset
3121 bcf win_invert
eccae727702f some cleanup
heinrichsweikamp
parents: 413
diff changeset
3122 goto TFT_set_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
3123
heinrichsweikamp
parents:
diff changeset
3124 ;-----------------------------------------------------------------------------
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 262
diff changeset
3125 ; For the Information menu: append serial number
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3126
0
heinrichsweikamp
parents:
diff changeset
3127 global info_menu_serial
heinrichsweikamp
parents:
diff changeset
3128 extern tSerial
heinrichsweikamp
parents:
diff changeset
3129 info_menu_serial:
heinrichsweikamp
parents:
diff changeset
3130 lfsr FSR1,tSerial
heinrichsweikamp
parents:
diff changeset
3131 call strcat_text
76
a5ea132770db 1.21 release
heinrichsweikamp
parents: 67
diff changeset
3132 global TFT_cat_serial
0
heinrichsweikamp
parents:
diff changeset
3133 TFT_cat_serial:
heinrichsweikamp
parents:
diff changeset
3134 clrf EEADRH
heinrichsweikamp
parents:
diff changeset
3135 clrf EEADR ; Get Serial number LOW
heinrichsweikamp
parents:
diff changeset
3136 call read_eeprom ; read byte
heinrichsweikamp
parents:
diff changeset
3137 movff EEDATA,lo
heinrichsweikamp
parents:
diff changeset
3138 incf EEADR,F ; Get Serial number HIGH
heinrichsweikamp
parents:
diff changeset
3139 call read_eeprom ; read byte
heinrichsweikamp
parents:
diff changeset
3140 movff EEDATA,hi
heinrichsweikamp
parents:
diff changeset
3141
heinrichsweikamp
parents:
diff changeset
3142 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3143 output_16
heinrichsweikamp
parents:
diff changeset
3144 bcf leftbind
heinrichsweikamp
parents:
diff changeset
3145 return
heinrichsweikamp
parents:
diff changeset
3146
heinrichsweikamp
parents:
diff changeset
3147 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
3148 ; For the Information menu: Append total dives
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3149
0
heinrichsweikamp
parents:
diff changeset
3150 global info_menu_total_dives
heinrichsweikamp
parents:
diff changeset
3151 extern tTotalDives
heinrichsweikamp
parents:
diff changeset
3152 info_menu_total_dives:
heinrichsweikamp
parents:
diff changeset
3153 lfsr FSR1,tTotalDives
heinrichsweikamp
parents:
diff changeset
3154 call strcat_text
heinrichsweikamp
parents:
diff changeset
3155 TFT_cat_total_dives:
heinrichsweikamp
parents:
diff changeset
3156 read_int_eeprom .2
heinrichsweikamp
parents:
diff changeset
3157 movff EEDATA,lo
heinrichsweikamp
parents:
diff changeset
3158 read_int_eeprom .3
heinrichsweikamp
parents:
diff changeset
3159 movff EEDATA,hi
heinrichsweikamp
parents:
diff changeset
3160 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3161 output_16
heinrichsweikamp
parents:
diff changeset
3162 bcf leftbind
heinrichsweikamp
parents:
diff changeset
3163 return
heinrichsweikamp
parents:
diff changeset
3164
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3165 ; For the Information menu: Append battery voltage
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3166 global info_menu_battery_volts
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3167 extern tBatteryV
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3168 info_menu_battery_volts:
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3169 lfsr FSR1,tBatteryV
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3170 call strcat_text
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3171 movff batt_voltage+1,hi
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3172 movff batt_voltage+0,lo
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3173 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3174 output_16dp .2 ; x.xxx
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3175 STRCAT "V(T"
472
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 471
diff changeset
3176 movff battery_type,lo ; =0:1.5V, =1:3,6V Saft, =2:LiIon 3,7V/0.8Ah, =3:LiIon 3,7V/3.1Ah, =4: LiIon 3,7V/2.3Ah
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 471
diff changeset
3177 output_8
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3178 bcf leftbind
472
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 471
diff changeset
3179 PUTC ")"
62
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3180 return
e7c7c7eeea58 show battery voltage in info menu
heinrichsweikamp
parents: 60
diff changeset
3181
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3182 ; For the Information menu: Append Uptime
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3183 global info_menu_uptime
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3184 extern tUptime
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3185 info_menu_uptime:
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3186 lfsr FSR1,tUptime
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3187 call strcat_text
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3188 movff uptime+0,xC+0
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3189 movff uptime+1,xC+1
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3190 movff uptime+2,xC+2
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3191 movff uptime+3,xC+3
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3192 movlw LOW .3600
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3193 movwf xB+0
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3194 movlw HIGH .3600
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3195 movwf xB+1 ; One day = 3600s
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3196 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3197 ;xC+0:xC+1 -> Full hours
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3198 movff xC+1,xA+1
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3199 movff xC+0,xA+0
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3200 clrf xB+1
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3201 movlw .24
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3202 movwf xB+0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3203 call div16x16 ; xA/xB=xC with xA+0 as remainder
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3204 movff xC+0,lo
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3205 movff xC+1,hi ; Full days
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3206 bsf leftbind
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3207 output_16
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3208 PUTC "d"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3209 movff xA+0,lo ; Full hours
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3210 output_8
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3211 PUTC "h"
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3212 bcf leftbind
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3213 return ; Done.
544
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3214
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3215 extern tCalX,tCalY,tCalZ
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3216 global menu_cal_x
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3217 menu_cal_x:
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3218 lfsr FSR1,tCalX
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3219 call strcat_text
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3220 movff compass_CX_f+0,lo
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3221 movff compass_CX_f+1,hi
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3222 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3223 bsf leftbind
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3224 output_16
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3225 bcf leftbind
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3226 return
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3227
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3228 global menu_cal_y
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3229 menu_cal_y:
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3230 lfsr FSR1,tCalY
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3231 call strcat_text
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3232 movff compass_CY_f+0,lo
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3233 movff compass_CY_f+1,hi
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3234 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3235 bsf leftbind
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3236 output_16
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3237 bcf leftbind
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3238 return
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3239
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3240 global menu_cal_z
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3241 menu_cal_z:
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3242 lfsr FSR1,tCalZ
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3243 call strcat_text
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3244 movff compass_CZ_f+0,lo
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3245 movff compass_CZ_f+1,hi
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3246 call TFT_convert_signed_16bit ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3247 bsf leftbind
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3248 output_16
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3249 bcf leftbind
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3250 return
64a45f203144 NEW: Show Compass calibration results in Compass menu
heinrichsweikamp
parents: 535
diff changeset
3251
453
b4f28ab23b87 NEW: Show Uptime (Time since last firmware boot) in information menu
heinrichsweikamp
parents: 444
diff changeset
3252
0
heinrichsweikamp
parents:
diff changeset
3253 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
3254 ; ppO2 menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3255
0
heinrichsweikamp
parents:
diff changeset
3256 global divesets_ppo2_max
heinrichsweikamp
parents:
diff changeset
3257 extern tPPO2Max
heinrichsweikamp
parents:
diff changeset
3258 extern tbar
heinrichsweikamp
parents:
diff changeset
3259 divesets_ppo2_max:
heinrichsweikamp
parents:
diff changeset
3260 lfsr FSR1,tPPO2Max
heinrichsweikamp
parents:
diff changeset
3261 call strcat_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3262 movff char_I_ppO2_max,lo
0
heinrichsweikamp
parents:
diff changeset
3263 movlw ppo2_warning_high
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3264
0
heinrichsweikamp
parents:
diff changeset
3265 divesets_ppo2_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3266 movwf up ; Save default value
0
heinrichsweikamp
parents:
diff changeset
3267 clrf hi
heinrichsweikamp
parents:
diff changeset
3268 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3269 output_16dp d'3'
heinrichsweikamp
parents:
diff changeset
3270 bcf leftbind
heinrichsweikamp
parents:
diff changeset
3271 lfsr FSR1,tbar
heinrichsweikamp
parents:
diff changeset
3272 call strcat_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3273 movf up,W ; Default value
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3274 cpfseq lo ; Current value
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3275 bra divesets_ppo2_common2 ; Not default, add *
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3276 return ; Default, Done.
0
heinrichsweikamp
parents:
diff changeset
3277 divesets_ppo2_common2:
heinrichsweikamp
parents:
diff changeset
3278 PUTC "*"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3279 return ; Done.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3280
0
heinrichsweikamp
parents:
diff changeset
3281
heinrichsweikamp
parents:
diff changeset
3282 global divesets_ppo2_min
507
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3283 extern tPPO2MIN
0
heinrichsweikamp
parents:
diff changeset
3284 divesets_ppo2_min:
507
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3285 lfsr FSR1,tPPO2MIN
0
heinrichsweikamp
parents:
diff changeset
3286 call strcat_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3287 movff char_I_ppO2_min,lo
0
heinrichsweikamp
parents:
diff changeset
3288 movlw ppo2_warning_low
heinrichsweikamp
parents:
diff changeset
3289 bra divesets_ppo2_common
heinrichsweikamp
parents:
diff changeset
3290
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3291
507
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3292 global divesets_ppo2_max_deco
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3293 extern tPPO2DECO
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3294 divesets_ppo2_max_deco:
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3295 lfsr FSR1,tPPO2DECO
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3296 call strcat_text
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3297 movff char_I_ppO2_max_deco,lo
507
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3298 movlw ppo2_warning_high_deco
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3299 bra divesets_ppo2_common
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3300
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3301
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3302 global divesets_ppo2_min_cc
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3303 extern tPPO2MINCC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3304 divesets_ppo2_min_cc:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3305 lfsr FSR1,tPPO2MINCC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3306 call strcat_text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3307 movff char_I_ppO2_min_loop,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3308 movlw ppo2_warning_low_cc
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3309 bra divesets_ppo2_common
507
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 504
diff changeset
3310
0
heinrichsweikamp
parents:
diff changeset
3311 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
3312
heinrichsweikamp
parents:
diff changeset
3313 global TFT_clear_warning_text
heinrichsweikamp
parents:
diff changeset
3314 TFT_clear_warning_text:
heinrichsweikamp
parents:
diff changeset
3315 btfss divemode ; in divemode?
heinrichsweikamp
parents:
diff changeset
3316 bra TFT_clear_warning_text2 ; No, setup for surface mode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3317 bcf FLAG_TFT_dive_warning_text_clear ; Clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3318 btfsc alternative_divelayout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3319 bra TFT_clear_warning_text_2nd_row ; In Alt mode, clear only row 2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3320 WIN_BOX_BLACK dm_warning_row, dm_warning_bot, dm_warning_column, dm_warning_rgt ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
3321 return
heinrichsweikamp
parents:
diff changeset
3322 TFT_clear_warning_text2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3323 WIN_BOX_BLACK surf_warning1_row, surf_warning2_row+.24, surf_warning1_column, surf_warning1_column+.76 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
3324 return
heinrichsweikamp
parents:
diff changeset
3325
heinrichsweikamp
parents:
diff changeset
3326 global TFT_clear_warning_text_2nd_row
heinrichsweikamp
parents:
diff changeset
3327 TFT_clear_warning_text_2nd_row:
heinrichsweikamp
parents:
diff changeset
3328 btfss divemode ; in divemode?
heinrichsweikamp
parents:
diff changeset
3329 bra TFT_clear_warning_text_2nd_2 ; No, setup for surface mode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3330 bcf FLAG_TFT_dive_warning_text_clr2 ; Clear flag
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3331 WIN_BOX_BLACK dm_warning2_row, dm_warning2_bot, dm_warning2_column, dm_warning2_rgt ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
3332 return
heinrichsweikamp
parents:
diff changeset
3333 TFT_clear_warning_text_2nd_2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3334 WIN_BOX_BLACK surf_warning2_row, surf_warning2_row+.24, surf_warning2_column, surf_warning2_column+.76 ; top, bottom, left, right
0
heinrichsweikamp
parents:
diff changeset
3335 return
heinrichsweikamp
parents:
diff changeset
3336
heinrichsweikamp
parents:
diff changeset
3337 global TFT_fillup_with_spaces
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3338 TFT_fillup_with_spaces: ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3339 movwf lo ; save max. string length into lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3340 movf FSR2L,W ; Get current string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3341 subwf lo,F ; lo-WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3342 btfsc STATUS,N ; longer then #lo already?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3343 return ; Yes, done.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3344 tstfsz lo ; Zero?
0
heinrichsweikamp
parents:
diff changeset
3345 bra TFT_fillup_with_spaces2 ; No.
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3346 return ; Yes, done.
0
heinrichsweikamp
parents:
diff changeset
3347 TFT_fillup_with_spaces2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3348 PUTC " " ; Add one space
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3349 decfsz lo,F ; All done?
0
heinrichsweikamp
parents:
diff changeset
3350 bra TFT_fillup_with_spaces2 ; No, loop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3351 return ; Done.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3352
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3353 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3354
0
heinrichsweikamp
parents:
diff changeset
3355 global TFT_desaturation_time
heinrichsweikamp
parents:
diff changeset
3356 TFT_desaturation_time:
heinrichsweikamp
parents:
diff changeset
3357 rcall TFT_warning_set_window ; Sets the row and column for the current warning
heinrichsweikamp
parents:
diff changeset
3358 tstfsz WREG ; Is there room for the warning?
heinrichsweikamp
parents:
diff changeset
3359 return ; No
heinrichsweikamp
parents:
diff changeset
3360 STRCPY "Desat:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3361 movff int_O_desaturation_time+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3362 movff int_O_desaturation_time+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3363 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3364 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3365 movf lo,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3366 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3367 movwf hi ; exchange lo and hi...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3368 output_8 ; Hours
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3369 PUTC ':'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3370 movff hi,lo ; Minutes
0
heinrichsweikamp
parents:
diff changeset
3371 output_99x
heinrichsweikamp
parents:
diff changeset
3372 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3373 movlw surf_warning_length ; Only use surface string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3374 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3375 movlw .0 ; TODO - needed?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3376 movff WREG,buffer+11 ; TODO - needed?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3377 STRCAT_PRINT ""
341
0740bd920c51 Show ppo2 <1bar with leading zero
heinrichsweikamp
parents: 339
diff changeset
3378 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
3379 return
heinrichsweikamp
parents:
diff changeset
3380
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3381
0
heinrichsweikamp
parents:
diff changeset
3382 global TFT_nofly_time
heinrichsweikamp
parents:
diff changeset
3383 TFT_nofly_time:
heinrichsweikamp
parents:
diff changeset
3384 rcall TFT_warning_set_window ; Sets the row and column for the current warning
heinrichsweikamp
parents:
diff changeset
3385 tstfsz WREG ; Is there room for the warning?
heinrichsweikamp
parents:
diff changeset
3386 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3387 movff char_I_altitude_wait,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3388 tstfsz WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3389 bra TFT_nofly_time_1
0
heinrichsweikamp
parents:
diff changeset
3390 STRCPY "NoFly:"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3391 bra TFT_nofly_time_2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3392 TFT_nofly_time_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3393 STRCPY "NoAlt:"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3394 TFT_nofly_time_2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3395 movff int_O_nofly_time+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3396 movff int_O_nofly_time+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3397 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3398 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3399 movf lo,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3400 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3401 movwf hi ; exchange lo and hi...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3402 output_8 ; Hours
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3403 PUTC ':'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3404 movff hi,lo ; Minutes
0
heinrichsweikamp
parents:
diff changeset
3405 output_99x
heinrichsweikamp
parents:
diff changeset
3406 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3407 movlw surf_warning_length ; Only use surface string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3408 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3409 movlw .0 ; TODO - needed?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3410 movff WREG,buffer+11 ; TODO - needed?
0
heinrichsweikamp
parents:
diff changeset
3411 STRCAT_PRINT ""
341
0740bd920c51 Show ppo2 <1bar with leading zero
heinrichsweikamp
parents: 339
diff changeset
3412 bcf win_invert
0
heinrichsweikamp
parents:
diff changeset
3413 return
heinrichsweikamp
parents:
diff changeset
3414
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3415 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3416
0
heinrichsweikamp
parents:
diff changeset
3417 global TFT_warning_agf
heinrichsweikamp
parents:
diff changeset
3418 TFT_warning_agf:
heinrichsweikamp
parents:
diff changeset
3419 rcall TFT_warning_set_window ; Sets the row and column for the current warning
heinrichsweikamp
parents:
diff changeset
3420 tstfsz WREG ; Is there room for the warning?
heinrichsweikamp
parents:
diff changeset
3421 return ; No
heinrichsweikamp
parents:
diff changeset
3422 call TFT_warnings_color
heinrichsweikamp
parents:
diff changeset
3423 STRCPY_TEXT tDiveaGF_active ; "aGF!"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3424 movlw dm_warning_length ; Divemode string length
0
heinrichsweikamp
parents:
diff changeset
3425 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
heinrichsweikamp
parents:
diff changeset
3426 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3427 ;bcf win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3428 ;return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3429 goto TFT_standard_color
0
heinrichsweikamp
parents:
diff changeset
3430
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3431 global TFT_warning_fallback
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3432 TFT_warning_fallback: ; Show fallback warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3433 rcall TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3434 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3435 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3436 call TFT_warnings_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3437 STRCPY_TEXT tDiveFallback ; "Fallback!"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3438 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3439 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3440 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3441 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3442
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3443
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3444 global TFT_info_deco
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3445 TFT_info_deco ; show info when in decompression
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3446 rcall TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3447 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3448 return ; NO - return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3449 movlw color_green ; YES - select green text color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3450 call TFT_set_color ; set color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3451 STRCPY_TEXT tDecoInfo ; write "Deco Zone"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3452 movlw dm_warning_length ; select Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3453 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3454 STRCAT_PRINT "" ; print buffer
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3455 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3456
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3457
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3458 global TFT_warning_gf
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3459 TFT_warning_gf: ; GF
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3460 rcall TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3461 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3462 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3463 movff int_O_gradient_factor+0,lo ; bank-safe copy gradient factor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3464 movff int_O_gradient_factor+1,hi ;
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3465 TFT_color_code warn_gf ; Color-code Output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3466 STRCPY "GF: " ; the two spaces are on purpose to align the output with other warnings' outputs
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3467 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3468 output_8 ; print value of lo only, int_O_gradient_factor is limited to 255
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3469 PUTC "%"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3470 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3471 btfss divemode ; In Divemode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3472 movlw surf_warning_length ; No, use surface string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3473 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3474 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3475 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3476 bcf win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3477 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3478
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3479
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3480 global TFT_warning_mbubbles
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3481 TFT_warning_mbubbles:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3482 rcall TFT_warning_set_window ; sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3483 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3484 return ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3485 call TFT_attention_color ; set attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3486 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3487 btfsc WREG,mbubble_warning ; are we in the microbubbles zone right now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3488 call TFT_warnings_color ; YES - reconfigure to warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3489 STRCPY_TEXT tMicroBubbles
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3490 movlw dm_warning_length ; divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3491 btfss divemode ; in Divemode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3492 movlw surf_warning_length ; NO - use surface string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3493 rcall TFT_fillup_with_spaces ; fillup FSR2 with spaces (total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3494 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3495 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3496
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3497
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3498 global TFT_warning_outside
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3499 TFT_warning_outside:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3500 rcall TFT_warning_set_window ; sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3501 tstfsz WREG ; is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3502 return ; NO
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3503 call TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3504 movff char_O_deco_warnings,WREG ; bank-safe copy for deco warnings
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3505 btfsc WREG,outside_warning ; are we outside the ZH-L16 model right now?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3506 call TFT_warnings_color ; YES - reconfigure to warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3507 STRCPY "X-ZHL16-X"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3508 movlw dm_warning_length ; divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3509 btfss divemode ; in Divemode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3510 movlw surf_warning_length ; NO - use surface string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3511 rcall TFT_fillup_with_spaces ; fillup FSR2 with spaces (total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3512 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3513 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3514
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3515
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3516 global TFT_warning_gas_needs_warn
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3517 global TFT_warning_gas_needs_att
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3518 TFT_warning_gas_needs_warn:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3519 rcall TFT_warning_gas_needs_war_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3520 rcall TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3521 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3522 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3523 call TFT_warnings_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3524 bra TFT_warning_gas_needs_com
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3525 TFT_warning_gas_needs_att:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3526 rcall TFT_warning_gas_needs_att_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3527 rcall TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3528 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3529 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3530 call TFT_attention_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3531 TFT_warning_gas_needs_com:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3532 STRCPY_TEXT tGasNeedsWarn ; "Gas Needs"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3533 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3534 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3535 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3536 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3537
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3538 TFT_warning_gas_needs_war_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3539 incf warning_counter,F ; increase counter
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3540 btfsc gas_needs_warning ; is it a new warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3541 return ; NO - do not show the gas needs custom view again
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3542 bsf gas_needs_warning ; YES - memorise it's an old now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3543 bra TFT_warning_gas_needs_helper_com
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3544 TFT_warning_gas_needs_att_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3545 incf warning_counter,F ; increase counter
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3546 btfsc gas_needs_attention ; is it a new attention?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3547 return ; NO - do not show the gas needs custom view again
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3548 bsf gas_needs_attention ; YES - memorise it's an old now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3549 TFT_warning_gas_needs_helper_com:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3550 movlw .12 ; customview number one below gas needs view
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3551 movwf menupos3 ; set fake current view number
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3552 bsf toggle_customview ; initiate toggle of customview -> gas needs view will be shown
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3553 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3554
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3555
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3556 global TFT_warning_IBCD
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3557 TFT_warning_IBCD:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3558 rcall TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3559 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3560 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3561 call TFT_attention_color ; select attention color as default
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3562 STRCPY_TEXT tIBCD ; "IBCD N2He"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3563 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3564 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3565 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3566 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3567
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3568
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3569 global TFT_warning_sensor_disagree
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3570 TFT_warning_sensor_disagree: ; Show sensor disagree warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3571 rcall TFT_warning_sensor_dis_helper
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3572 rcall TFT_warning_set_window ; Sets the row and column for the current warning
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3573 tstfsz WREG ; Is there room for the warning?
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3574 return ; No
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3575 call TFT_warnings_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3576 STRCPY_TEXT tSensorDisagree ; "Sensors<>"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3577 movlw dm_warning_length ; Divemode string length
145
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3578 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
e3ac5b2021bc NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents: 139
diff changeset
3579 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3580 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3581
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3582 TFT_warning_sensor_dis_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3583 btfsc sensor_warning ; is it a new warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3584 return ; NO - do not show the gas needs custom view again
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3585 bsf sensor_warning ; YES - memories it's an old warning now
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3586 clrf menupos3 ; set fake current view number
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3587 bsf toggle_customview ; initiate toggle of customview -> sensor view will be shown
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3588 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3589
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3590 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3591
0
heinrichsweikamp
parents:
diff changeset
3592 TFT_warning_set_window: ; Sets the row and column for the current warning
heinrichsweikamp
parents:
diff changeset
3593 ; ignore warning (now)?
heinrichsweikamp
parents:
diff changeset
3594 decf warning_counter,W ; -1
heinrichsweikamp
parents:
diff changeset
3595 bcf STATUS,C
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3596 btfss alternative_divelayout ; In alt mode, do not divide...
0
heinrichsweikamp
parents:
diff changeset
3597 rrcf WREG,W ; (warning_counter-1)/2
heinrichsweikamp
parents:
diff changeset
3598 cpfseq warning_page
heinrichsweikamp
parents:
diff changeset
3599 retlw .255 ; WREG <> 0 -> Warning window not defined
heinrichsweikamp
parents:
diff changeset
3600 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
3601 btfss divemode ; in divemode?
heinrichsweikamp
parents:
diff changeset
3602 bra TFT_warning_set_window3 ; No, setup for surface mode
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3603 btfss alternative_divelayout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3604 bra TFT_warning_set_window3a ; standard layout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3605 bra TFT_warning_set_window2a ; alternative layout (Only lower row used)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3606 TFT_warning_set_window3a:
0
heinrichsweikamp
parents:
diff changeset
3607 btfss warning_counter,0 ; Toggle with each warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3608 bra TFT_warning_set_window2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3609 WIN_SMALL dm_warning1_column, dm_warning1_row
0
heinrichsweikamp
parents:
diff changeset
3610 bcf second_row_warning ; =1: The second row contains a warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3611 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3612 TFT_warning_set_window2:
heinrichsweikamp
parents:
diff changeset
3613 bsf second_row_warning ; =1: The second row contains a warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3614 TFT_warning_set_window2a:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3615 WIN_SMALL dm_warning2_column, dm_warning2_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3616 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3617 TFT_warning_set_window3:
heinrichsweikamp
parents:
diff changeset
3618 btfss warning_counter,0 ; Toggle with each warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3619 bra TFT_warning_set_window4
0
heinrichsweikamp
parents:
diff changeset
3620 WIN_SMALL surf_warning1_column,surf_warning1_row
heinrichsweikamp
parents:
diff changeset
3621 bcf second_row_warning ; =1: The second row contains a warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3622 retlw .0 ; WREG=0 -> Warning window defined
0
heinrichsweikamp
parents:
diff changeset
3623 TFT_warning_set_window4:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3624 WIN_SMALL surf_warning2_column,surf_warning2_row
0
heinrichsweikamp
parents:
diff changeset
3625 bsf second_row_warning ; =1: The second row contains a warning
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3626 retlw .0 ; WREG=0 -> Warning window defined
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3627
309
efb53af0d62a VSIbar #1: layout position changes
janos_kovacs <kovjanos@gmail.com>
parents: 307
diff changeset
3628
0
heinrichsweikamp
parents:
diff changeset
3629 global TFT_update_batt_percent_divemode
heinrichsweikamp
parents:
diff changeset
3630 TFT_update_batt_percent_divemode:
heinrichsweikamp
parents:
diff changeset
3631 rcall TFT_warning_set_window ; Sets the row and column for the current warning
heinrichsweikamp
parents:
diff changeset
3632 tstfsz WREG ; Is there room for the warning?
heinrichsweikamp
parents:
diff changeset
3633 return ; No
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3634 movff batt_percent,lo ; Get battery percent
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3635 TFT_color_code warn_battery ; Color-code battery percent
0
heinrichsweikamp
parents:
diff changeset
3636 STRCPY "Batt:"
heinrichsweikamp
parents:
diff changeset
3637 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3638 output_8
heinrichsweikamp
parents:
diff changeset
3639 bcf leftbind
heinrichsweikamp
parents:
diff changeset
3640 PUTC "%"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3641 movlw dm_warning_length ; Divemode string length
0
heinrichsweikamp
parents:
diff changeset
3642 btfss divemode ; In Divemode?
heinrichsweikamp
parents:
diff changeset
3643 movlw surf_warning_length ; No, use surface string length
heinrichsweikamp
parents:
diff changeset
3644 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
heinrichsweikamp
parents:
diff changeset
3645 STRCAT_PRINT ""
428
eccae727702f some cleanup
heinrichsweikamp
parents: 413
diff changeset
3646 bcf win_invert
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3647 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3648
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3649
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3650 global TFT_gf_mask ; Setup Mask
0
heinrichsweikamp
parents:
diff changeset
3651 TFT_gf_mask:
heinrichsweikamp
parents:
diff changeset
3652 ; The mask
heinrichsweikamp
parents:
diff changeset
3653 call TFT_divemask_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3654 WIN_TINY dm_custom_gf_title_col1, dm_custom_gf_title_row
0
heinrichsweikamp
parents:
diff changeset
3655 STRCPY_TEXT_PRINT tGFactors
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3656 WIN_TINY dm_custom_gf_title_col2, dm_custom_gf_title_row
0
heinrichsweikamp
parents:
diff changeset
3657 STRCPY_TEXT_PRINT taGFactors
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3658 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
0
heinrichsweikamp
parents:
diff changeset
3659 STRCPY_TEXT_PRINT tGFInfo
heinrichsweikamp
parents:
diff changeset
3660 ; Show GF (Static)
heinrichsweikamp
parents:
diff changeset
3661 call TFT_disabled_color
heinrichsweikamp
parents:
diff changeset
3662 btfss use_agf
heinrichsweikamp
parents:
diff changeset
3663 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3664 WIN_STD dm_custom_gf_column, dm_custom_gf_row
0
heinrichsweikamp
parents:
diff changeset
3665 bsf leftbind
heinrichsweikamp
parents:
diff changeset
3666 movff opt_GF_low,lo
heinrichsweikamp
parents:
diff changeset
3667 output_8
heinrichsweikamp
parents:
diff changeset
3668 PUTC "/"
heinrichsweikamp
parents:
diff changeset
3669 movff opt_GF_high,lo
heinrichsweikamp
parents:
diff changeset
3670 output_8
heinrichsweikamp
parents:
diff changeset
3671 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
3672 ; Show aGF (Static)
heinrichsweikamp
parents:
diff changeset
3673 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
3674 TSTOSS opt_enable_aGF ; =1: aGF can be selected underwater
heinrichsweikamp
parents:
diff changeset
3675 bra TFT_gf_mask2 ; Show "---" instead
heinrichsweikamp
parents:
diff changeset
3676 btfss use_agf
heinrichsweikamp
parents:
diff changeset
3677 call TFT_disabled_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3678 WIN_STD dm_custom_agf_column, dm_custom_agf_row
0
heinrichsweikamp
parents:
diff changeset
3679 movff opt_aGF_low,lo
heinrichsweikamp
parents:
diff changeset
3680 output_8
heinrichsweikamp
parents:
diff changeset
3681 PUTC "/"
heinrichsweikamp
parents:
diff changeset
3682 movff opt_aGF_high,lo
heinrichsweikamp
parents:
diff changeset
3683 output_8
heinrichsweikamp
parents:
diff changeset
3684 STRCAT_PRINT ""
heinrichsweikamp
parents:
diff changeset
3685 bcf leftbind
428
eccae727702f some cleanup
heinrichsweikamp
parents: 413
diff changeset
3686 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
3687
heinrichsweikamp
parents:
diff changeset
3688 TFT_gf_mask2:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3689 WIN_STD dm_custom_agf_column+.10, dm_custom_agf_row
0
heinrichsweikamp
parents:
diff changeset
3690 STRCPY_PRINT "---"
heinrichsweikamp
parents:
diff changeset
3691 bcf leftbind
heinrichsweikamp
parents:
diff changeset
3692 return
heinrichsweikamp
parents:
diff changeset
3693
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3694
333
14b466f66a7f Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents: 332
diff changeset
3695 global TFT_gf_mask_cGF ; Setup Mask
14b466f66a7f Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents: 332
diff changeset
3696 TFT_gf_mask_cGF:
14b466f66a7f Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents: 332
diff changeset
3697 ; The mask
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3698 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3699 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
333
14b466f66a7f Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents: 332
diff changeset
3700 STRCPY_TEXT_PRINT tGFInfo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3701 goto TFT_standard_color; and return...
333
14b466f66a7f Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents: 332
diff changeset
3702
0
heinrichsweikamp
parents:
diff changeset
3703 global TFT_gf_info ; Show GF informations
heinrichsweikamp
parents:
diff changeset
3704 TFT_gf_info:
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3705 WIN_STD dm_custom_currentgf_column, dm_custom_currentgf_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3706 movff int_O_gradient_factor+0,lo ; gradient factor absolute (Non-GF model)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3707 movff int_O_gradient_factor+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3708 TFT_color_code warn_gf ; Color-code Output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3709 output_8 ; print lo only, int_O_gradient_factor is limited to 255
0
heinrichsweikamp
parents:
diff changeset
3710 STRCAT_PRINT "%"
heinrichsweikamp
parents:
diff changeset
3711 return
heinrichsweikamp
parents:
diff changeset
3712
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3713
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3714 global TFT_battinfo_tissues_clock_mask ; Setup Mask
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3715 TFT_battinfo_tissues_clock_mask:
0
heinrichsweikamp
parents:
diff changeset
3716 ; The mask
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3717 ; Put three columns at HUD positions
0
heinrichsweikamp
parents:
diff changeset
3718 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3719 btfsc FLAG_apnoe_mode ; In Apnoe mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3720 bra TFT_battinfo_tissues_clock_mask2 ; Yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3721 btfsc FLAG_gauge_mode ; In Gauge mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3722 bra TFT_battinfo_tissues_clock_mask2 ; Yes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3723 WIN_TINY dm_custom_tissue_title_column, dm_custom_tissue_title_row
0
heinrichsweikamp
parents:
diff changeset
3724 STRCPY_TEXT_PRINT tDiveTissues
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3725 TFT_battinfo_tissues_clock_mask2: ; Show only clock
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3726 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3727 STRCPY_TEXT_PRINT tBatteryV ; "Battery: "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3728 WIN_TINY dm_custom_clock_column, dm_custom_clock_title_row
134
4574aed5cd4c Show clock in Apnea mode, minor layout changes in Apnea mode
heinrichsweikamp
parents: 131
diff changeset
3729 STRCPY_TEXT_PRINT tDiveClock
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3730 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3731
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3732 global TFT_battinfo_tissues_clock ; Show EAD/END, Tissues and clock
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3733 TFT_battinfo_tissues_clock:
0
heinrichsweikamp
parents:
diff changeset
3734 ; Update clock and date
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3735 WIN_SMALL dm_custom_clock_column, dm_custom_clock_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3736 call TFT_clock2 ; print clock
134
4574aed5cd4c Show clock in Apnea mode, minor layout changes in Apnea mode
heinrichsweikamp
parents: 131
diff changeset
3737
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3738 ; Show Battery info
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3739 WIN_SMALL dm_custom_ead_column, dm_custom_ead_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3740 movff batt_percent,lo ; Get battery percent
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3741 TFT_color_code warn_battery ; Color-code battery percent
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3742 bsf leftbind
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3743 output_8
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3744 bcf leftbind
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3745 STRCAT "% "
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3746 movlw 0x00
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3747 movff WREG,buffer+4 ; Only "xxx%"
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3748 STRCAT_PRINT ""
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3749 bcf win_invert
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3750 call TFT_standard_color
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3751 WIN_SMALL dm_custom_end_column, dm_custom_end_row
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3752 movff batt_voltage+0,lo
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3753 movff batt_voltage+1,hi
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3754 bsf leftbind
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3755 output_16dp .2
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3756 bcf leftbind
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3757 PUTC 'V'
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3758 movff buffer+5,buffer+4
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3759 movlw 0x00
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3760 movff WREG,buffer+5 ; Only "x.yzV"
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3761 STRCAT_PRINT ""
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3762
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3763 btfsc FLAG_apnoe_mode ; In Apnoe mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3764 return ; Yes, done.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3765 btfsc FLAG_gauge_mode ; In Gauge mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3766 return ; Yes, done.
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3767
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3768 ; Show tissue diagram
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3769 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3770 WIN_TINY dm_custom_tissue_N2_column, dm_custom_tissue_N2_row
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3771 STRCPY_TEXT_PRINT tN2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3772 WIN_TINY dm_custom_tissue_He_column, dm_custom_tissue_He_row
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3773 STRCPY_TEXT_PRINT tHe
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3774 bra DISP_tissue_saturation_graph ; Show char_O_tissue_N2_saturation and char_O_tissue_He_saturation and return...
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3775
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3776
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3777 global TFT_pscr_info_mask
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3778 TFT_pscr_info_mask: ; Show pSCR-ppO2, drop and lung ratio mask
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3779 rcall TFT_mask_ppo2
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3780 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3781 WIN_TINY dm_custom_pscr_text_drop_column, dm_custom_pscr_text_row
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3782 STRCPY_TEXT_PRINT tPSCR_O2_drop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3783 WIN_TINY dm_custom_pscr_text_ratio_column, dm_custom_pscr_text_row
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3784 STRCPY_TEXT_PRINT tPSCR_lungratio
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3785 goto TFT_standard_color ; and return...
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3786
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3787 global TFT_pscr_info ; Show pSCR-ppO2, drop and lung ratio
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3788 TFT_pscr_info:
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3789 ;show ppO2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3790 WIN_MEDIUM dm_custom_ceiling_ppo2_val_col, dm_custom_ceiling_value_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3791 movff int_O_pSCR_ppO2+0,lo ; copy pSCR ppO2 to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3792 movff int_O_pSCR_ppO2+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3793 TFT_color_code warn_ppo2 ; color-code output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3794 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3795 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3796 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3797 STRCAT_PRINT ""
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3798 ; Show Drop
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3799 WIN_STD dm_custom_pscr_drop_column,dm_custom_pscr_drop_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3800 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3801 movff char_I_PSCR_drop,lo
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3802 bsf leftbind
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3803 output_8
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3804 STRCAT_PRINT "%"
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3805 ; Show lung ratio
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3806 WIN_STD dm_custom_pscr_ratio_column,dm_custom_pscr_ratio_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3807 movff char_I_PSCR_lungratio,lo
482
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3808 bsf leftbind
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3809 STRCPY "1/"
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3810 output_8
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3811 STRCAT_PRINT ""
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3812 bcf leftbind
c0ee33f1f399 New customview #12 for PSCR mode shows ppO2, O2 drop and lung ratio
heinrichsweikamp
parents: 480
diff changeset
3813 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3814
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3815
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3816 global TFT_gas_needs_mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3817 TFT_gas_needs_mask:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3818 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3819 WIN_TINY dm_custom_dyn_gas_mask_column-.10,dm_custom_dyn_gas_mask_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3820 STRCPY_TEXT_PRINT tGasNeedsBar ; "Gas Needs (bar)"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3821 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3822
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3823 global TFT_gas_needs
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3824 TFT_gas_needs: ; LIMITATION: there is only space for 4 gases on the screen - if 5 gases
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3825 bsf leftbind ; have a pres_need > 0, then only the first 4 will be shown!
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3826 clrf up
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3827 WIN_SMALL dm_custom_dyn_gas_column1+.5,dm_custom_dyn_gas_row1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3828 call TFT_gas_needs_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3829 WIN_SMALL dm_custom_dyn_gas_column1+.5,dm_custom_dyn_gas_row2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3830 call TFT_gas_needs_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3831 WIN_SMALL dm_custom_dyn_gas_column2+.5,dm_custom_dyn_gas_row1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3832 call TFT_gas_needs_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3833 WIN_SMALL dm_custom_dyn_gas_column2+.5,dm_custom_dyn_gas_row2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3834 call TFT_gas_needs_helper
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3835 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3836 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3837
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3838 TFT_gas_needs_helper:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3839 call TFT_standard_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3840 movlw .5 ; number of gases
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3841 cpfslt up ; check if all gases have been processed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3842 bra TFT_gas_needs_helper_1 ; yes -> clear display area
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3843 movf up,W ; no -> get gas number and check if need of that gas is > 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3844 rlncf WREG,W ; multipy by 2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3845 lfsr FSR1,int_O_tank_pres_need+1 ; read HIGH(int_O_tank_pres_need[up])
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3846 movff PLUSW1,hi ; copy to temp storage hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3847 btfss hi,int_is_zero ; check flag for pres_need == 0
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3848 bra TFT_gas_needs_helper_2 ; no -> print gas type and pressure needed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3849 incf up,F ; yes -> increment to next gas...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3850 bra TFT_gas_needs_helper ; ...and try the next gas
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3851 TFT_gas_needs_helper_1: ; no gases to show anymore, clear display area from potential remains of last invocation
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3852 STRCAT_PRINT " ---- " ; overwrite outdated stuff if screen position is not needed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3853 return
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3854 TFT_gas_needs_helper_2: ; output gas type and pressure needed
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3855 movf up,W ; get gas number (0-4) to WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3856 lfsr FSR1,opt_gas_O2_ratio ; read opt_gas_O2_ratio[WREG]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3857 movff PLUSW1,lo ; copy result to lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3858 movf up,W ; get gas number (0-4) to WREG ; SHOULD NOT BE NEEDED AS movff SHOULD NOT ALTER wreg
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3859 lfsr FSR1,opt_gas_He_ratio ; read opt_gas_He_ratio[WREG]
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3860 movff PLUSW1,hi ; copy result to hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3861 call customview_show_mix ; print "Air", "O2", "21/35", etc.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3862 STRCAT ":"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3863 movf up,W ; get gas number (0-4) to WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3864 rlncf WREG,W ; multipy by 2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3865 lfsr FSR1,int_O_tank_pres_need+0 ; read lower part of integer
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3866 movff PLUSW1,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3867 movf up,W ; get gas number (0-4) to WREG ; SHOULD NOT BE NEEDED AS movff SHOULD NOT ALTER wreg
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3868 rlncf WREG,W ; multipy by 2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3869 lfsr FSR1,int_O_tank_pres_need+1 ; read upper part of integer
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3870 movff PLUSW1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3871 btfsc hi,int_prewarning_flag ; check if pre-warning flag is set (pres_need > pres_fill * threshold)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3872 call TFT_attention_color ; yes, print gas need in yellow
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3873 btfsc hi,int_warning_flag ; check if warning flag is set (pres_need > pres_fill)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3874 call TFT_warnings_color ; yes, print gas need in red
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3875 movff int_O_tank_pres_need+1,WREG ; get HIGH(int_O_tank_pres_need[0]) which hold flag for invalid data
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3876 btfsc WREG,int_invalid_flag ; check if invalid data flag is set
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3877 call TFT_disabled_color ; yes, print gas need in disabled color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3878 bcf hi,int_prewarning_flag ; clear pre-warning flag for attention color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3879 bcf hi,int_warning_flag ; clear warning flag for warning color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3880 bcf hi,int_invalid_flag ; clear flag for invalid data (will actually only be set with 1st gas)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3881 output_16_3 ; limit to 999 and display only (0-999)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3882 STRCAT_PRINT " " ; adds a space to overwrite any potential remains of earlier outputs
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3883 incf up,F ; increment to next gas
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3884 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3885
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3886
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3887 global TFT_mask_ppo2 ; helper function for several custom views
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3888 TFT_mask_ppo2:
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3889 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3890 btfss FLAG_ccr_mode ; in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3891 bra TFT_mask_ppo2a ; NO - continue checking for pSCR and OC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3892 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3893 bra TFT_mask_ppo2b ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3894 WIN_TINY dm_custom_ceiling_ppo2_col_dil,dm_custom_ceiling_text_row ; tuned position for longer text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3895 STRCPY_TEXT_PRINT tppO2Dil ; print "ppO2(Dil)"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3896 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3897 TFT_mask_ppo2a:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3898 btfss FLAG_pscr_mode ; in pSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3899 bra TFT_mask_ppo2b ; NO - continue with OC mode (or bailout)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3900 btfsc is_bailout ; in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3901 bra TFT_mask_ppo2b ; YES
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3902 WIN_TINY dm_custom_ceiling_ppo2_col_dil,dm_custom_ceiling_text_row ; tuned position for longer text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3903 STRCPY_TEXT_PRINT tppO2Mix ; print "ppO2(Mix)"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3904 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3905 TFT_mask_ppo2b: ; OC mode or bailout
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3906 WIN_TINY dm_custom_ceiling_ppo2_column, dm_custom_ceiling_text_row ; normal position
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3907 STRCPY_TEXT_PRINT tppO2 ; in all other modes
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3908 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3909
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3910 global TFT_display_pure_ppo2 ; show ppO2 of the pure gas - helper function for several custom views
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3911 TFT_display_pure_ppo2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3912 WIN_MEDIUM dm_custom_ceiling_ppo2_val_col, dm_custom_ceiling_value_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3913 movff int_O_pure_ppO2+0,lo ; copy ppO2 of the pure gas to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3914 movff int_O_pure_ppO2+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3915 TFT_color_code warn_ppo2 ; color-code output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3916 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3917 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3918 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3919 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3920 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3921
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3922
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3923 global TFT_ppo2_ead_end_cns_mask ; Show ppO2, END/EAD and CNS mask
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3924 TFT_ppo2_ead_end_cns_mask:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3925 rcall TFT_mask_ppo2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3926 call TFT_divemask_color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3927 WIN_TINY dm_custom_ead_column, dm_custom_eadend_title_row
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3928 STRCPY_TEXT_PRINT tDiveEAD_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3929 WIN_TINY dm_custom_gf_title_col3, dm_custom_gf_title_row
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3930 STRCPY_TEXT_PRINT tCNS2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3931 goto TFT_standard_color ; and return...
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3932
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3933 global TFT_ppo2_ead_end_cns ; Show ppO2, END/EAD and CNS
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3934 TFT_ppo2_ead_end_cns:
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3935 ;show ppO2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3936 rcall TFT_display_pure_ppo2 ; show ppO2 of the pure gas
0
heinrichsweikamp
parents:
diff changeset
3937 ; Show END/EAD
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
3938 WIN_SMALL dm_custom_ead_column, dm_custom_ead_row
0
heinrichsweikamp
parents:
diff changeset
3939 STRCPY_TEXT tEAD ; EAD:
heinrichsweikamp
parents:
diff changeset
3940 movff char_O_EAD,lo
heinrichsweikamp
parents:
diff changeset
3941 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3942 WIN_SMALL dm_custom_end_column, dm_custom_end_row
0
heinrichsweikamp
parents:
diff changeset
3943 STRCPY_TEXT tEND ; END:
heinrichsweikamp
parents:
diff changeset
3944 movff char_O_END,lo
heinrichsweikamp
parents:
diff changeset
3945 rcall TFT_end_ead_common ; print "lo m" (or ft) and limit to 8 chars
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3946 ; Show CNS
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3947 WIN_STD dm_custom_currentgf_column, dm_custom_currentgf_row
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3948 movff int_O_CNS_fraction+0,lo
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3949 movff int_O_CNS_fraction+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3950 TFT_color_code warn_cns ; Color-code CNS output
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3951 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3952 output_16_3 ; Displays only 0...999
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3953 bcf leftbind
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3954 STRCAT_PRINT "%"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3955 goto TFT_standard_color ; and return...
471
9edb1359ce43 NEW: New Customview 11 in dive mode shows ppO2, EAD/END and CNS
heinrichsweikamp
parents: 466
diff changeset
3956
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3957 TFT_end_ead_common: ; print "lo m" (or ft) and limit to 8 chars
0
heinrichsweikamp
parents:
diff changeset
3958 bsf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3959 TSTOSS opt_units ; 0=Meters, 1=Feets
0
heinrichsweikamp
parents:
diff changeset
3960 bra TFT_end_ead_common_metric
heinrichsweikamp
parents:
diff changeset
3961 ;TFT_end_ead_common_imperial:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3962 movf lo,W ; With lo in m
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3963 mullw .100 ; PRODL:PRODH = mbar/min
0
heinrichsweikamp
parents:
diff changeset
3964 movff PRODL,lo
heinrichsweikamp
parents:
diff changeset
3965 movff PRODH,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3966 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
0
heinrichsweikamp
parents:
diff changeset
3967 output_16_3
heinrichsweikamp
parents:
diff changeset
3968 STRCAT_TEXT tFeets
heinrichsweikamp
parents:
diff changeset
3969 clrf WREG
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3970 movff WREG,buffer+.8 ; limit string length to 8
0
heinrichsweikamp
parents:
diff changeset
3971 bra TFT_end_ead_common_exit
heinrichsweikamp
parents:
diff changeset
3972 TFT_end_ead_common_metric:
heinrichsweikamp
parents:
diff changeset
3973 output_8
heinrichsweikamp
parents:
diff changeset
3974 STRCAT_TEXT tMeters
heinrichsweikamp
parents:
diff changeset
3975 TFT_end_ead_common_exit:
heinrichsweikamp
parents:
diff changeset
3976 bcf leftbind
heinrichsweikamp
parents:
diff changeset
3977 movlw .8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3978 rcall TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3979 STRCAT_PRINT ""
0
heinrichsweikamp
parents:
diff changeset
3980 return
heinrichsweikamp
parents:
diff changeset
3981
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3982
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3983 global TFT_sensor_check_mask ; show ppO2 of O2 and Diluent mask
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
3984 TFT_sensor_check_mask:
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
3985 call TFT_divemask_color
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3986 WIN_TINY dm_custom_s_check_text_column, dm_custom_s_check_text_row
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
3987 STRCPY_TEXT_PRINT tSensorCheck
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3988 WIN_TINY dm_custom_ppO2_text_column, dm_custom_s_check_text_row
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
3989 STRCPY_TEXT_PRINT tppO2O2
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3990 WIN_TINY dm_custom_ppDil_text_column, dm_custom_s_check_text_row
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
3991 STRCPY_TEXT_PRINT tppO2Dil
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3992 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3993
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3994 global TFT_sensor_check ; show ppO2 of O2 and Diluent
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
3995 TFT_sensor_check:
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
3996 ; Show ppO2 of O2 in this depth
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3997 WIN_MEDIUM dm_custom_s_check_ppo2_o2_column, dm_custom_s_check_value_row
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3998 movff int_O_O2_ppO2+0,lo ; copy ppO2 of pure O2 to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
3999 movff int_O_O2_ppO2+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4000 TFT_color_code warn_ppo2 ; color-code output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4001 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4002 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4003 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4004 STRCAT_PRINT ""
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4005 ; Show ppO2 of the diluent in this depth
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4006 WIN_MEDIUM dm_custom_s_check_ppo2_dil_col, dm_custom_s_check_value_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4007 movff int_O_pure_ppO2+0,lo ; copy ppO2 of pure gas to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4008 movff int_O_pure_ppO2+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4009 TFT_color_code warn_ppo2 ; color-code output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4010 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4011 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4012 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4013 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4014 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4015
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4016 ;=============================================================================
413
12e85930d95c NEW: New Customview shows ppO2(O2) and ppO2(Diluent) during CCR mode
heinrichsweikamp
parents: 412
diff changeset
4017
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4018 global TFT_surface_lastdive
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4019 TFT_surface_lastdive:
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4020 call TFT_divemask_color
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4021 WIN_TINY surf_gaslist_column,surf_gaslist_row+.5
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4022 STRCAT_TEXT_PRINT tLastDive ; Last Dive:
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4023 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.1)+.5
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4024 STRCAT_TEXT_PRINT tDivetime ; Divetime
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4025 WIN_TINY surf_gaslist_column,surf_gaslist_row+(surf_gaslist_spacing*.2)+.5
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4026 STRCAT_TEXT_PRINT tMaxDepth ; Max. Depth
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4027 call TFT_standard_color
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4028 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4029
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4030 movff int_O_desaturation_time+0,lo ; bank-safe copies
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4031 movff int_O_desaturation_time+1,WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4032 iorwf lo,W ; check if desaturation time is zero
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4033 bz TFT_surface_lastdive_1 ; YES - show last dive time
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4034 movff surface_interval+0,lo ; NO - show dive interval
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4035 movff surface_interval+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4036 call convert_time ; lo=mins, hi=hours
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4037 movf hi,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4038 movff lo,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4039 movwf lo ; exchange lo and hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4040 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4041 output_99x
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4042 PUTC 'h'
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4043 movff hi,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4044 output_99x
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4045 STRCAT_PRINT "m "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4046 bra TFT_surface_lastdive_2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4047 TFT_surface_lastdive_1:
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4048 movff lastdive_time+0,xC+0
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4049 movff lastdive_time+1,xC+1
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4050 movff lastdive_time+2,xC+2
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4051 movff lastdive_time+3,xC+3
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4052 movlw LOW .3600
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4053 movwf xB+0
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4054 movlw HIGH .3600
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4055 movwf xB+1 ; One day = 3600s
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4056 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4057 ;xC+0:xC+1 -> Full hours
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4058 movff xC+1,xA+1
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4059 movff xC+0,xA+0
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4060 clrf xB+1
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4061 movlw .24
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4062 movwf xB+0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4063 call div16x16 ;xA/xB=xC with xA+0 as remainder
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4064 movff xC+0,lo
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4065 movff xC+1,hi ; Full days
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4066 bsf leftbind
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4067 output_16
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4068 PUTC "d"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4069 movff xA+0,lo ; Full hours
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4070 output_8
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4071 STRCAT_PRINT "h "
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4072 TFT_surface_lastdive_2:
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4073 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.1)
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4074 movff lastdive_duration+0,lo
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4075 movff lastdive_duration+1,hi
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4076 output_16 ; divetime minutes
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4077 PUTC ":"
504
heinrichsweikamp
parents: 503
diff changeset
4078 movff lastdive_duration+2,lo
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4079 output_99x ; divetime seconds
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4080 STRCAT_PRINT ""
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4081 WIN_SMALL surf_gaslist_column+.48,surf_gaslist_row+(surf_gaslist_spacing*.2)
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4082 movff lastdive_maxdepth+0,lo
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4083 movff lastdive_maxdepth+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4084 TSTOSS opt_units ; 0=Meters, 1=Feets
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4085 bra TFT_surface_lastdive_metric
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4086 ;imperial
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4087 rcall convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4088 output_16_3 ; limit to 999 and display only (0-999)
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4089 STRCAT_TEXT tFeets1
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4090 bra TFT_surface_lastdive2
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4091
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4092 TFT_surface_lastdive_metric:
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4093 bsf ignore_digit5 ; no cm...
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4094 movlw d'1' ; +1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4095 movff WREG,ignore_digits ; no 1000m
503
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4096 output_16dp .3 ; xxx.y
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4097 STRCAT_TEXT tMeters
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4098 TFT_surface_lastdive2:
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4099 STRCAT_PRINT ""
4542d03f748a NEW: Last Dive customviews in surface mode with divetime, depth and interval
heinrichsweikamp
parents: 490
diff changeset
4100 bcf leftbind
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4101 return ; Done.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4102
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4103 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4104
0
heinrichsweikamp
parents:
diff changeset
4105 global TFT_surface_tissues
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4106 TFT_surface_tissues: ; Show Tissue diagram in surface mode
0
heinrichsweikamp
parents:
diff changeset
4107 WIN_SMALL surf_tissue_N2_column,surf_tissue_N2_row
heinrichsweikamp
parents:
diff changeset
4108 STRCPY_TEXT_PRINT tN2
heinrichsweikamp
parents:
diff changeset
4109 WIN_SMALL surf_tissue_He_column,surf_tissue_He_row
heinrichsweikamp
parents:
diff changeset
4110 STRCPY_TEXT_PRINT tHe
heinrichsweikamp
parents:
diff changeset
4111
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4112 movlw color_deepblue
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4113 call TFT_set_color ; Make this configurable?
0
heinrichsweikamp
parents:
diff changeset
4114 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.29,.29
heinrichsweikamp
parents:
diff changeset
4115 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.37,.37
heinrichsweikamp
parents:
diff changeset
4116 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.45,.45
heinrichsweikamp
parents:
diff changeset
4117 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.53,.53
heinrichsweikamp
parents:
diff changeset
4118 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.61,.61
heinrichsweikamp
parents:
diff changeset
4119 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.69,.69
heinrichsweikamp
parents:
diff changeset
4120 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.77,.77
heinrichsweikamp
parents:
diff changeset
4121 WIN_FRAME_COLOR16 surf_tissue_diagram_top+.23,surf_tissue_diagram_bottom-.4,.85,.85
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4122 WIN_FRAME_STD surf_tissue_diagram_top, surf_tissue_diagram_bottom, surf_tissue_diagram_left, surf_tissue_diagram_right ; outer frame
0
heinrichsweikamp
parents:
diff changeset
4123
heinrichsweikamp
parents:
diff changeset
4124 movlw .1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4125 movff WREG,win_height ; row bottom (0-239)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4126
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4127 ;---- Draw N2 Tissues ----------------------------------------------------
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4128
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4129 movlw surf_tissue_diagram_left+.4 ; start position for N2 bars
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4130 movff WREG,win_leftx2 ; column left (0-159)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4131 movlw surf_tissue_diagram_right - surf_tissue_diagram_left - .4 ; max width for N2 bars
0
heinrichsweikamp
parents:
diff changeset
4132 movff WREG,win_width
heinrichsweikamp
parents:
diff changeset
4133
heinrichsweikamp
parents:
diff changeset
4134 lfsr FSR2, char_O_tissue_N2_saturation
heinrichsweikamp
parents:
diff changeset
4135 movlw d'16'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4136 movwf wait_temp ; 16 tissues
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4137 clrf waitms_temp ; row offset
0
heinrichsweikamp
parents:
diff changeset
4138 surf_tissue_saturation_graph_N2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4139 movlw surf_tissue_diagram_top+.23 ; surface mode
0
heinrichsweikamp
parents:
diff changeset
4140 addwf waitms_temp,W
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4141 movff WREG,win_top ; row top (0-239)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4142 rcall surf_tissue_saturation_loop ; show one tissue
0
heinrichsweikamp
parents:
diff changeset
4143 decfsz wait_temp,F
heinrichsweikamp
parents:
diff changeset
4144 bra surf_tissue_saturation_graph_N2
heinrichsweikamp
parents:
diff changeset
4145
heinrichsweikamp
parents:
diff changeset
4146 ;---- Draw He Tissues ----------------------------------------------------
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4147
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4148 movlw surf_tissue_diagram_left + .24 ; start position for He bars (.15 without x2)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4149 movff WREG,win_leftx2 ; column left (0-159)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4150 movlw surf_tissue_diagram_right - surf_tissue_diagram_left - .24 ; max width for He bars
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4151 movff WREG,win_width
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4152
0
heinrichsweikamp
parents:
diff changeset
4153 lfsr FSR2, char_O_tissue_He_saturation
heinrichsweikamp
parents:
diff changeset
4154 movlw d'16'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4155 movwf wait_temp ; 16 tissues
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4156 clrf waitms_temp ; row offset
0
heinrichsweikamp
parents:
diff changeset
4157 surf_tissue_saturation_graph_He:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4158 movlw surf_tissue_diagram_top+.23+.56 ; surface mode
0
heinrichsweikamp
parents:
diff changeset
4159 addwf waitms_temp,W
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4160 movff WREG,win_top ; row top (0-239)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4161 rcall surf_tissue_saturation_loop ; show one tissue
0
heinrichsweikamp
parents:
diff changeset
4162 decfsz wait_temp,F
heinrichsweikamp
parents:
diff changeset
4163 bra surf_tissue_saturation_graph_He
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4164
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4165 WIN_SMALL surf_tissue_He_column+.22,surf_tissue_He_row ; position in-between tissue bars
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4166 movff int_O_CNS_fraction+0,lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4167 movff int_O_CNS_fraction+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4168 TFT_color_code warn_cns
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4169 STRCPY_TEXT tCNS2 ; CNS:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4170 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4171 output_16_3 ; Displays only 0...999
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4172 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4173 STRCAT_PRINT "%"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4174 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
4175
heinrichsweikamp
parents:
diff changeset
4176 surf_tissue_saturation_loop:
heinrichsweikamp
parents:
diff changeset
4177 call TFT_standard_color
heinrichsweikamp
parents:
diff changeset
4178 movlw .2 ; row spacing
heinrichsweikamp
parents:
diff changeset
4179 addwf waitms_temp,F
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4180 movf POSTINC2,W ; get tissue load
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4181 bcf WREG,7 ; clear flag bit for sat/desat info (not used in surface mode)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4182 rlncf WREG,W ; multiply with 2 (previously cleared bit 7 will be rotated to bit 0)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4183 incf WREG,W ; add 1 for a minimum visible bar (He-bars could be invisible else-wise)
0
heinrichsweikamp
parents:
diff changeset
4184 movwf temp1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4185 movff win_width+0,WREG ; get max window width (win_width)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4186 cpfslt temp1 ; skip if WREG < win_width
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4187 movwf temp1 ; crop length to win_width
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4188 ; no need to be able to draw longer bars –
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4189 ; we are at the surface and if bars would
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4190 ; even touch the max length possible here,
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4191 ; the diver would be in severe decompression
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4192 ; issues if not dead already...
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
4193 movff temp1,win_bargraph
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
4194 clrf win_width+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4195 goto TFT_box ; and return...
0
heinrichsweikamp
parents:
diff changeset
4196
heinrichsweikamp
parents:
diff changeset
4197 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4198 ; Draw saturation graph in dive mode.
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4199
0
heinrichsweikamp
parents:
diff changeset
4200 DISP_tissue_saturation_graph:
heinrichsweikamp
parents:
diff changeset
4201 ;---- Draw Frame
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 48
diff changeset
4202 call TFT_standard_color
300
5ad479f2a868 Merged Screen layout mod #1 into Screen layout work #3
Janos Kovacs <kovjanos@gmail.com>
parents: 275
diff changeset
4203 WIN_FRAME_COLOR16 dm_custom_tissue_diagram_top, dm_custom_tissue_diagram_bottom, dm_custom_tissue_diagram_left, .159 ; outer frame
0
heinrichsweikamp
parents:
diff changeset
4204
heinrichsweikamp
parents:
diff changeset
4205 movlw .1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4206 movff WREG,win_height ; row bottom (0-239)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4207
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4208 ;---- Draw N2 Tissues ----------------------------------------------------
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4209
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4210 movlw dm_custom_tissue_diagram_left+.3 ; divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4211 movff WREG,win_leftx2 ; column left (0-159)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4212 movlw .159-dm_custom_tissue_diagram_left-.4 ; width
0
heinrichsweikamp
parents:
diff changeset
4213 movff WREG,win_width
heinrichsweikamp
parents:
diff changeset
4214
heinrichsweikamp
parents:
diff changeset
4215 lfsr FSR2, char_O_tissue_N2_saturation
heinrichsweikamp
parents:
diff changeset
4216 movlw d'16'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4217 movwf wait_temp ; 16 tissues
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4218 clrf waitms_temp ; row offset
0
heinrichsweikamp
parents:
diff changeset
4219 tissue_saturation_graph_N2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4220 movlw dm_custom_tissue_diagram_top+.3 ; divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4221 rcall tissue_saturation_graph_loop ; show one tissue
0
heinrichsweikamp
parents:
diff changeset
4222 decfsz wait_temp,F
heinrichsweikamp
parents:
diff changeset
4223 bra tissue_saturation_graph_N2
heinrichsweikamp
parents:
diff changeset
4224
heinrichsweikamp
parents:
diff changeset
4225 ;---- Draw He Tissues ----------------------------------------------------
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4226
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4227 movlw dm_custom_tissue_diagram_left + .8 ; divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4228 movff WREG,win_leftx2 ; column left (0-159)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4229 movlw .159 - dm_custom_tissue_diagram_left - .14 ; width
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4230 movff WREG,win_width
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4231
0
heinrichsweikamp
parents:
diff changeset
4232 lfsr FSR2, char_O_tissue_He_saturation
heinrichsweikamp
parents:
diff changeset
4233 movlw d'16'
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4234 movwf wait_temp ; 16 tissues
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4235 clrf waitms_temp ; row offset
0
heinrichsweikamp
parents:
diff changeset
4236 tissue_saturation_graph_He:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4237 movlw dm_custom_tissue_diagram_top+.3+.22 ; divemode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4238 rcall tissue_saturation_graph_loop ; show one tissue
0
heinrichsweikamp
parents:
diff changeset
4239 decfsz wait_temp,F
heinrichsweikamp
parents:
diff changeset
4240 bra tissue_saturation_graph_He
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4241 goto TFT_standard_color ; and return...
0
heinrichsweikamp
parents:
diff changeset
4242
heinrichsweikamp
parents:
diff changeset
4243 tissue_saturation_graph_loop:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4244 addwf waitms_temp,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4245 movff WREG,win_top ; row top (0-239)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4246 movlw color_cyan ; preset color for tissues with decreasing pressure
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4247 call TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
4248 incf waitms_temp,F
heinrichsweikamp
parents:
diff changeset
4249 movf POSTINC2,W
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4250 btfss WREG,7 ; check fs flag for increasing tissue pressure set
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4251 bra tissue_saturation_graph_loop_1 ; NO - keep color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4252 movwf temp1 ; YES - buffer WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4253 movlw color_orange ; select color for tissues with increasing pressure
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4254 call TFT_set_color ; change color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4255 movf temp1,W ; restore WREG
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4256 tissue_saturation_graph_loop_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4257 bcf WREG,7 ; clear flag bit
0
heinrichsweikamp
parents:
diff changeset
4258 bcf STATUS,C
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4259 rrcf WREG ; divide by 2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4260 incf WREG,W ; add a bit for a minimum visible bar
0
heinrichsweikamp
parents:
diff changeset
4261 movwf temp1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4262 ;movlw .1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4263 ;addwf temp1,F ; add a bit for a minimum visible bar (old version)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4264 movf win_width,W ; get max window width (win_width)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4265 cpfslt temp1 ; skip if WREG < win_width
0
heinrichsweikamp
parents:
diff changeset
4266 movwf temp1
heinrichsweikamp
parents:
diff changeset
4267 movff temp1,win_bargraph
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
4268 clrf win_width+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4269 goto TFT_box ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4270
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4271 ;=============================================================================
55
448ba265fdae Change "O2" warning to "ppO2"
heinrichsweikamp
parents: 54
diff changeset
4272
0
heinrichsweikamp
parents:
diff changeset
4273 global TFT_display_cns
heinrichsweikamp
parents:
diff changeset
4274 TFT_display_cns:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4275 call TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4276 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4277 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4278 STRCPY_TEXT tCNS ; CNS:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4279 movff int_O_CNS_fraction+0,lo
0
heinrichsweikamp
parents:
diff changeset
4280 movff int_O_CNS_fraction+1,hi
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4281 TFT_color_code warn_cns ; Color-code CNS output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4282 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4283 output_16_3 ; Displays only 0...999
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4284 bcf leftbind
0
heinrichsweikamp
parents:
diff changeset
4285 PUTC "%"
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4286 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4287 btfss divemode ; In Divemode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4288 movlw surf_warning_length ; No, use surface string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4289 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4290 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4291 bcf win_invert
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4292 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4293
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4294
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4295 global TFT_display_eod_cns
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4296 TFT_display_eod_cns:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4297 call TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4298 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4299 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4300 call TFT_warnings_color ; switch to warnings (red) text color
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4301 STRCPY_TEXT tCNSeod ; end-of-dive CNS warning text
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4302 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4303 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
0
heinrichsweikamp
parents:
diff changeset
4304 STRCAT_PRINT ""
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4305 goto TFT_standard_color ; and return...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4306
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4307
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4308 global TFT_display_ppo2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4309 TFT_display_ppo2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4310 call TFT_warning_set_window ; Sets the row and column for the current warning
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4311 tstfsz WREG ; Is there room for the warning?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4312 return ; No
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4313 movff int_O_pure_ppO2+0,lo ; copy ppO2 of the pure gas (OC: = breathed gas, loop: = diluent/premix) to hi:lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4314 movff int_O_pure_ppO2+1,hi
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4315 TFT_color_code warn_ppo2 ; Color-code output
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4316 btfss FLAG_ccr_mode ; in CCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4317 bra TFT_display_diluent_1 ; NO - continue with pSCR or OC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4318 btfsc is_bailout ; YES - in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4319 bra TFT_display_diluent_2 ; YES - continue with OC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4320 STRCPY_TEXT tdil ; NO - print "Dil:"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4321 bra TFT_display_diluent_3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4322 TFT_display_diluent_1:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4323 btfss FLAG_pscr_mode ; in pSCR mode?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4324 bra TFT_display_diluent_2 ; NO - continue with pSCR or OC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4325 btfsc is_bailout ; YES - in bailout?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4326 bra TFT_display_diluent_2 ; YES - continue with OC
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4327 STRCPY_TEXT tmix ; NO - print "Mix:"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4328 bra TFT_display_diluent_3
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4329 TFT_display_diluent_2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4330 STRCPY_TEXT tppO2 ; OC mode or bailout, print "ppO2:"
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4331 TFT_display_diluent_3:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4332 bsf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4333 output_16dp .3 ; x.xx bar
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4334 bcf leftbind
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4335 movlw dm_warning_length ; Divemode string length
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4336 call TFT_fillup_with_spaces ; Fillup FSR2 with spaces (Total string length in #WREG)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4337 STRCAT_PRINT ""
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4338 goto TFT_standard_color ; and return...
530
d36f9fca10ae 2.20beta release
heinrichsweikamp
parents: 526
diff changeset
4339
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4340 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4341
0
heinrichsweikamp
parents:
diff changeset
4342 global TFT_LogOffset_Logtitle
heinrichsweikamp
parents:
diff changeset
4343 TFT_LogOffset_Logtitle:
heinrichsweikamp
parents:
diff changeset
4344 STRCPY_TEXT tLogOffset
heinrichsweikamp
parents:
diff changeset
4345 PUTC ":"
heinrichsweikamp
parents:
diff changeset
4346 call do_logoffset_common_read ; Offset into lo:hi
heinrichsweikamp
parents:
diff changeset
4347 bsf leftbind
535
cf68fe0c3002 NEW: Show a warning for each sensor if the sensor is end-of-life after calibration (Less then 8mV in Air at sea level)
heinrichsweikamp
parents: 533
diff changeset
4348 output_16_4
0
heinrichsweikamp
parents:
diff changeset
4349 bcf leftbind
heinrichsweikamp
parents:
diff changeset
4350 PUTC " "
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4351 return ; No "_PRINT" here...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4352
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4353 ;=============================================================================
0
heinrichsweikamp
parents:
diff changeset
4354
heinrichsweikamp
parents:
diff changeset
4355 global adjust_depth_with_salinity
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4356 global adjust_depth_with_salinity_log
0
heinrichsweikamp
parents:
diff changeset
4357 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mbar]
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4358 btfsc simulatormode_active ; Do not apply salinity in Simulatormode
0
heinrichsweikamp
parents:
diff changeset
4359 return
heinrichsweikamp
parents:
diff changeset
4360 movff opt_salinity,WREG ; 0-5%
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4361 adjust_depth_with_salinity_log: ; computes salinity setting (FROM WREG!) into lo:hi [mbar]
0
heinrichsweikamp
parents:
diff changeset
4362 addlw d'100' ; 1.00kg/l
heinrichsweikamp
parents:
diff changeset
4363 movwf wait_temp
heinrichsweikamp
parents:
diff changeset
4364
heinrichsweikamp
parents:
diff changeset
4365 movlw d'105' ; 105% ?
heinrichsweikamp
parents:
diff changeset
4366 cpfslt wait_temp ; Salinity higher limit
heinrichsweikamp
parents:
diff changeset
4367 return ; Out of limit, do not adjust lo:hi
heinrichsweikamp
parents:
diff changeset
4368 movlw d'99' ; 99% ?
heinrichsweikamp
parents:
diff changeset
4369 cpfsgt wait_temp ; Salinity lower limit
heinrichsweikamp
parents:
diff changeset
4370 return ; Out of limit, do not adjust lo:hi
heinrichsweikamp
parents:
diff changeset
4371
heinrichsweikamp
parents:
diff changeset
4372 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
4373 movff hi,xA+1
heinrichsweikamp
parents:
diff changeset
4374
heinrichsweikamp
parents:
diff changeset
4375 movlw d'102' ; 0,98bar/10m
heinrichsweikamp
parents:
diff changeset
4376 movwf xB+0
heinrichsweikamp
parents:
diff changeset
4377 clrf xB+1
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4378 call mult16x16 ; xA*xB=xC (lo:hi * 100)
0
heinrichsweikamp
parents:
diff changeset
4379 movff wait_temp,xB+0 ; Salinity
heinrichsweikamp
parents:
diff changeset
4380 clrf xB+1
heinrichsweikamp
parents:
diff changeset
4381 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
heinrichsweikamp
parents:
diff changeset
4382 movff xC+0,lo
heinrichsweikamp
parents:
diff changeset
4383 movff xC+1,hi ; restore lo and hi with updated value
heinrichsweikamp
parents:
diff changeset
4384 return
heinrichsweikamp
parents:
diff changeset
4385
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4386 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4387
0
heinrichsweikamp
parents:
diff changeset
4388 global convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
heinrichsweikamp
parents:
diff changeset
4389 convert_mbar_to_feet: ; convert value in lo:hi from mbar to feet
heinrichsweikamp
parents:
diff changeset
4390 movff lo,xA+0
heinrichsweikamp
parents:
diff changeset
4391 movff hi,xA+1
heinrichsweikamp
parents:
diff changeset
4392
heinrichsweikamp
parents:
diff changeset
4393 movlw LOW d'328' ; 328feet/100m
heinrichsweikamp
parents:
diff changeset
4394 movwf xB+0
heinrichsweikamp
parents:
diff changeset
4395 movlw HIGH d'328'
heinrichsweikamp
parents:
diff changeset
4396 movwf xB+1
heinrichsweikamp
parents:
diff changeset
4397
heinrichsweikamp
parents:
diff changeset
4398 call mult16x16 ; xA*xB=xC (lo:hi * 328)
heinrichsweikamp
parents:
diff changeset
4399
heinrichsweikamp
parents:
diff changeset
4400 movlw d'50' ; round up
heinrichsweikamp
parents:
diff changeset
4401 addwf xC+0,F
heinrichsweikamp
parents:
diff changeset
4402 movlw 0
heinrichsweikamp
parents:
diff changeset
4403 addwfc xC+1,F
heinrichsweikamp
parents:
diff changeset
4404 addwfc xC+2,F
heinrichsweikamp
parents:
diff changeset
4405 addwfc xC+3,F
heinrichsweikamp
parents:
diff changeset
4406
heinrichsweikamp
parents:
diff changeset
4407 movlw LOW .10000
heinrichsweikamp
parents:
diff changeset
4408 movwf xB+0
heinrichsweikamp
parents:
diff changeset
4409 movlw HIGH .10000
heinrichsweikamp
parents:
diff changeset
4410 movwf xB+1
heinrichsweikamp
parents:
diff changeset
4411
heinrichsweikamp
parents:
diff changeset
4412 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
heinrichsweikamp
parents:
diff changeset
4413
heinrichsweikamp
parents:
diff changeset
4414 movff xC+0,lo
heinrichsweikamp
parents:
diff changeset
4415 movff xC+1,hi ; restore lo and hi with updated value
heinrichsweikamp
parents:
diff changeset
4416 return
heinrichsweikamp
parents:
diff changeset
4417
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4418 ;=============================================================================
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4419
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4420 global convert_celsius_to_fahrenheit ; convert value in lo:hi from celsius to fahrenheit
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4421 convert_celsius_to_fahrenheit: ; convert value in lo:hi from celsius to fahrenheit
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4422 movff lo,xA+0 ; temperature in 1/10 of °C
552
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4423 movff hi,xA+1
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4424
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4425 movlw LOW d'1000' ; offset °C value by 1000 to get out of any negative numbers
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4426 addwf xA+0,F
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4427 movlw HIGH d'1000'
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4428 addwfc xA+1,F
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4429
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4430 movlw d'18' ; adjust scaling: 1°C = 1.8°F
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4431 movwf xB+0
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4432 clrf xB+1
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4433
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4434 call mult16x16 ; xA*xB=xC (lo:hi * 18)
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4435
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4436 movlw d'10'
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4437 movwf xB+0
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4438 clrf xB+1
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4439
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4440 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4441
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4442 movlw LOW d'1480' ; adjust offset: subtract above offset of 1000 * 1.8 = 1800 now and add 320 => subtract 1480
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4443 subwf xC+0,F
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4444 movlw HIGH d'1480'
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4445 subwfb xC+1,F
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4446
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4447 movff xC+0,lo
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4448 movff xC+1,hi ; restore lo and hi with updated value
af84c45429fd BUGFIX: Display of negative (?C) water temperatures
heinrichsweikamp
parents: 551
diff changeset
4449 return
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4450
480
ad8acade5567 NEW: PSCR mode (Passive semi-closed rebreather)
heinrichsweikamp
parents: 477
diff changeset
4451 ;=============================================================================
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 553
diff changeset
4452
0
heinrichsweikamp
parents:
diff changeset
4453 END