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