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