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