Mercurial > public > hwos_code
annotate src/customview.asm @ 629:237931377539
3.07 stable release
author | heinrichsweikamp |
---|---|
date | Fri, 29 Nov 2019 18:48:11 +0100 |
parents | cd58f7fc86db |
children | 185ba2f91f59 |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
628 | 3 ; File customview.asm combined next generation V3.03.5 |
0 | 4 ; |
604 | 5 ; Custom Views in Surface and Dive Mode |
0 | 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 | |
604 | 14 #include "hwos.inc" ; mandatory header |
582 | 15 #include "tft_outputs.inc" |
16 #include "strings.inc" | |
17 #include "tft.inc" | |
18 #include "wait.inc" | |
19 #include "surfmode.inc" | |
20 #include "convert.inc" | |
21 #include "divemode.inc" | |
22 #include "i2c.inc" | |
23 #include "start.inc" | |
0 | 24 |
582 | 25 |
604 | 26 extern gaslist_strcat_gas_cd |
582 | 27 extern char_I_deco_model |
623 | 28 |
29 IFDEF _compass | |
582 | 30 extern TFT_surface_compass_mask |
31 extern TFT_dive_compass_mask | |
623 | 32 ENDIF |
33 | |
582 | 34 |
604 | 35 custview CODE |
0 | 36 |
623 | 37 ;----------------------------------------------------------------------------- |
38 | |
39 | |
0 | 40 ;============================================================================= |
604 | 41 ; Jump table for the every-second tasks for the custom view area (dive mode) |
42 ; | |
43 ; Attention: the ordering must be in line with the init jump table and the | |
44 ; index numbers defined in hwos.inc! | |
0 | 45 |
623 | 46 global dive_customview_second |
47 dive_customview_second: | |
48 movf active_customview,W ; get current view | |
604 | 49 dcfsnz WREG,F ; 1: |
50 goto TFT_avr_stopwatch ; average depth and stopwatch | |
51 dcfsnz WREG,F ; 2: | |
623 | 52 return ; compass - will be updated separately (faster) in dive mode |
604 | 53 dcfsnz WREG,F ; 3: |
623 | 54 IFDEF _external_sensor |
604 | 55 goto TFT_ppo2_sensors ; ppO2 sensors |
623 | 56 ELSE |
57 return ; not available without external sensors | |
58 ENDIF | |
604 | 59 dcfsnz WREG,F ; 4: |
623 | 60 IFDEF _ccr_pscr |
604 | 61 goto TFT_sensor_check ; sensor check |
623 | 62 ELSE |
63 return ; not available without CCR / pSCR mode | |
64 ENDIF | |
604 | 65 dcfsnz WREG,F ; 5; |
623 | 66 IFDEF _ccr_pscr |
604 | 67 goto TFT_pscr_info ; pSCR data |
623 | 68 ELSE |
69 return ; not available without CCR / pSCR mode | |
70 ENDIF | |
604 | 71 dcfsnz WREG,F ; 6: |
72 IFDEF _rx_functions | |
73 goto TFT_pressures_SAC ; tank pressure and SAC rate | |
74 ELSE | |
75 return ; not available without RX functions | |
76 ENDIF | |
77 dcfsnz WREG,F ; 7: | |
78 goto TFT_gas_needs_ascent ; gas needs for ascent / cave return | |
79 dcfsnz WREG,F ; 8: | |
80 goto TFT_decoplan ; deco plan | |
81 dcfsnz WREG,F ; 9: | |
82 goto TFT_ceiling_GF_tissue ; ceiling, current GF and tissues | |
83 dcfsnz WREG,F ; 10: | |
84 goto TFT_CNS ; CNS values | |
85 dcfsnz WREG,F ; 11: | |
86 goto TFT_ppo2_ead_end_cns ; ppO2, END/EAD and CNS | |
87 dcfsnz WREG,F ; 12: | |
623 | 88 return ; GF factors - static only |
604 | 89 dcfsnz WREG,F ; 13: |
90 goto TFT_clock_batt_surfpress ; clock, battery and surface pressure | |
623 | 91 return ; active_customview = 0 -> do nothing |
0 | 92 |
623 | 93 ;----------------------------------------------------------------------------- |
0 | 94 |
582 | 95 global surf_customview_toggle |
0 | 96 surf_customview_toggle: |
623 | 97 bcf switch_right ; clear button event |
98 incf active_customview,F ; number of custom view to show | |
604 | 99 |
623 | 100 IFDEF _compass |
604 | 101 movlw .6 ; index of surface custom view compass |
623 | 102 cpfseq active_customview ; will compass be shown in custom view? |
604 | 103 call I2C_sleep_compass ; NO - stop compass |
623 | 104 ENDIF |
604 | 105 |
106 movlw d'10' ; max number of custom views in surface mode | |
623 | 107 cpfsgt active_customview ; max reached? |
108 bra surf_customview_mask ; NO - show | |
109 movlw .1 ; YES - wrap around to 1st view | |
110 movwf active_customview ; - ... | |
111 ;bra surf_customview_mask ; - show | |
112 | |
0 | 113 |
582 | 114 global surf_customview_mask |
0 | 115 surf_customview_mask: |
582 | 116 WIN_BOX_BLACK .50,surf_warning1_row-1, .0, surf_decotype_column-.1 ; top, bottom, left, right |
623 | 117 WIN_TINY surf_customview_title_column,surf_customview_title_row ; set title position |
118 WIN_COLOR color_greenish ; set title color | |
119 | |
120 movf active_customview,W ; get custom view to show | |
121 movff WREG,customview_surfmode ; save number for later recall | |
604 | 122 dcfsnz WREG,F ; 1: |
123 bra surf_customview_init_view1 ; OC gas list | |
124 dcfsnz WREG,F ; 2: | |
125 bra surf_customview_init_view2 ; CC dil list | |
126 dcfsnz WREG,F ; 3: | |
582 | 127 bra surf_customview_init_view3 ; CC SP list |
604 | 128 dcfsnz WREG,F ; 4: |
129 bra surf_customview_init_view4 ; custom text | |
130 dcfsnz WREG,F ; 5: | |
131 bra surf_customview_init_view5 ; tissue diagram | |
132 dcfsnz WREG,F ; 6: | |
133 bra surf_customview_init_view6 ; compass | |
134 dcfsnz WREG,F ; 7: | |
135 bra surf_customview_init_view7 ; deco settings | |
136 dcfsnz WREG,F ; 8: | |
137 bra surf_customview_init_view8 ; last dive info | |
138 dcfsnz WREG,F ; 9: | |
139 bra surf_customview_init_view9 ; sensor mV readings | |
140 dcfsnz WREG,F ; 10: | |
141 bra surf_customview_init_view10 ; tank data | |
623 | 142 bra surf_customview_init_view4 ; default view after restart and loading of new firmware |
143 | |
0 | 144 |
604 | 145 surf_customview_init_view1: ; view 1: OC Gas list |
623 | 146 btfsc FLAG_gauge_mode ; in gauge mode? |
147 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | |
148 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
149 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | |
150 IFDEF _ccr_pscr | |
151 btfss FLAG_oc_mode ; in OC mode? | |
152 bra surf_customview_init_view1a ; NO - (1) | |
153 ENDIF | |
154 STRCPY_TEXT_PRINT tGaslist ; YES - title of custom view / OC mode | |
155 IFDEF _ccr_pscr | |
156 bra surf_customview_init_view1b ; - continue with common part | |
604 | 157 surf_customview_init_view1a: |
623 | 158 STRCPY_TEXT_PRINT tDiveBailout ; (1) - title of custom view / CCR & pSCR mode |
159 ENDIF | |
160 surf_customview_init_view1b: | |
161 call TFT_standard_color ; set color | |
604 | 162 call TFT_gaslist_surfmode ; show gas list |
163 bra customview_toggle_exit ; done | |
188
ebc28381f17d
NEW: Show Bailout Gas List in Surface mode (CCR Modes)
heinrichsweikamp
parents:
184
diff
changeset
|
164 |
623 | 165 |
604 | 166 surf_customview_init_view2: ; view 2: CCR / pSCR diluent list |
623 | 167 IFDEF _ccr_pscr |
168 btfsc FLAG_ccr_mode ; in CCR mode? | |
169 bra surf_customview_init_view2a ; YES - (1) | |
170 btfsc FLAG_pscr_mode ; in pSCR mode? | |
171 bra surf_customview_init_view2a ; YES - (1) | |
172 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | |
604 | 173 surf_customview_init_view2a: |
623 | 174 STRCPY_TEXT_PRINT tGaslistCC ; (1) - title of custom view |
175 call TFT_standard_color ; - set color | |
176 call TFT_dillist_surfmode ; - show diluent list | |
177 bra customview_toggle_exit ; - done | |
178 ELSE | |
179 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
180 ENDIF | |
181 | |
582 | 182 |
604 | 183 surf_customview_init_view3: ; view 3: CC SP list |
623 | 184 IFDEF _ccr_pscr |
185 btfss FLAG_ccr_mode ; in CCR mode? | |
186 bra surf_customview_toggle ; NO - not available if not in CCR mode, goto next view | |
187 STRCPY_TEXT_PRINT tFixedSetpoints ; YES - title of custom view | |
188 call TFT_standard_color ; - set color | |
189 call TFT_splist_surfmode ; - show setpoint list | |
190 bra customview_toggle_exit ; - done | |
191 ELSE | |
192 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
193 ENDIF | |
194 | |
0 | 195 |
604 | 196 surf_customview_init_view9: ; view 9: sensor mV at the surface |
623 | 197 IFDEF _external_sensor |
198 btfsc FLAG_ccr_mode ; in CCR mode? | |
199 bra surf_customview_init_view9a ; YES - (1) | |
200 btfsc FLAG_pscr_mode ; in pSCR mode? | |
201 bra surf_customview_init_view9a ; YES - (1) | |
202 bra surf_customview_toggle ; NO - not available if not in CCR or pSCR mode, goto next view | |
604 | 203 surf_customview_init_view9a: |
623 | 204 movff opt_ccr_mode,WREG ; (1) - get SP mode (0: fixed SP, 1: Sensor, 2: auto SP) |
205 sublw .1 ; - opt_ccr_mode = 1 (sensor)? | |
206 bnz surf_customview_toggle ; NO - goto next view | |
207 STRCPY_TEXT_PRINT tSensorMilliVolt ; YES - title of custom view | |
208 call TFT_standard_color ; - set color | |
209 call TFT_sensor_mV ; - write sensor mV readings to screen | |
210 bra customview_toggle_exit ; - done | |
211 ELSE | |
212 bra surf_customview_toggle ; not available without CCR/pSCR mode compiled in, goto next view | |
213 ENDIF | |
214 | |
0 | 215 |
604 | 216 surf_customview_init_view4: ; view 4: custom text |
623 | 217 call TFT_standard_color ; set color |
604 | 218 call TFT_custom_text ; show the custom text |
219 bra customview_toggle_exit ; done | |
0 | 220 |
623 | 221 |
604 | 222 surf_customview_init_view5: ; view 5: tissue diagram |
623 | 223 btfsc FLAG_gauge_mode ; in gauge mode? |
224 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | |
225 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
226 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | |
227 call TFT_standard_color ; set color | |
604 | 228 call TFT_surface_tissues ; show tissue diagram |
229 bra customview_toggle_exit ; done | |
0 | 230 |
623 | 231 |
604 | 232 surf_customview_init_view6: ; view 6: compass |
623 | 233 IFDEF _compass |
604 | 234 call I2C_init_compass ; start compass |
235 call TFT_surface_compass_mask ; show compass mask | |
236 bra customview_toggle_exit ; done | |
237 ELSE | |
623 | 238 bra surf_customview_toggle ; not available without compass compiled in, goto next view |
604 | 239 ENDIF |
240 | |
241 | |
623 | 242 surf_customview_init_view7: ; view 7: deco settings |
243 btfsc FLAG_gauge_mode ; in gauge mode? | |
244 bra surf_customview_toggle ; YES - not available in gauge mode, goto next view | |
245 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
246 bra surf_customview_toggle ; YES - not available in apnoe mode, goto next view | |
247 call TFT_surface_decosettings ; show all deco settings | |
248 bra customview_toggle_exit ; done | |
249 | |
250 | |
251 surf_customview_init_view8: ; view 8: last dive info | |
252 call TFT_standard_color ; set color | |
253 call TFT_surface_lastdive ; show last dive info | |
254 bra customview_toggle_exit ; done | |
582 | 255 |
0 | 256 |
623 | 257 surf_customview_init_view10: ; view 10: transmitter data / debug |
258 IFDEF _rx_functions | |
259 btfss tr_functions_activated ; TR functions activated? | |
260 bra surf_customview_toggle ; NO - show next view in list | |
261 STRCAT_PRINT "ID bar Volt" ; YES - title of custom view (none language-dependent) | |
262 call TFT_surface_tankdata ; - show received data | |
263 bra customview_toggle_exit ; - done | |
264 ELSE | |
265 bra surf_customview_toggle ; not available without RX functions compiled in, goto next view | |
266 ENDIF | |
267 | |
268 ;----------------------------------------------------------------------------- | |
269 | |
582 | 270 global menuview_toggle |
623 | 271 menuview_toggle: ; show main menu or the pre-menu |
272 bcf switch_left ; clear button event | |
273 movlw divemode_timeout_premenu ; get timeout for dive mode pre-menu | |
274 call reset_timeout_time ; reset timeout | |
275 bsf dive_options_menu ; flag that the dive options menu is shown | |
276 incf active_premenu,F ; current number of pre-menu item | |
277 movlw d'10' ; max number of pre-menu items | |
278 cpfsgt active_premenu ; max reached? | |
279 bra menuview_mask ; NO - show item | |
280 ;bra menuview_toggle_reset ; YES - reset selector | |
582 | 281 |
282 global menuview_toggle_reset | |
604 | 283 menuview_toggle_reset: ; timeout occurred, beyond max number of options, or item executed |
623 | 284 clrf active_premenu ; reset pre-menu selector |
285 bcf dive_options_menu ; the dive options menu is not shown anymore | |
0 | 286 menuview_mask: |
623 | 287 WIN_BOX_BLACK dm_premenu_row, dm_premenu_bot, dm_premenu_col, dm_premenu_rgt ; top, bottom, left, right |
288 tstfsz active_premenu ; any pre-menu selected? | |
289 bra menuview_items ; YES - display menu item | |
290 bcf win_invert ; NO - end inverse printing | |
291 btfss FLAG_apnoe_mode ; - in apnoe mode? | |
292 goto TFT_show_temp_divemode ; YES - restore temperature and done | |
293 goto TFT_standard_color ; NO - done | |
294 menuview_items: | |
295 call TFT_attention_color ; set color | |
296 bsf win_invert ; set inverse printing | |
297 WIN_SMALL dm_premenu_col,dm_premenu_row | |
298 movf active_premenu,W ; get active pre-menu item | |
0 | 299 dcfsnz WREG,F |
604 | 300 bra menuview_view_gaschange ; check if a better gas/diluent is advised and prompt for switching if yes |
137 | 301 dcfsnz WREG,F |
623 | 302 bra menuview_view1 ; "Menu?" (skipped in gauge and apnoe modes) |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
303 dcfsnz WREG,F |
623 | 304 bra menuview_view2 ; "Quit?" (in simulation mode only) |
0 | 305 dcfsnz WREG,F |
623 | 306 bra menuview_view3 ; "Sim-1m" (in simulation mode only) |
0 | 307 dcfsnz WREG,F |
623 | 308 bra menuview_view4 ; "Sim+1m" (in simulation mode only) |
0 | 309 dcfsnz WREG,F |
623 | 310 bra menuview_view5 ; "Quit?" (in apnoe mode only) |
0 | 311 dcfsnz WREG,F |
623 | 312 bra menuview_view6 ; "Reset Avr" (in gauge mode only) |
0 | 313 dcfsnz WREG,F |
623 | 314 bra menuview_view7 ; "Sim+5'" (in simulation mode only) |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
315 dcfsnz WREG,F |
623 | 316 bra menuview_view8 ; "Course" (only when compass is shown) |
560 | 317 dcfsnz WREG,F |
623 | 318 bra menuview_view9 ; "Layout" (offer alternative layout, aka blind mode) |
582 | 319 |
0 | 320 menuview_exit: |
582 | 321 call TFT_standard_color |
604 | 322 bcf win_invert ; reset invert flag |
623 | 323 return ; active pre-menu = 0, i.e. show nothing |
137 | 324 |
325 | |
326 menuview_view_gaschange: | |
623 | 327 btfsc request_gaschange ; last gas change request executed yet? |
604 | 328 bra menuview_toggle ; NO - call next option |
623 | 329 IFDEF _ccr_pscr |
604 | 330 btfsc FLAG_oc_mode ; in OC mode? |
331 bra menuview_view_gaschange_OC ; YES | |
623 | 332 btfsc bailout_mode ; in bailout? |
604 | 333 bra menuview_view_gaschange_OC ; YES |
334 menuview_view_gaschange_DIL: | |
335 btfss better_dil_available ; is the better diluent still available? | |
336 bra menuview_toggle ; NO - call next option | |
337 movff best_dil_number,PRODL ; number (1-5) of the "best diluent" | |
623 | 338 bsf is_diluent_menu ; setting up diluents |
604 | 339 bra menuview_view_gaschange_com |
623 | 340 ENDIF |
604 | 341 menuview_view_gaschange_OC: |
342 btfss better_gas_available ; is the better gas still available? | |
343 bra menuview_toggle ; NO - call next option | |
344 movff best_gas_number,PRODL ; number (1-5) of the "best gas" | |
623 | 345 bcf is_diluent_menu ; setting up OC gases |
604 | 346 menuview_view_gaschange_com: |
347 decf PRODL,F ; (1-5) -> (0-4) | |
623 | 348 bsf short_gas_descriptions ; use short version of gaslist_strcat_gas_cd and gaslist_strcat_setpoint |
604 | 349 bsf better_gas_hint ; color-code as best gas/diluent |
350 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string | |
582 | 351 movlw .5 |
604 | 352 movwf FSR2L ; point to 6th character (5 chars are used for the gas/dil description) |
582 | 353 STRCAT_PRINT "?" |
604 | 354 bra menuview_exit ; done |
355 | |
0 | 356 menuview_view1: |
623 | 357 btfsc FLAG_apnoe_mode ; in apnoe mode? |
604 | 358 bra menuview_toggle ; YES - goto next option |
623 | 359 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
360 bra menuview_toggle ; YES - goto next option | |
361 PUTC "\xb7" ; NO - print '->' symbol | |
362 STRCAT_TEXT_PRINT tDivePreMenu ; - print "Menu?" | |
363 bra menuview_exit ; - done | |
604 | 364 |
0 | 365 menuview_view2: |
623 | 366 btfss simulatormode ; in simulator mode? |
367 bra menuview_toggle ; NO - goto next option | |
368 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Simulation?" | |
369 bra menuview_exit ; - done | |
604 | 370 |
0 | 371 menuview_view3: |
623 | 372 btfss simulatormode ; in simulator mode? |
604 | 373 bra menuview_toggle ; NO - goto next option |
374 STRCPY_PRINT "Sim\xb8" ; print down arrow for going down | |
375 bra menuview_exit ; done | |
376 | |
0 | 377 menuview_view4: |
623 | 378 btfss simulatormode ; in simulator mode? |
379 bra menuview_toggle ; NO - goto next option | |
380 STRCPY_PRINT "Sim\xb9" ; YES - print up arrow for going up | |
381 bra menuview_exit ; - done | |
604 | 382 |
0 | 383 menuview_view5: |
623 | 384 btfss FLAG_apnoe_mode ; in apnoe mode? |
385 bra menuview_toggle ; NO - goto next option | |
386 btfss apnoe_at_surface ; YES - at the surface? | |
387 bra menuview_toggle ; NO - goto next option | |
388 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Apnea mode?" | |
389 bra menuview_exit ; - done | |
604 | 390 |
0 | 391 menuview_view6: |
623 | 392 btfss FLAG_gauge_mode ; in gauge mode? |
393 bra menuview_toggle ; NO - goto next option | |
394 STRCPY_TEXT_PRINT tResetAvg ; YES - print "Reset Avg." | |
395 bra menuview_exit ; - done | |
604 | 396 |
216
973a0969e0ac
NEW: On-board simulator can increase divetime in 5min steps
heinrichsweikamp
parents:
192
diff
changeset
|
397 menuview_view7: |
623 | 398 btfss simulatormode ; in simulator mode? |
399 bra menuview_toggle ; NO - goto next option | |
400 btfsc FLAG_gauge_mode ; YES - in gauge mode? | |
401 bra menuview_toggle ; YES - goto next option | |
402 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? | |
403 bra menuview_toggle ; YES - goto next option | |
404 STRCPY_PRINT "Sim+5'" ; NO - print "Sim+5'" | |
405 bra menuview_exit ; - done | |
604 | 406 |
254
5fe7aff622f3
preparations to set a course for the compass display
heinrichsweikamp
parents:
249
diff
changeset
|
407 menuview_view8: |
623 | 408 IFDEF _compass |
604 | 409 movlw index_compass_dm ; index of compass view |
623 | 410 cpfseq active_customview ; in compass view? |
411 bra menuview_toggle ; NO - goto next option | |
412 STRCPY_TEXT_PRINT tSetHeading ; YES - print "Heading" | |
413 bra menuview_exit ; - done | |
414 ELSE | |
415 bra menuview_toggle ; not available without compass compiled in, goto next option | |
416 ENDIF | |
604 | 417 |
560 | 418 menuview_view9: |
623 | 419 btfsc FLAG_apnoe_mode ; in apnoe mode? |
604 | 420 bra menuview_toggle ; YES - goto next option |
628 | 421 STRCPY_TEXT_PRINT tDiveLayout ; NO - print "Layout" |
623 | 422 bra menuview_exit ; - done |
582 | 423 |
623 | 424 ;----------------------------------------------------------------------------- |
604 | 425 |
426 ; Show next dive mode custom view (and delete this flag) | |
623 | 427 global dive_customview_toggle |
428 dive_customview_toggle: | |
429 incf active_customview,F ; increment number of custom view to show | |
582 | 430 |
604 | 431 movlw index_compass_dm ; index of custom view compass |
623 | 432 cpfseq active_customview ; will compass be shown in custom view? |
604 | 433 call I2C_sleep_compass ; NO - stop compass |
560 | 434 |
604 | 435 movlw index_cv_dm_max ; highest index in use in dive mode custom view |
623 | 436 cpfsgt active_customview ; max reached? |
437 bra dive_customview_mask ; NO - show | |
438 clrf active_customview ; YES - reset to zero (zero = no custom view) | |
439 ;bra dive_customview_mask ; - show | |
582 | 440 |
604 | 441 ;---------------------------------------------------------------------------------- |
442 ; Jump table for initialization of the every-second tasks in custom view area (dive mode) | |
443 ; | |
444 ; Attention: the ordering must be in line with the every-second update jump table | |
445 ; and the index numbers defined in hwos.inc! | |
446 ; | |
623 | 447 global dive_customview_mask |
448 dive_customview_mask: | |
449 ; clear custom view area in dive mode | |
604 | 450 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
623 | 451 movf active_customview,W ; get custom view to show |
604 | 452 dcfsnz WREG,F ; 1: |
453 bra init_avr_stopwatch ; average depth and stopwatch | |
454 dcfsnz WREG,F ; 2: | |
455 bra init_TFT_dive_compass ; compass | |
456 dcfsnz WREG,F ; 3: | |
457 bra init_ppo2_sensors ; ppO2 sensors | |
458 dcfsnz WREG,F ; 4: | |
459 bra init_sensor_check ; sensor check | |
460 dcfsnz WREG,F ; 5: | |
461 bra init_pscr_info ; pSCR data | |
462 dcfsnz WREG,F ; 6: | |
463 bra init_pressures_SAC ; tank pressure and SAC rate | |
464 dcfsnz WREG,F ; 7: | |
465 bra init_gas_needs_ascent ; gas needs for ascent / cave return | |
466 dcfsnz WREG,F ; 8: | |
467 bra init_decoplan ; deco plan | |
468 dcfsnz WREG,F ; 9: | |
469 bra init_ceiling_GF_tissue ; ceiling, current GF and tissues | |
470 dcfsnz WREG,F ; 10: | |
471 bra init_CNS ; CNS values | |
472 dcfsnz WREG,F ; 11: | |
473 bra init_ppo2_ead_end_cns ; ppO2, END/EAD and CNS | |
474 dcfsnz WREG,F ; 12: | |
475 bra init_gf_factors ; GF factors | |
476 dcfsnz WREG,F ; 13: | |
477 bra init_clock_batt_surfpress ; clock, battery and surface pressure | |
478 bra customview_toggle_exit ; no view (blank screen in custom view area) | |
582 | 479 |
0 | 480 |
604 | 481 init_ppo2_sensors: |
623 | 482 IFDEF _external_sensor |
483 bsf trigger_temp_changed ; fake a change of the temperature to have the resettable dive time overwritten which was shown with the compass view | |
604 | 484 btfsc FLAG_ccr_mode ; in CC mode? |
623 | 485 bra customview_init_view1a ; YES - (1) |
486 btfsc FLAG_pscr_mode ; in pSCR mode? | |
487 bra customview_init_view1a ; YES - (1) | |
488 bra dive_customview_toggle ; NO to both, goto next view | |
582 | 489 customview_init_view1a: |
623 | 490 btfsc analog_o2_input ; (1) - do we have an analog input? |
491 bra customview_init_view1b ; YES - (2) | |
492 btfsc s8_digital_avail ; NO - do we have a digital S8 interface? | |
493 bra customview_init_view1b ; YES - (2) | |
494 btfss optical_input ; NO - do we have an optical input? | |
495 bra dive_customview_toggle ; NO - goto next view | |
496 ; YES - (2) | |
582 | 497 customview_init_view1b: |
623 | 498 call TFT_ppo2_sensors_mask ; (2) - mask for ppO2 sensors |
499 call TFT_ppo2_sensors ; - data for ppO2 sensors | |
500 bra customview_toggle_exit ; - done | |
501 ELSE | |
502 bra dive_customview_toggle ; not available without external sensors, got next view | |
503 ENDIF | |
0 | 504 |
604 | 505 init_avr_stopwatch: |
506 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
623 | 507 bra dive_customview_toggle ; YES - goto next view |
508 call TFT_avr_stopwatch_mask ; NO - mask for average depth and stopwatch | |
509 call TFT_avr_stopwatch ; - data for average depth and stopwatch | |
510 bra customview_toggle_exit ; - done | |
0 | 511 |
604 | 512 init_decoplan: |
513 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
623 | 514 bra dive_customview_toggle ; YES - goto next view |
515 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
516 bra dive_customview_toggle ; YES - goto next view | |
517 call TFT_decoplan_mask ; NO - mask for deco plan | |
518 call TFT_decoplan ; - data for deco plan | |
519 bra customview_toggle_exit ; - done | |
0 | 520 |
604 | 521 init_clock_batt_surfpress: |
522 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure | |
523 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure | |
623 | 524 bra customview_toggle_exit ; done |
0 | 525 |
604 | 526 init_gf_factors: |
527 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
623 | 528 bra dive_customview_toggle ; YES - goto next view |
529 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
530 bra dive_customview_toggle ; YES - call next view | |
531 TSTOSS char_I_deco_model ; NO - in GF mode (0 = ZH-L16, 1 = ZH-L16-GF)? | |
532 bra dive_customview_toggle ; NO - no GF info for non-GF modes | |
533 call TFT_gf_factors_mask ; YES - mask for GF factors (static only) | |
534 bra customview_toggle_exit ; - done | |
0 | 535 |
604 | 536 init_TFT_dive_compass: ; compass |
623 | 537 IFDEF _compass |
604 | 538 call I2C_init_compass ; start compass |
539 call TFT_dive_compass_mask ; show compass mask | |
623 | 540 bra customview_toggle_exit ; done |
541 ELSE | |
542 bra dive_customview_toggle ; not available without compass compiled in, goto next view | |
543 ENDIF | |
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
48
diff
changeset
|
544 |
604 | 545 init_pressures_SAC: ; tank pressure and SAC rate |
546 IFDEF _rx_functions | |
623 | 547 btfss tr_functions_activated ; TR functions activated? |
548 bra dive_customview_toggle ; NO - goto next view | |
549 call TFT_pressures_SAC_mask ; YES - mask for pressures and SAC | |
550 call TFT_pressures_SAC ; - data for pressures and SAC | |
551 bra customview_toggle_exit ; - done | |
604 | 552 ELSE |
623 | 553 bra dive_customview_toggle ; not available without RX functions, got next view |
604 | 554 ENDIF |
102
37275e0fa7f5
NEW: Show End-of-Dive time together with clock during deco
heinrichsweikamp
parents:
53
diff
changeset
|
555 |
604 | 556 init_CNS: ; CNS at end of dive |
623 | 557 btfsc FLAG_gauge_mode ; in gauge mode? |
558 bra dive_customview_toggle ; YES - call next view | |
559 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? | |
560 bra dive_customview_toggle ; YES - call next view | |
561 call TFT_CNS_mask ; NO - mask for CNS values | |
562 call TFT_CNS ; - data for CNS values | |
563 bra customview_toggle_exit ; - done | |
333
14b466f66a7f
Extend the Ceiling custom-view with ppO2 and current GF
Janos Kovacs <kovjanos@gmail.com>
parents:
327
diff
changeset
|
564 |
604 | 565 init_ceiling_GF_tissue: ; ceiling, tissues and current GF |
566 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
623 | 567 bra dive_customview_toggle ; YES - goto next view |
568 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
569 bra dive_customview_toggle ; YES - call next view | |
570 call TFT_ceiling_GF_tissue_mask ; NO - mask for ceiling, current GF and tissues | |
571 call TFT_ceiling_GF_tissue ; - data for ceiling, current GF and tissues | |
572 bra customview_toggle_exit ; - done | |
525
00df86a5ac01
BUGFIX: Do not show GF in divemode for non-GF deco mode
heinrichsweikamp
parents:
517
diff
changeset
|
573 |
604 | 574 init_sensor_check: ; sensor check |
623 | 575 IFDEF _ccr_pscr |
576 btfss FLAG_ccr_mode ; in CCR mode? | |
577 bra dive_customview_toggle ; NO - goto next view | |
578 call TFT_sensor_check_mask ; YES - mask for sensor check | |
579 call TFT_sensor_check ; - data for sensor check | |
580 bra customview_toggle_exit ; - done | |
581 ELSE | |
582 bra dive_customview_toggle ; not available without CCR mode compiled in, goto next view | |
583 ENDIF | |
123 | 584 |
604 | 585 init_ppo2_ead_end_cns: ; ppO2, END/EAD and CNS |
586 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
623 | 587 bra dive_customview_toggle ; YES - goto next view |
588 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
589 bra dive_customview_toggle ; YES - goto next view | |
590 call TFT_ppo2_ead_end_cns_mask ; NO - mask for ppO2, END/EAD and CNS | |
591 call TFT_ppo2_ead_end_cns ; - data for ppO2, END/EAD and CNS | |
592 bra customview_toggle_exit ; - done | |
560 | 593 |
604 | 594 init_pscr_info: ; pSCR information |
623 | 595 IFDEF _ccr_pscr |
604 | 596 btfss FLAG_pscr_mode ; in pSCR mode? |
623 | 597 bra dive_customview_toggle ; NO - goto next view |
598 call TFT_pscr_info_mask ; YES - mask for pSCR info | |
599 call TFT_pscr_info ; - data for pSCR info | |
600 bra customview_toggle_exit ; - done | |
601 ELSE | |
602 bra dive_customview_toggle ; not available without CCR / pSCR mode, goto next view | |
603 ENDIF | |
604 | 604 |
605 init_gas_needs_ascent: ; gas needs for ascent | |
606 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
623 | 607 bra dive_customview_toggle ; YES - goto next view |
608 btfsc FLAG_gauge_mode ; NO - in gauge mode? | |
609 bra dive_customview_toggle ; YES - goto next view | |
610 TSTOSS opt_calc_asc_gasvolume ; NO - check if gas volume calculation is switched on | |
611 bra dive_customview_toggle ; NO - goto next view | |
612 call TFT_gas_needs_ascent_mask ; YES - mask for gas needs ascent | |
613 call TFT_gas_needs_ascent ; - data for gas needs ascent | |
614 bra customview_toggle_exit ; - done | |
582 | 615 |
0 | 616 customview_toggle_exit: |
623 | 617 bcf request_next_custview ; clear request flag |
618 return ; done | |
0 | 619 |
623 | 620 ;----------------------------------------------------------------------------- |
0 | 621 |
623 | 622 END |