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