Mercurial > public > hwos_code
annotate src/customview.asm @ 110:d39493c786a2
BUGFIX: OSTC settings via USB issues
author | heinrichsweikamp |
---|---|
date | Tue, 10 Jun 2014 10:14:18 +0200 |
parents | 0aaa4877ba25 |
children | 2acf3d068fae |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File customview.asm | |
4 ; | |
5 ; Customview in Surfacemode and Divemode | |
6 ; | |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-08-10 : [mH] moving from OSTC code | |
11 | |
12 ;============================================================================= | |
13 | |
14 #include "ostc3.inc" ; Mandatory header | |
15 #include "tft_outputs.inc" | |
16 #include "strings.inc" | |
17 #include "tft.inc" | |
18 #include "isr.inc" | |
19 #include "wait.inc" | |
20 #include "surfmode.inc" | |
21 #include "convert.inc" | |
22 #include "divemode.inc" | |
23 #include "i2c.inc" | |
24 | |
25 gui CODE | |
26 | |
27 ;============================================================================= | |
28 ; Do every-second tasks for the custom view area (Dive mode) | |
29 | |
30 global customview_second | |
31 customview_second: | |
32 movff menupos3,WREG ; copy | |
33 dcfsnz WREG,F | |
34 bra customview_1sec_view1 | |
35 dcfsnz WREG,F | |
36 bra customview_1sec_view2 | |
37 dcfsnz WREG,F | |
38 bra customview_1sec_view3 | |
39 dcfsnz WREG,F | |
40 bra customview_1sec_view4 | |
41 dcfsnz WREG,F | |
42 bra customview_1sec_view5 | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
43 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
44 bra customview_1sec_view6 |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
45 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
46 bra customview_1sec_view7 |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
47 dcfsnz WREG,F |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
48 bra customview_1sec_view8 |
0 | 49 ; Menupos3=0, do nothing |
50 return | |
51 | |
52 customview_1sec_view3: | |
53 call TFT_decoplan ; Show decoplan | |
54 return | |
55 customview_1sec_view2: | |
56 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
57 return | |
58 customview_1sec_view1: | |
59 call TFT_update_hud ; Update HUD data | |
60 return | |
61 customview_1sec_view4: | |
62 call TFT_ead_end_tissues_clock ; Update EAD/END, Tissues and clock | |
63 return | |
64 customview_1sec_view5: | |
65 call TFT_gf_info ; Update GF informations | |
66 return | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
67 customview_1sec_view6: |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
68 ; Compass updated seperately (Faster) in divemode |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
69 return |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
70 customview_1sec_view7: ; Dynamic gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
71 call TFT_dyn_gaslist ; Update the gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
72 return |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
73 customview_1sec_view8: ; Sensor voltages |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
74 call TFT_hud_voltages ; Show HUD details |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
75 return |
0 | 76 |
77 ;============================================================================= | |
78 ; Do every-minute tasks for the custom view area | |
79 | |
80 global customview_minute | |
81 customview_minute: | |
82 return | |
83 ; movff menupos3,WREG ; copy | |
84 ; dcfsnz WREG,F | |
85 ; bra customview_1min_view1 | |
86 ; dcfsnz WREG,F | |
87 ; bra customview_1min_view2 | |
88 ; dcfsnz WREG,F | |
89 ; bra customview_1min_view3 | |
90 ; dcfsnz WREG,F | |
91 ; bra customview_1min_view4 | |
92 ; dcfsnz WREG,F | |
93 ; bra customview_1min_view5 | |
94 ; dcfsnz WREG,F | |
95 ; bra customview_1min_view6 | |
96 ; dcfsnz WREG,F | |
97 ; bra customview_1min_view7 | |
98 ; dcfsnz WREG,F | |
99 ; bra customview_1min_view8 | |
100 ; dcfsnz WREG,F | |
101 ; bra customview_1min_view9 | |
102 ; dcfsnz WREG,F | |
103 ; bra customview_1min_view10 | |
104 ; dcfsnz WREG,F | |
105 ; bra customview_1min_view11 | |
106 ; ; Menupos3=0, do nothing | |
107 ; return | |
108 ; | |
109 ;customview_1min_view1: | |
110 ;customview_1min_view2: | |
111 ;customview_1min_view3: | |
112 ;customview_1min_view4: | |
113 ;customview_1min_view5: | |
114 ;customview_1min_view6: | |
115 ;customview_1min_view7: | |
116 ;customview_1min_view8: | |
117 ;customview_1min_view9: | |
118 ;customview_1min_view10: | |
119 ;customview_1min_view11: | |
120 ; return | |
121 | |
122 global surf_customview_toggle | |
123 surf_customview_toggle: | |
124 bcf switch_right | |
125 incf menupos3,F ; Number of customview to show | |
41 | 126 movlw d'7' ; Max number of customsviews in surface mode |
0 | 127 cpfsgt menupos3 ; Max reached? |
128 bra surf_customview_mask ; No, show | |
129 movlw .1 | |
130 movwf menupos3 ; Reset to one (Always one custom view visible) | |
131 | |
132 global surf_customview_mask | |
133 surf_customview_mask: | |
48 | 134 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
0 | 135 call TFT_standard_color |
136 movff menupos3,WREG ; Menupos3 holds number of customview function | |
137 dcfsnz WREG,F | |
138 bra surf_customview_init_view1 ; OC Gas list | |
139 dcfsnz WREG,F | |
140 bra surf_customview_init_view2 ; CC Dil list | |
141 dcfsnz WREG,F | |
142 bra surf_customview_init_view3 ; CC SP list | |
143 dcfsnz WREG,F | |
144 bra surf_customview_init_view4 ; Custom Text | |
145 dcfsnz WREG,F | |
146 bra surf_customview_init_view5 ; Tissue Diagram | |
41 | 147 dcfsnz WREG,F |
0 | 148 bra surf_customview_init_view6 ; Compass |
41 | 149 dcfsnz WREG,F |
150 bra surf_customview_init_view7 ; Deco settings | |
0 | 151 |
152 call I2C_sleep_accelerometer ; Stop accelerometer | |
153 call I2C_sleep_compass ; Stop compass | |
154 | |
155 movlw .1 | |
156 movwf menupos3 ; Reset to one (Always one custom view visible) | |
157 | |
158 surf_customview_init_view1: ; View1: OC Gas list | |
159 btfsc FLAG_ccr_mode | |
160 bra surf_customview_toggle | |
161 btfsc FLAG_gauge_mode | |
162 bra surf_customview_toggle | |
163 btfsc FLAG_apnoe_mode | |
164 bra surf_customview_toggle | |
165 call TFT_gaslist_surfmode ; Show gas list | |
166 bra customview_toggle_exit ; Done. | |
167 | |
168 surf_customview_init_view2: ; View2: CC Dil list | |
169 btfss FLAG_ccr_mode | |
170 bra surf_customview_toggle | |
171 btfsc FLAG_gauge_mode | |
172 bra surf_customview_toggle | |
173 btfsc FLAG_apnoe_mode | |
174 bra surf_customview_toggle | |
175 call TFT_dillist_surfmode ; Show diluent list | |
176 bra customview_toggle_exit ; Done. | |
177 | |
178 surf_customview_init_view3: ; View3: CC SP list | |
179 btfss FLAG_ccr_mode | |
180 bra surf_customview_toggle | |
181 btfsc FLAG_gauge_mode | |
182 bra surf_customview_toggle | |
183 btfsc FLAG_apnoe_mode | |
184 bra surf_customview_toggle | |
185 call TFT_splist_surfmode ; Show Setpoint list | |
186 bra customview_toggle_exit ; Done. | |
187 | |
188 surf_customview_init_view4: ; View4: Custom text | |
189 call TFT_custom_text ; Show the custom text | |
190 bra customview_toggle_exit ; Done. | |
191 | |
192 surf_customview_init_view5: ; View5: Tissue Diagram | |
193 btfsc FLAG_gauge_mode | |
194 bra surf_customview_toggle | |
195 btfsc FLAG_apnoe_mode | |
196 bra surf_customview_toggle | |
197 call TFT_surface_tissues ; Show Tissue diagram | |
198 bra customview_toggle_exit ; Done. | |
199 | |
200 surf_customview_init_view6: ; View6: Compass | |
201 call I2C_init_accelerometer ; Start accelerometer | |
202 call I2C_init_compass ; Start compass | |
203 call TFT_surface_compass_mask ; Show compass | |
204 bra customview_toggle_exit ; Done. | |
41 | 205 surf_customview_init_view7: |
206 btfsc FLAG_gauge_mode | |
207 bra surf_customview_toggle | |
208 btfsc FLAG_apnoe_mode | |
209 bra surf_customview_toggle | |
210 extern deco_setup_dive | |
211 call deco_setup_dive | |
212 call TFT_surface_decosettings ; Show all deco settings | |
213 bra customview_toggle_exit ; Done. | |
0 | 214 |
215 global menuview_toggle | |
216 menuview_toggle: ; Show Menu or the simulator tasks | |
217 movlw divemode_menuview_timeout | |
218 movwf timeout_counter3 | |
219 bsf menuview | |
220 bcf switch_left | |
221 incf menupos2,F ; Number of options to show | |
222 movlw d'6' ; Max number of options in divemode | |
223 cpfsgt menupos2 ; Max reached? | |
224 bra menuview_mask ; No, show | |
225 global menuview_toggle_reset | |
226 menuview_toggle_reset: ; Timeout occured | |
227 clrf menupos2 | |
228 bcf menuview | |
229 menuview_mask: | |
230 WIN_BOX_BLACK divemode_simtext_row, divemode_simtext_row+.24, divemode_simtext_column, divemode_simtext_column+.49 ; top, bottom, left, right | |
231 btfss FLAG_gauge_mode | |
232 bra menuview_mask2 | |
233 ; Clear some more in gauge mode | |
234 WIN_BOX_BLACK divemode_simtext_row, divemode_simtext_row+.24, divemode_simtext_column+.50, divemode_simtext_column+.70 ; top, bottom, left, right | |
235 menuview_mask2: | |
236 movlw color_yellow | |
237 call TFT_set_color | |
238 WIN_SMALL_INVERT divemode_simtext_column,divemode_simtext_row | |
239 movff menupos2,WREG ; Menupos2 holds number of menu option to show | |
240 dcfsnz WREG,F | |
241 bra menuview_view1 | |
242 dcfsnz WREG,F | |
243 bra menuview_view2 | |
244 dcfsnz WREG,F | |
245 bra menuview_view3 | |
246 dcfsnz WREG,F | |
247 bra menuview_view4 | |
248 dcfsnz WREG,F | |
249 bra menuview_view5 | |
250 dcfsnz WREG,F | |
251 bra menuview_view6 | |
252 menuview_exit: | |
253 call TFT_standard_color | |
254 WIN_INVERT .0 | |
255 return ; Menupos2 = 0, Show nothing | |
256 menuview_view1: | |
257 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
258 bra menuview_toggle ; Call next option | |
259 btfsc FLAG_gauge_mode ; In Gauge mode? | |
260 bra menuview_toggle ; Call next option | |
261 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?" | |
262 bra menuview_exit ; Done. | |
263 menuview_view2: | |
264 btfss simulatormode_active ; View only for simulator mode | |
265 bra menuview_toggle ; Call next option | |
266 STRCPY_TEXT_PRINT tQuitSim ;"Quit Simulation?" | |
267 bra menuview_exit ; Done. | |
268 menuview_view3: | |
269 btfss simulatormode_active ; View only for simulator mode | |
270 bra menuview_toggle ; Call next option | |
271 STRCPY_TEXT_PRINT tDescent1m ; "Descent 1m" | |
272 bra menuview_exit ; Done. | |
273 menuview_view4: | |
274 btfss simulatormode_active ; View only for simulator mode | |
275 bra menuview_toggle ; Call next option | |
276 STRCPY_TEXT_PRINT tAscent1m ; "Ascend 1m" | |
277 bra menuview_exit ; Done. | |
278 menuview_view5: | |
279 btfss FLAG_apnoe_mode ; In Apnoe mode? | |
280 bra menuview_toggle ; No, call next option | |
281 btfsc FLAG_active_descent ; Are we descending? | |
282 bra menuview_toggle ; Yes | |
283 ; We are at the surface: | |
284 STRCPY_TEXT_PRINT tQuitApnea ; "Quit Apnea mode?" | |
285 bra menuview_exit ; Done. | |
286 menuview_view6: | |
287 btfss FLAG_gauge_mode ; In Gauge mode? | |
288 bra menuview_toggle ; No, call next option | |
289 STRCPY_TEXT_PRINT tDivemenu_ResetAvr ; "Reset Avr." | |
290 bra menuview_exit ; Done. | |
291 | |
292 | |
293 ;============================================================================= | |
294 ; Show next customview (and delete this flag) | |
295 global customview_toggle | |
296 customview_toggle: | |
297 bcf switch_right | |
298 incf menupos3,F ; Number of customview to show | |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
299 movlw d'8' ; Max number of customsviews in divemode |
0 | 300 cpfsgt menupos3 ; Max reached? |
301 bra customview_mask ; No, show | |
302 customview_toggle_reset: ; Timeout occured | |
303 clrf menupos3 ; Reset to zero (Zero=no custom view) | |
39
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
0
diff
changeset
|
304 global customview_mask |
0 | 305 customview_mask: |
306 call TFT_clear_customview_divemode | |
307 WIN_SMALL divemode_customview_column,divemode_customview_row | |
308 call TFT_standard_color | |
309 movff menupos3,WREG ; Menupos3 holds number of customview function | |
310 dcfsnz WREG,F | |
311 bra customview_init_view1 | |
312 dcfsnz WREG,F | |
313 bra customview_init_view2 | |
314 dcfsnz WREG,F | |
315 bra customview_init_view3 | |
316 dcfsnz WREG,F | |
317 bra customview_init_view4 | |
318 dcfsnz WREG,F | |
319 bra customview_init_view5 ; GF informations | |
320 dcfsnz WREG,F | |
321 bra customview_init_view6 ; Compass | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
322 dcfsnz WREG,F |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
323 bra customview_init_view7 ; Dynamic gaslist |
105 | 324 dcfsnz WREG,F |
325 bra customview_init_view8 ; HUD voltages | |
0 | 326 customview_init_nocustomview: |
327 call I2C_sleep_accelerometer ; Stop accelerometer | |
328 call I2C_sleep_compass ; Stop compass | |
329 bra customview_toggle_exit | |
330 | |
331 customview_init_view1: | |
332 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
333 bra customview_toggle ; yes, Call next view... | |
334 btfss FLAG_ccr_mode ; In CC mode? | |
335 bra customview_toggle ; no, Call next view... | |
336 | |
337 bsf dive_hud1_displayed ; Set display flag | |
338 bsf dive_hud2_displayed ; Set display flag | |
339 bsf dive_hud3_displayed ; Set display flag | |
340 call TFT_hud_mask ; Setup HUD mask | |
341 call TFT_update_hud ; Update HUD data | |
342 bra customview_toggle_exit | |
343 | |
344 customview_init_view2: | |
345 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
346 bra customview_toggle ; Yes, Call next view... | |
347 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch | |
348 call TFT_update_avr_stopwatch ; Update average depth and stopwatch | |
349 bra customview_toggle_exit | |
350 | |
351 customview_init_view3: | |
352 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
353 bra customview_toggle ; Yes, Call next view... | |
354 btfsc FLAG_gauge_mode ; In Gauge mode? | |
355 bra customview_toggle ; Yes, Call next view... | |
356 call TFT_decoplan ; Show decoplan | |
357 bra customview_toggle_exit | |
358 | |
359 customview_init_view4: | |
360 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
361 bra customview_toggle ; Yes, Call next view... | |
362 btfsc FLAG_gauge_mode ; In Gauge mode? | |
363 bra customview_toggle ; Yes, Call next view... | |
364 call TFT_ead_end_tissues_clock_mask ; Setup Mask | |
365 call TFT_ead_end_tissues_clock ; Show EAD/END, Tissues and clock | |
366 bra customview_toggle_exit | |
367 | |
368 customview_init_view5: | |
369 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
370 bra customview_toggle ; Yes, Call next view... | |
371 btfsc FLAG_gauge_mode ; In Gauge mode? | |
372 bra customview_toggle ; Yes, Call next view... | |
373 call TFT_gf_mask ; Setup Mask | |
374 call TFT_gf_info ; Show GF informations | |
375 bra customview_toggle_exit | |
376 | |
377 customview_init_view6: ; Compass (View 6) | |
378 call I2C_init_accelerometer ; Start accelerometer | |
379 call I2C_init_compass ; Start compass | |
380 call TFT_dive_compass_mask ; Show compass | |
381 bra customview_toggle_exit | |
382 | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
383 customview_init_view7: ; Dynamic gaslist (View 7) |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
384 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
385 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
386 btfsc FLAG_ccr_mode ; In CC mode? |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
387 bra customview_toggle ; Yes, Call next view... |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
388 call TFT_dyn_gaslist ; Show the dyn gaslist |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
389 bra customview_toggle_exit |
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
390 |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
391 customview_init_view8: ; Sensor millivolts |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
392 btfsc FLAG_apnoe_mode ; In Apnoe mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
393 bra customview_toggle ; yes, Call next view... |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
394 btfss FLAG_ccr_mode ; In CC mode? |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
395 bra customview_toggle ; no, Call next view... |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
396 call TFT_hud_mask ; Setup HUD mask |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
397 call TFT_hud_voltages ; Show HUD details |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
398 bra customview_toggle_exit |
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
399 |
0 | 400 customview_toggle_exit: |
401 call TFT_standard_color | |
402 bcf toggle_customview ; Clear flag | |
403 return | |
404 | |
405 global customview_show_change_depth | |
406 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2 | |
407 PUTC " " | |
408 TSTOSS opt_units ; 0=m, 1=ft | |
409 bra customview_show_mix_metric | |
410 movf lo,W | |
411 mullw .100 ; convert meters to mbar | |
412 movff PRODL,lo | |
413 movff PRODH,hi | |
414 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
415 bsf leftbind | |
416 output_16 ; Change depth in lo:hi | |
417 bcf leftbind | |
418 STRCAT_TEXT tFeets | |
419 return | |
420 customview_show_mix_metric: | |
421 output_99 ; Change depth in lo | |
422 STRCAT_TEXT tMeters | |
423 return | |
424 | |
425 | |
426 global customview_show_mix | |
427 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | |
428 tstfsz hi ; He=0? | |
429 bra customview_show_mix5 ; No, Show a TX | |
430 movlw .21 | |
431 cpfseq lo ; Air? | |
432 bra customview_show_mix2 ; No | |
433 STRCAT_TEXT tSelectAir ; Yes, show "Air" | |
434 bra customview_show_mix4b | |
435 customview_show_mix2: | |
436 movlw .100 | |
437 cpfseq lo ; O2? | |
438 bra customview_show_mix3 ; No | |
439 STRCAT_TEXT tSelectO2 ; Yes, show "O2" | |
440 bra customview_show_mix4b | |
441 | |
442 customview_show_mix3: | |
443 movlw .21 | |
444 cpfslt lo ; < Nx21? | |
445 bra customview_show_mix4 ; No | |
446 STRCAT_TEXT tGasErr ; Yes, show "Err" | |
447 output_99 ; O2 ratio is still in "lo" | |
448 bra customview_show_mix4c | |
449 | |
450 customview_show_mix4: | |
451 STRCAT_TEXT tSelectNx ; Show "Nx" | |
452 output_99 ; O2 ratio is still in "lo" | |
453 customview_show_mix4b: | |
454 STRCAT " " | |
455 customview_show_mix4c: | |
456 btfsc divemode ; In divemode | |
457 return ; Yes | |
458 STRCAT " " | |
459 return | |
460 | |
461 customview_show_mix5: | |
462 btfsc divemode | |
463 bra customview_show_mix6 | |
464 STRCAT_TEXT tSelectTx ; Show "Tx" | |
465 customview_show_mix6: | |
466 output_99 ; O2 ratio is still in "lo" | |
467 PUTC "/" | |
468 movff hi,lo | |
469 output_99 ; He ratio | |
470 return | |
471 | |
472 END |