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
|
275
|
14 #include "hwos.inc" ; Mandatory header
|
0
|
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
|
428
|
34 goto TFT_update_ppo2_sensors ; Update Sensor data ; and return; bra customview_1sec_view1
|
0
|
35 dcfsnz WREG,F
|
428
|
36 goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return ;bra customview_1sec_view2
|
0
|
37 dcfsnz WREG,F
|
428
|
38 goto TFT_decoplan ; Show decoplan ; and return; bra customview_1sec_view3
|
0
|
39 dcfsnz WREG,F
|
428
|
40 goto TFT_ead_end_tissues_clock ; Update EAD/END, Tissues and clock ; and return; bra customview_1sec_view4
|
0
|
41 dcfsnz WREG,F
|
428
|
42 goto TFT_gf_info ; Update GF informations ; and return bra customview_1sec_view5
|
53
|
43 dcfsnz WREG,F
|
428
|
44 return ; Compass updated seperately (Faster) in divemode; bra customview_1sec_view6
|
53
|
45 dcfsnz WREG,F
|
428
|
46 goto TFT_dyn_gaslist ; Update the gaslist ; and return bra customview_1sec_view7
|
102
|
47 dcfsnz WREG,F
|
428
|
48 goto TFT_hud_voltages ; Show HUD details ; and return bra customview_1sec_view8
|
123
|
49 dcfsnz WREG,F
|
376
|
50 bra customview_1sec_view9 ; Make sure to change value in "check_ppo2_display:" when moving around custom views
|
413
|
51 dcfsnz WREG,F
|
428
|
52 goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return bra customview_1sec_view10
|
0
|
53 ; Menupos3=0, do nothing
|
|
54 return
|
|
55
|
428
|
56 ;customview_1sec_view3:
|
|
57 ; goto TFT_decoplan ; Show decoplan ; and return
|
|
58 ;customview_1sec_view2:
|
|
59 ; goto TFT_update_avr_stopwatch ; Update average depth and stopwatch; and return
|
|
60 ;customview_1sec_view1:
|
|
61 ; goto TFT_update_ppo2_sensors ; Update Sensor data ; and return
|
|
62 ;customview_1sec_view4:
|
|
63 ; goto TFT_ead_end_tissues_clock ; Update EAD/END, Tissues and clock ; and return
|
|
64 ;customview_1sec_view5:
|
|
65 ; goto TFT_gf_info ; Update GF informations ; and return
|
|
66 ;customview_1sec_view6:
|
|
67 ; return ; Compass updated seperately (Faster) in divemode
|
|
68 ;
|
|
69 ;customview_1sec_view7: ; Dynamic gaslist
|
|
70 ; goto TFT_dyn_gaslist ; Update the gaslist ; and return
|
|
71 ;customview_1sec_view8: ; Sensor voltages
|
|
72 ; goto TFT_hud_voltages ; Show HUD details ; and return
|
123
|
73 customview_1sec_view9: ; Ceiling
|
|
74 call TFT_ceiling ; Show Ceiling
|
333
|
75
|
|
76 ; ppO2 value
|
|
77 call TFT_display_ppo2_val
|
|
78
|
|
79 ; current GF value
|
|
80 extern char_I_deco_model
|
|
81 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF
|
|
82 return ; No GF info for non-GF modes
|
428
|
83 goto TFT_gf_info ; Update GF informations ; and return
|
123
|
84
|
428
|
85 ;customview_1sec_view10: ; Sensor check
|
|
86 ; goto TFT_sensor_check ; Show ppO2 of O2 and Diluent ; and return
|
413
|
87
|
0
|
88
|
|
89 ;=============================================================================
|
|
90 ; Do every-minute tasks for the custom view area
|
|
91
|
|
92 global customview_minute
|
|
93 customview_minute:
|
|
94 return
|
|
95 ; movff menupos3,WREG ; copy
|
|
96 ; dcfsnz WREG,F
|
|
97 ; bra customview_1min_view1
|
|
98 ; dcfsnz WREG,F
|
|
99 ; bra customview_1min_view2
|
|
100 ; dcfsnz WREG,F
|
|
101 ; bra customview_1min_view3
|
|
102 ; dcfsnz WREG,F
|
|
103 ; bra customview_1min_view4
|
|
104 ; dcfsnz WREG,F
|
|
105 ; bra customview_1min_view5
|
|
106 ; dcfsnz WREG,F
|
|
107 ; bra customview_1min_view6
|
|
108 ; dcfsnz WREG,F
|
|
109 ; bra customview_1min_view7
|
|
110 ; dcfsnz WREG,F
|
|
111 ; bra customview_1min_view8
|
|
112 ; dcfsnz WREG,F
|
|
113 ; bra customview_1min_view9
|
|
114 ; dcfsnz WREG,F
|
|
115 ; bra customview_1min_view10
|
|
116 ; dcfsnz WREG,F
|
|
117 ; bra customview_1min_view11
|
|
118 ; ; Menupos3=0, do nothing
|
|
119 ; return
|
|
120 ;
|
|
121 ;customview_1min_view1:
|
|
122 ;customview_1min_view2:
|
|
123 ;customview_1min_view3:
|
|
124 ;customview_1min_view4:
|
|
125 ;customview_1min_view5:
|
|
126 ;customview_1min_view6:
|
|
127 ;customview_1min_view7:
|
|
128 ;customview_1min_view8:
|
|
129 ;customview_1min_view9:
|
|
130 ;customview_1min_view10:
|
|
131 ;customview_1min_view11:
|
|
132 ; return
|
|
133
|
|
134 global surf_customview_toggle
|
|
135 surf_customview_toggle:
|
|
136 bcf switch_right
|
|
137 incf menupos3,F ; Number of customview to show
|
41
|
138 movlw d'7' ; Max number of customsviews in surface mode
|
0
|
139 cpfsgt menupos3 ; Max reached?
|
|
140 bra surf_customview_mask ; No, show
|
|
141 movlw .1
|
|
142 movwf menupos3 ; Reset to one (Always one custom view visible)
|
|
143
|
|
144 global surf_customview_mask
|
|
145 surf_customview_mask:
|
48
|
146 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right
|
188
|
147 ; Prepare title
|
|
148 WIN_TINY surf_customview_title_column,surf_customview_title_row
|
|
149 WIN_COLOR color_greenish
|
0
|
150 movff menupos3,WREG ; Menupos3 holds number of customview function
|
|
151 dcfsnz WREG,F
|
|
152 bra surf_customview_init_view1 ; OC Gas list
|
|
153 dcfsnz WREG,F
|
|
154 bra surf_customview_init_view2 ; CC Dil list
|
|
155 dcfsnz WREG,F
|
|
156 bra surf_customview_init_view3 ; CC SP list
|
|
157 dcfsnz WREG,F
|
|
158 bra surf_customview_init_view4 ; Custom Text
|
|
159 dcfsnz WREG,F
|
|
160 bra surf_customview_init_view5 ; Tissue Diagram
|
41
|
161 dcfsnz WREG,F
|
0
|
162 bra surf_customview_init_view6 ; Compass
|
41
|
163 dcfsnz WREG,F
|
|
164 bra surf_customview_init_view7 ; Deco settings
|
0
|
165
|
|
166 call I2C_sleep_accelerometer ; Stop accelerometer
|
|
167 call I2C_sleep_compass ; Stop compass
|
|
168
|
|
169 movlw .1
|
|
170 movwf menupos3 ; Reset to one (Always one custom view visible)
|
|
171
|
|
172 surf_customview_init_view1: ; View1: OC Gas list
|
|
173 btfsc FLAG_gauge_mode
|
|
174 bra surf_customview_toggle
|
|
175 btfsc FLAG_apnoe_mode
|
|
176 bra surf_customview_toggle
|
188
|
177 btfsc FLAG_ccr_mode
|
|
178 bra surf_customview_init_view1_bail ; Bailoutversion
|
|
179 STRCPY_TEXT_PRINT tGaslist ; Title of customview
|
|
180 call TFT_standard_color
|
|
181 call TFT_gaslist_surfmode ; Show gas list
|
|
182 bra customview_toggle_exit ; Done.
|
|
183
|
|
184 surf_customview_init_view1_bail:
|
|
185 STRCPY_TEXT_PRINT tDiveBailout ; Title of customview
|
|
186 call TFT_standard_color
|
0
|
187 call TFT_gaslist_surfmode ; Show gas list
|
|
188 bra customview_toggle_exit ; Done.
|
|
189
|
|
190 surf_customview_init_view2: ; View2: CC Dil list
|
|
191 btfss FLAG_ccr_mode
|
|
192 bra surf_customview_toggle
|
|
193 btfsc FLAG_gauge_mode
|
|
194 bra surf_customview_toggle
|
|
195 btfsc FLAG_apnoe_mode
|
|
196 bra surf_customview_toggle
|
188
|
197 STRCPY_TEXT_PRINT tGaslistCC ; Title of customview
|
|
198 call TFT_standard_color
|
0
|
199 call TFT_dillist_surfmode ; Show diluent list
|
|
200 bra customview_toggle_exit ; Done.
|
|
201
|
|
202 surf_customview_init_view3: ; View3: CC SP list
|
|
203 btfss FLAG_ccr_mode
|
|
204 bra surf_customview_toggle
|
|
205 btfsc FLAG_gauge_mode
|
|
206 bra surf_customview_toggle
|
|
207 btfsc FLAG_apnoe_mode
|
|
208 bra surf_customview_toggle
|
188
|
209 STRCPY_TEXT_PRINT tFixedSetpoints ; Title of customview
|
|
210 call TFT_standard_color
|
0
|
211 call TFT_splist_surfmode ; Show Setpoint list
|
|
212 bra customview_toggle_exit ; Done.
|
|
213
|
|
214 surf_customview_init_view4: ; View4: Custom text
|
188
|
215 call TFT_standard_color
|
0
|
216 call TFT_custom_text ; Show the custom text
|
|
217 bra customview_toggle_exit ; Done.
|
|
218
|
|
219 surf_customview_init_view5: ; View5: Tissue Diagram
|
|
220 btfsc FLAG_gauge_mode
|
|
221 bra surf_customview_toggle
|
|
222 btfsc FLAG_apnoe_mode
|
|
223 bra surf_customview_toggle
|
188
|
224 call TFT_standard_color
|
0
|
225 call TFT_surface_tissues ; Show Tissue diagram
|
|
226 bra customview_toggle_exit ; Done.
|
|
227
|
|
228 surf_customview_init_view6: ; View6: Compass
|
|
229 call I2C_init_accelerometer ; Start accelerometer
|
|
230 call I2C_init_compass ; Start compass
|
256
|
231 extern TFT_surface_compass_mask
|
0
|
232 call TFT_surface_compass_mask ; Show compass
|
|
233 bra customview_toggle_exit ; Done.
|
41
|
234 surf_customview_init_view7:
|
|
235 btfsc FLAG_gauge_mode
|
|
236 bra surf_customview_toggle
|
|
237 btfsc FLAG_apnoe_mode
|
|
238 bra surf_customview_toggle
|
|
239 extern deco_setup_dive
|
|
240 call deco_setup_dive
|
|
241 call TFT_surface_decosettings ; Show all deco settings
|
|
242 bra customview_toggle_exit ; Done.
|
0
|
243
|
|
244 global menuview_toggle
|
|
245 menuview_toggle: ; Show Menu or the simulator tasks
|
|
246 movlw divemode_menuview_timeout
|
|
247 movwf timeout_counter3
|
|
248 bsf menuview
|
|
249 bcf switch_left
|
|
250 incf menupos2,F ; Number of options to show
|
254
|
251 movlw d'9' ; Max number of options in divemode
|
0
|
252 cpfsgt menupos2 ; Max reached?
|
|
253 bra menuview_mask ; No, show
|
|
254 global menuview_toggle_reset
|
|
255 menuview_toggle_reset: ; Timeout occured
|
|
256 clrf menupos2
|
|
257 bcf menuview
|
|
258 menuview_mask:
|
300
|
259 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column, dm_simtext_column+.49 ; top, bottom, left, right
|
0
|
260 btfss FLAG_gauge_mode
|
|
261 bra menuview_mask2
|
315
|
262 ; Clear some more in gauge mode -- "Reset Avg." text is longer than normal simtext
|
300
|
263 WIN_BOX_BLACK dm_simtext_row, dm_simtext_row+.23, dm_simtext_column+.50, dm_simtext_column+.70 ; top, bottom, left, right
|
327
|
264 menuview_mask2:
|
315
|
265 call TFT_draw_gassep_line
|
0
|
266 movlw color_yellow
|
|
267 call TFT_set_color
|
189
|
268 bsf win_invert ; Set invert flag
|
300
|
269 WIN_SMALL dm_simtext_column,dm_simtext_row
|
0
|
270 movff menupos2,WREG ; Menupos2 holds number of menu option to show
|
|
271 dcfsnz WREG,F
|
137
|
272 bra menuview_view_gaschange ; If a better gas is indicated
|
|
273 dcfsnz WREG,F
|
254
|
274 bra menuview_view1 ; "Menu?" (Not in Gauge and Anpnoe)
|
|
275 dcfsnz WREG,F
|
|
276 bra menuview_view2 ; "Quit Simulation?" (Sim only)
|
0
|
277 dcfsnz WREG,F
|
254
|
278 bra menuview_view3 ; "Descent 1m" (Sim only)
|
0
|
279 dcfsnz WREG,F
|
254
|
280 bra menuview_view4 ; "Ascend 1m" (Sim only)
|
0
|
281 dcfsnz WREG,F
|
254
|
282 bra menuview_view5 ; "Quit Apnea mode?" (Apnea only)
|
0
|
283 dcfsnz WREG,F
|
254
|
284 bra menuview_view6 ; "Reset Avr." (Gauge only)
|
0
|
285 dcfsnz WREG,F
|
254
|
286 bra menuview_view7 ; "Sim:+5mins" (Sim only)
|
216
|
287 dcfsnz WREG,F
|
254
|
288 bra menuview_view8 ; "Heading" (When compass is shown)
|
0
|
289 menuview_exit:
|
|
290 call TFT_standard_color
|
189
|
291 bcf win_invert ; Reset invert flag
|
0
|
292 return ; Menupos2 = 0, Show nothing
|
137
|
293
|
|
294
|
|
295 menuview_view_gaschange:
|
|
296 extern gaslist_strcat_gas_mod
|
|
297 btfss better_gas_available ; =1: A better gas is available
|
|
298 bra menuview_toggle ; No, call next option
|
138
|
299 btfsc divemode_gaschange ; Skip if the last gas change is not done yet.
|
|
300 bra menuview_toggle
|
137
|
301 bsf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
|
|
302 movff better_gas_number,PRODL ; number (1-5) of the "better gas" in divemode, =0: no better gas available
|
|
303 decf PRODL,F
|
|
304 call gaslist_strcat_gas_mod ; Append gas description of gas #PRODL (0-4) to current string
|
|
305 movlw .5
|
|
306 movwf FSR2L ; Point to char 6 (5 chars gas description only)
|
|
307 STRCAT_PRINT "?"
|
|
308 bra menuview_exit ; Done.
|
0
|
309 menuview_view1:
|
|
310 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
311 bra menuview_toggle ; Call next option
|
|
312 btfsc FLAG_gauge_mode ; In Gauge mode?
|
|
313 bra menuview_toggle ; Call next option
|
|
314 STRCPY_TEXT_PRINT tDivePreMenu ; "Menu?"
|
|
315 bra menuview_exit ; Done.
|
|
316 menuview_view2:
|
|
317 btfss simulatormode_active ; View only for simulator mode
|
|
318 bra menuview_toggle ; Call next option
|
254
|
319 STRCPY_TEXT_PRINT tQuitSim ; "Quit Simulation?"
|
0
|
320 bra menuview_exit ; Done.
|
|
321 menuview_view3:
|
|
322 btfss simulatormode_active ; View only for simulator mode
|
|
323 bra menuview_toggle ; Call next option
|
428
|
324 STRCPY_PRINT "Sim:-1m"
|
0
|
325 bra menuview_exit ; Done.
|
|
326 menuview_view4:
|
|
327 btfss simulatormode_active ; View only for simulator mode
|
|
328 bra menuview_toggle ; Call next option
|
428
|
329 STRCPY_PRINT "Sim:+1m"
|
0
|
330 bra menuview_exit ; Done.
|
|
331 menuview_view5:
|
|
332 btfss FLAG_apnoe_mode ; In Apnoe mode?
|
|
333 bra menuview_toggle ; No, call next option
|
184
|
334 btfss FLAG_active_descent ; Are we descending?
|
0
|
335 bra menuview_toggle ; Yes
|
|
336 ; We are at the surface:
|
148
|
337 STRCPY_TEXT_PRINT tQuitSim ; "Quit Apnea mode?"
|
0
|
338 bra menuview_exit ; Done.
|
|
339 menuview_view6:
|
|
340 btfss FLAG_gauge_mode ; In Gauge mode?
|
|
341 bra menuview_toggle ; No, call next option
|
437
|
342 STRCPY_TEXT_PRINT tDivemenu_ResetAvg ; "Reset Avg."
|
0
|
343 bra menuview_exit ; Done.
|
216
|
344 menuview_view7:
|
|
345 btfss simulatormode_active ; View only for simulator mode
|
|
346 bra menuview_toggle ; Call next option
|
|
347 btfsc FLAG_gauge_mode ; In Gauge mode?
|
|
348 bra menuview_toggle ; Yes, call next option
|
|
349 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
350 bra menuview_toggle ; Yes, call next option
|
428
|
351 STRCPY_PRINT "Sim:+5'"
|
216
|
352 bra menuview_exit ; Done.
|
254
|
353 menuview_view8:
|
|
354 movlw .6
|
|
355 cpfseq menupos3 ; in compass view?
|
|
356 bra menuview_toggle ; No, call next option
|
|
357 STRCPY_TEXT_PRINT tSetHeading ; "Heading"
|
|
358 bra menuview_exit ; Done.
|
0
|
359
|
|
360
|
|
361 ;=============================================================================
|
|
362 ; Show next customview (and delete this flag)
|
|
363 global customview_toggle
|
|
364 customview_toggle:
|
|
365 bcf switch_right
|
|
366 incf menupos3,F ; Number of customview to show
|
413
|
367 movlw d'10' ; Max number of customsviews in divemode
|
0
|
368 cpfsgt menupos3 ; Max reached?
|
|
369 bra customview_mask ; No, show
|
|
370 customview_toggle_reset: ; Timeout occured
|
|
371 clrf menupos3 ; Reset to zero (Zero=no custom view)
|
39
|
372 global customview_mask
|
0
|
373 customview_mask:
|
353
|
374 ; Clear custom view area in divemode
|
|
375 WIN_BOX_BLACK dm_customview_row, dm_customview_bot, dm_customview_column, dm_customview_rgt ; top, bottom, left, right
|
300
|
376 WIN_SMALL dm_customview_column,dm_customview_row
|
0
|
377 call TFT_standard_color
|
|
378 movff menupos3,WREG ; Menupos3 holds number of customview function
|
|
379 dcfsnz WREG,F
|
|
380 bra customview_init_view1
|
|
381 dcfsnz WREG,F
|
|
382 bra customview_init_view2
|
|
383 dcfsnz WREG,F
|
|
384 bra customview_init_view3
|
|
385 dcfsnz WREG,F
|
|
386 bra customview_init_view4
|
|
387 dcfsnz WREG,F
|
|
388 bra customview_init_view5 ; GF informations
|
|
389 dcfsnz WREG,F
|
|
390 bra customview_init_view6 ; Compass
|
53
|
391 dcfsnz WREG,F
|
|
392 bra customview_init_view7 ; Dynamic gaslist
|
105
|
393 dcfsnz WREG,F
|
|
394 bra customview_init_view8 ; HUD voltages
|
123
|
395 dcfsnz WREG,F
|
|
396 bra customview_init_view9 ; Ceiling
|
413
|
397 dcfsnz WREG,F
|
|
398 bra customview_init_view10 ; Sensor check
|
0
|
399 customview_init_nocustomview:
|
|
400 call I2C_sleep_accelerometer ; Stop accelerometer
|
|
401 call I2C_sleep_compass ; Stop compass
|
|
402 bra customview_toggle_exit
|
|
403
|
|
404 customview_init_view1:
|
|
405 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
406 bra customview_toggle ; yes, Call next view...
|
|
407 btfss FLAG_ccr_mode ; In CC mode?
|
|
408 bra customview_toggle ; no, Call next view...
|
249
|
409 movf hardware_flag,W
|
|
410 sublw 0x11 ; 2 with BLE
|
|
411 btfsc STATUS,Z
|
|
412 bra customview_toggle ; no, Call next view...
|
0
|
413
|
|
414 bsf dive_hud1_displayed ; Set display flag
|
|
415 bsf dive_hud2_displayed ; Set display flag
|
|
416 bsf dive_hud3_displayed ; Set display flag
|
|
417 call TFT_hud_mask ; Setup HUD mask
|
192
|
418 call TFT_update_ppo2_sensors ; Update Sensor data
|
0
|
419 bra customview_toggle_exit
|
|
420
|
|
421 customview_init_view2:
|
|
422 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
423 bra customview_toggle ; Yes, Call next view...
|
|
424 call TFT_mask_avr_stopwatch ; Show mask for average depth and stopwatch
|
|
425 call TFT_update_avr_stopwatch ; Update average depth and stopwatch
|
|
426 bra customview_toggle_exit
|
|
427
|
|
428 customview_init_view3:
|
|
429 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
430 bra customview_toggle ; Yes, Call next view...
|
|
431 btfsc FLAG_gauge_mode ; In Gauge mode?
|
|
432 bra customview_toggle ; Yes, Call next view...
|
|
433 call TFT_decoplan ; Show decoplan
|
|
434 bra customview_toggle_exit
|
|
435
|
|
436 customview_init_view4:
|
|
437 call TFT_ead_end_tissues_clock_mask ; Setup Mask
|
|
438 call TFT_ead_end_tissues_clock ; Show EAD/END, Tissues and clock
|
|
439 bra customview_toggle_exit
|
|
440
|
|
441 customview_init_view5:
|
|
442 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
443 bra customview_toggle ; Yes, Call next view...
|
|
444 btfsc FLAG_gauge_mode ; In Gauge mode?
|
|
445 bra customview_toggle ; Yes, Call next view...
|
119
|
446
|
|
447 extern char_I_deco_model
|
|
448 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF
|
|
449 bra customview_toggle ; No GF info for non-GF modes
|
|
450
|
0
|
451 call TFT_gf_mask ; Setup Mask
|
|
452 call TFT_gf_info ; Show GF informations
|
|
453 bra customview_toggle_exit
|
|
454
|
|
455 customview_init_view6: ; Compass (View 6)
|
|
456 call I2C_init_accelerometer ; Start accelerometer
|
|
457 call I2C_init_compass ; Start compass
|
256
|
458 extern TFT_dive_compass_mask
|
0
|
459 call TFT_dive_compass_mask ; Show compass
|
|
460 bra customview_toggle_exit
|
|
461
|
53
|
462 customview_init_view7: ; Dynamic gaslist (View 7)
|
|
463 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
464 bra customview_toggle ; Yes, Call next view...
|
|
465 btfsc FLAG_ccr_mode ; In CC mode?
|
|
466 bra customview_toggle ; Yes, Call next view...
|
|
467 call TFT_dyn_gaslist ; Show the dyn gaslist
|
|
468 bra customview_toggle_exit
|
|
469
|
102
|
470 customview_init_view8: ; Sensor millivolts
|
136
|
471 btfsc FLAG_gauge_mode ; In Gauge mode?
|
|
472 bra customview_toggle ; Yes, Call next view...
|
102
|
473 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
474 bra customview_toggle ; yes, Call next view...
|
|
475 btfss FLAG_ccr_mode ; In CC mode?
|
|
476 bra customview_toggle ; no, Call next view...
|
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
diff
changeset
|
477 movff opt_ccr_mode,WREG ; =0: Fixed SP, =1: Sensor, =2: Auto SP
|
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
diff
changeset
|
478 sublw .1 ; opt_ccr_mode = 1 (Sensor)?
|
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
diff
changeset
|
479 bnz customview_toggle ; no, Call next view...
|
102
|
480 call TFT_hud_mask ; Setup HUD mask
|
|
481 call TFT_hud_voltages ; Show HUD details
|
|
482 bra customview_toggle_exit
|
|
483
|
123
|
484 customview_init_view9: ; Ceiling
|
|
485 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
486 bra customview_toggle ; yes, Call next view...
|
|
487 btfsc FLAG_gauge_mode ; In Gauge mode?
|
|
488 bra customview_toggle ; Yes, Call next view...
|
|
489 call TFT_ceiling_mask ; Setup mask
|
|
490 call TFT_ceiling ; Show Ceiling
|
333
|
491
|
|
492 ; ppO2 value
|
|
493 call TFT_mask_ppo2
|
|
494 call TFT_display_ppo2_val
|
|
495
|
|
496 ; current GF value
|
|
497 extern char_I_deco_model
|
|
498 TSTOSS char_I_deco_model ; 0 = ZH-L16, 1 = ZH-L16-GF
|
|
499 bra customview_toggle_exit ; No GF info for non-GF modes
|
|
500 call TFT_gf_mask_cGF ; Setup Mask - current GF only
|
|
501 call TFT_gf_info ; Show GF informations
|
123
|
502 bra customview_toggle_exit
|
|
503
|
413
|
504 customview_init_view10: ; Sensor check
|
|
505 btfsc FLAG_apnoe_mode ; In Apnoe mode?
|
|
506 bra customview_toggle ; yes, Call next view...
|
|
507 btfsc FLAG_gauge_mode ; In Gauge mode?
|
|
508 bra customview_toggle ; Yes, Call next view...
|
419
|
509 btfss FLAG_ccr_mode ; In CC mode?
|
|
510 bra customview_toggle ; no, Call next view...
|
413
|
511
|
|
512 call TFT_sensor_check_mask ; Show ppO2 of O2 and Diluent mask
|
|
513 call TFT_sensor_check ; Show ppO2 of O2 and Diluent
|
|
514 bra customview_toggle_exit
|
123
|
515
|
0
|
516 customview_toggle_exit:
|
|
517 call TFT_standard_color
|
|
518 bcf toggle_customview ; Clear flag
|
|
519 return
|
|
520
|
|
521 global customview_show_change_depth
|
|
522 customview_show_change_depth: ; Put " lom" or " loft" into Postinc2
|
|
523 PUTC " "
|
|
524 TSTOSS opt_units ; 0=m, 1=ft
|
|
525 bra customview_show_mix_metric
|
|
526 movf lo,W
|
|
527 mullw .100 ; convert meters to mbar
|
|
528 movff PRODL,lo
|
|
529 movff PRODH,hi
|
|
530 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet
|
|
531 bsf leftbind
|
|
532 output_16 ; Change depth in lo:hi
|
|
533 bcf leftbind
|
|
534 STRCAT_TEXT tFeets
|
|
535 return
|
|
536 customview_show_mix_metric:
|
|
537 output_99 ; Change depth in lo
|
|
538 STRCAT_TEXT tMeters
|
|
539 return
|
|
540
|
|
541
|
|
542 global customview_show_mix
|
|
543 customview_show_mix: ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2
|
|
544 tstfsz hi ; He=0?
|
|
545 bra customview_show_mix5 ; No, Show a TX
|
|
546 movlw .21
|
|
547 cpfseq lo ; Air?
|
|
548 bra customview_show_mix2 ; No
|
|
549 STRCAT_TEXT tSelectAir ; Yes, show "Air"
|
|
550 bra customview_show_mix4b
|
|
551 customview_show_mix2:
|
|
552 movlw .100
|
|
553 cpfseq lo ; O2?
|
|
554 bra customview_show_mix3 ; No
|
|
555 STRCAT_TEXT tSelectO2 ; Yes, show "O2"
|
|
556 bra customview_show_mix4b
|
|
557
|
|
558 customview_show_mix3:
|
|
559 movlw .21
|
|
560 cpfslt lo ; < Nx21?
|
|
561 bra customview_show_mix4 ; No
|
|
562 STRCAT_TEXT tGasErr ; Yes, show "Err"
|
|
563 output_99 ; O2 ratio is still in "lo"
|
|
564 bra customview_show_mix4c
|
|
565
|
|
566 customview_show_mix4:
|
|
567 STRCAT_TEXT tSelectNx ; Show "Nx"
|
|
568 output_99 ; O2 ratio is still in "lo"
|
|
569 customview_show_mix4b:
|
|
570 STRCAT " "
|
|
571 customview_show_mix4c:
|
|
572 btfsc divemode ; In divemode
|
|
573 return ; Yes
|
|
574 STRCAT " "
|
|
575 return
|
|
576
|
|
577 customview_show_mix5:
|
|
578 btfsc divemode
|
|
579 bra customview_show_mix6
|
|
580 STRCAT_TEXT tSelectTx ; Show "Tx"
|
|
581 customview_show_mix6:
|
|
582 output_99 ; O2 ratio is still in "lo"
|
|
583 PUTC "/"
|
|
584 movff hi,lo
|
|
585 output_99 ; He ratio
|
|
586 return
|
|
587
|
|
588 END |