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