Mercurial > public > hwos_code
comparison src/customview.asm @ 631:185ba2f91f59
3.09 beta 1 release
| author | heinrichsweikamp |
|---|---|
| date | Fri, 28 Feb 2020 15:45:07 +0100 |
| parents | cd58f7fc86db |
| children | 4050675965ea |
comparison
equal
deleted
inserted
replaced
| 630:4cd81bdbf15c | 631:185ba2f91f59 |
|---|---|
| 1 ;============================================================================= | 1 ;============================================================================= |
| 2 ; | 2 ; |
| 3 ; File customview.asm combined next generation V3.03.5 | 3 ; File customview.asm combined next generation V3.08.8 |
| 4 ; | 4 ; |
| 5 ; Custom Views in Surface and Dive Mode | 5 ; Custom Views in Surface and Dive Mode |
| 6 ; | 6 ; |
| 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. |
| 8 ;============================================================================= | 8 ;============================================================================= |
| 22 #include "i2c.inc" | 22 #include "i2c.inc" |
| 23 #include "start.inc" | 23 #include "start.inc" |
| 24 | 24 |
| 25 | 25 |
| 26 extern gaslist_strcat_gas_cd | 26 extern gaslist_strcat_gas_cd |
| 27 extern char_I_deco_model | 27 extern char_I_model |
| 28 | 28 |
| 29 IFDEF _compass | 29 IFDEF _compass |
| 30 extern TFT_surface_compass_mask | 30 extern TFT_surface_compass_mask |
| 31 extern TFT_dive_compass_mask | 31 extern TFT_dive_compass_mask |
| 32 ENDIF | 32 ENDIF |
| 33 | 33 |
| 34 #DEFINE num_premenu_items .11 ; overall number of pre-menu items | |
| 34 | 35 |
| 35 custview CODE | 36 custview CODE |
| 36 | 37 |
| 37 ;----------------------------------------------------------------------------- | 38 ;----------------------------------------------------------------------------- |
| 38 | 39 |
| 44 ; index numbers defined in hwos.inc! | 45 ; index numbers defined in hwos.inc! |
| 45 | 46 |
| 46 global dive_customview_second | 47 global dive_customview_second |
| 47 dive_customview_second: | 48 dive_customview_second: |
| 48 movf active_customview,W ; get current view | 49 movf active_customview,W ; get current view |
| 49 dcfsnz WREG,F ; 1: | 50 dcfsnz WREG,F ; |
| 50 goto TFT_avr_stopwatch ; average depth and stopwatch | 51 goto TFT_avr_stopwatch ; 1: average depth and stopwatch |
| 51 dcfsnz WREG,F ; 2: | 52 dcfsnz WREG,F ; |
| 52 return ; compass - will be updated separately (faster) in dive mode | 53 IFDEF _compass |
| 53 dcfsnz WREG,F ; 3: | 54 return ; 2: compass - will be updated separately (faster) in dive mode |
| 55 ELSE | |
| 56 return ; 2: not available without compass | |
| 57 ENDIF | |
| 58 dcfsnz WREG,F ; | |
| 54 IFDEF _external_sensor | 59 IFDEF _external_sensor |
| 55 goto TFT_ppo2_sensors ; ppO2 sensors | 60 goto TFT_ppo2_sensors ; 3: ppO2 sensors |
| 56 ELSE | 61 ELSE |
| 57 return ; not available without external sensors | 62 return ; 3: not available without external sensors |
| 58 ENDIF | 63 ENDIF |
| 59 dcfsnz WREG,F ; 4: | 64 dcfsnz WREG,F ; |
| 60 IFDEF _ccr_pscr | 65 IFDEF _ccr_pscr |
| 61 goto TFT_sensor_check ; sensor check | 66 goto TFT_sensor_check ; 4: sensor check |
| 62 ELSE | 67 ELSE |
| 63 return ; not available without CCR / pSCR mode | 68 return ; 4: not available without CCR / pSCR mode |
| 64 ENDIF | 69 ENDIF |
| 65 dcfsnz WREG,F ; 5; | 70 dcfsnz WREG,F ; |
| 66 IFDEF _ccr_pscr | 71 IFDEF _ccr_pscr |
| 67 goto TFT_pscr_info ; pSCR data | 72 goto TFT_pscr_info ; 5: pSCR data |
| 68 ELSE | 73 ELSE |
| 69 return ; not available without CCR / pSCR mode | 74 return ; 5: not available without CCR / pSCR mode |
| 70 ENDIF | 75 ENDIF |
| 71 dcfsnz WREG,F ; 6: | 76 dcfsnz WREG,F ; |
| 72 IFDEF _rx_functions | 77 IFDEF _rx_functions |
| 73 goto TFT_pressures_SAC ; tank pressure and SAC rate | 78 goto TFT_pressures_SAC ; 6: tank pressure and SAC rate |
| 74 ELSE | 79 ELSE |
| 75 return ; not available without RX functions | 80 return ; 6: not available without RX functions |
| 76 ENDIF | 81 ENDIF |
| 77 dcfsnz WREG,F ; 7: | 82 dcfsnz WREG,F ; |
| 78 goto TFT_gas_needs_ascent ; gas needs for ascent / cave return | 83 goto TFT_gas_needs ; 7: gas needs for ascent / cave return |
| 79 dcfsnz WREG,F ; 8: | 84 dcfsnz WREG,F ; |
| 80 goto TFT_decoplan ; deco plan | 85 IFDEF _cave_mode |
| 81 dcfsnz WREG,F ; 9: | 86 goto TFT_cave_tts ; 8: cave mode TTS |
| 82 goto TFT_ceiling_GF_tissue ; ceiling, current GF and tissues | 87 ELSE |
| 83 dcfsnz WREG,F ; 10: | 88 return ; 8: not available without cave mode functions |
| 84 goto TFT_CNS ; CNS values | 89 ENDIF |
| 85 dcfsnz WREG,F ; 11: | 90 dcfsnz WREG,F ; |
| 86 goto TFT_ppo2_ead_end_cns ; ppO2, END/EAD and CNS | 91 goto TFT_decoplan ; 9: deco plan |
| 87 dcfsnz WREG,F ; 12: | 92 dcfsnz WREG,F ; |
| 88 return ; GF factors - static only | 93 goto TFT_ceiling_GF_tissue ; 10: ceiling, current GF and tissues |
| 89 dcfsnz WREG,F ; 13: | 94 dcfsnz WREG,F ; |
| 90 goto TFT_clock_batt_surfpress ; clock, battery and surface pressure | 95 goto TFT_CNS ; 11: CNS values |
| 91 return ; active_customview = 0 -> do nothing | 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 | |
| 92 | 109 |
| 93 ;----------------------------------------------------------------------------- | 110 ;----------------------------------------------------------------------------- |
| 94 | 111 |
| 95 global surf_customview_toggle | 112 global surf_customview_toggle |
| 96 surf_customview_toggle: | 113 surf_customview_toggle: |
| 266 ENDIF | 283 ENDIF |
| 267 | 284 |
| 268 ;----------------------------------------------------------------------------- | 285 ;----------------------------------------------------------------------------- |
| 269 | 286 |
| 270 global menuview_toggle | 287 global menuview_toggle |
| 288 global menuview_toggle_reset | |
| 271 menuview_toggle: ; show main menu or the pre-menu | 289 menuview_toggle: ; show main menu or the pre-menu |
| 272 bcf switch_left ; clear button event | 290 bcf switch_left ; clear button event |
| 273 movlw divemode_timeout_premenu ; get timeout for dive mode pre-menu | 291 movlw divemode_timeout_premenu ; get timeout for dive mode pre-menu |
| 274 call reset_timeout_time ; reset timeout | 292 call reset_timeout_time ; reset timeout |
| 275 bsf dive_options_menu ; flag that the dive options menu is shown | 293 bsf dive_options_menu ; flag that the dive options menu is shown |
| 276 incf active_premenu,F ; current number of pre-menu item | 294 incf active_premenu,F ; increment pre-menu item number |
| 277 movlw d'10' ; max number of pre-menu items | 295 movlw num_premenu_items ; get count of pre-menu items |
| 278 cpfsgt active_premenu ; max reached? | 296 cpfsgt active_premenu ; max reached? |
| 279 bra menuview_mask ; NO - show item | 297 bra menuview_mask ; NO - show item |
| 280 ;bra menuview_toggle_reset ; YES - reset selector | 298 ;bra menuview_toggle_reset ; YES - reset selector |
| 281 | |
| 282 global menuview_toggle_reset | |
| 283 menuview_toggle_reset: ; timeout occurred, beyond max number of options, or item executed | 299 menuview_toggle_reset: ; timeout occurred, beyond max number of options, or item executed |
| 284 clrf active_premenu ; reset pre-menu selector | 300 clrf active_premenu ; reset pre-menu selector |
| 285 bcf dive_options_menu ; the dive options menu is not shown anymore | 301 bcf dive_options_menu ; the dive options menu is not shown anymore |
| 286 menuview_mask: | 302 menuview_mask: |
| 287 WIN_BOX_BLACK dm_premenu_row, dm_premenu_bot, dm_premenu_col, dm_premenu_rgt ; top, bottom, left, right | 303 WIN_BOX_BLACK dm_premenu_row, dm_premenu_bot, dm_premenu_col, dm_premenu_rgt ; top, bottom, left, right |
| 289 bra menuview_items ; YES - display menu item | 305 bra menuview_items ; YES - display menu item |
| 290 bcf win_invert ; NO - end inverse printing | 306 bcf win_invert ; NO - end inverse printing |
| 291 btfss FLAG_apnoe_mode ; - in apnoe mode? | 307 btfss FLAG_apnoe_mode ; - in apnoe mode? |
| 292 goto TFT_show_temp_divemode ; YES - restore temperature and done | 308 goto TFT_show_temp_divemode ; YES - restore temperature and done |
| 293 goto TFT_standard_color ; NO - done | 309 goto TFT_standard_color ; NO - done |
| 310 | |
| 294 menuview_items: | 311 menuview_items: |
| 295 call TFT_attention_color ; set color | 312 call TFT_attention_color ; set color |
| 296 bsf win_invert ; set inverse printing | 313 bsf win_invert ; set inverse printing |
| 297 WIN_SMALL dm_premenu_col,dm_premenu_row | 314 WIN_SMALL dm_premenu_col,dm_premenu_row |
| 298 movf active_premenu,W ; get active pre-menu item | 315 movf active_premenu,W ; get active pre-menu item |
| 299 dcfsnz WREG,F | 316 dcfsnz WREG,F |
| 300 bra menuview_view_gaschange ; check if a better gas/diluent is advised and prompt for switching if yes | 317 bra menuview_view_gaschange ; 1: gas change (skipped if no better gas/dil cued) |
| 301 dcfsnz WREG,F | 318 dcfsnz WREG,F |
| 302 bra menuview_view1 ; "Menu?" (skipped in gauge and apnoe modes) | 319 bra menuview_view_divemenu ; 2: "Menu?" (skipped in gauge and apnoe modes) |
| 303 dcfsnz WREG,F | 320 dcfsnz WREG,F |
| 304 bra menuview_view2 ; "Quit?" (in simulation mode only) | 321 IFDEF _cave_mode |
| 305 dcfsnz WREG,F | 322 bra menuview_view_cavemenu ; 3: "Cave?" (skipped if not in cave mode) |
| 306 bra menuview_view3 ; "Sim-1m" (in simulation mode only) | 323 ELSE |
| 307 dcfsnz WREG,F | 324 bra menuview_toggle ; 3: cave mode not implemented, go to next menu item |
| 308 bra menuview_view4 ; "Sim+1m" (in simulation mode only) | 325 ENDIF |
| 309 dcfsnz WREG,F | 326 dcfsnz WREG,F |
| 310 bra menuview_view5 ; "Quit?" (in apnoe mode only) | 327 bra menuview_view_sim_quit ; 4: "Quit?" (in simulation mode only) |
| 311 dcfsnz WREG,F | 328 dcfsnz WREG,F |
| 312 bra menuview_view6 ; "Reset Avr" (in gauge mode only) | 329 bra menuview_view_sim_down ; 5: "Sim down" (in simulation mode only) |
| 313 dcfsnz WREG,F | 330 dcfsnz WREG,F |
| 314 bra menuview_view7 ; "Sim+5'" (in simulation mode only) | 331 bra menuview_view_sim_up ; 6: "Sim up" (in simulation mode only) |
| 315 dcfsnz WREG,F | 332 dcfsnz WREG,F |
| 316 bra menuview_view8 ; "Course" (only when compass is shown) | 333 bra menuview_view_sim_time ; 7: "Sim+5'" (in simulation mode only) |
| 317 dcfsnz WREG,F | 334 dcfsnz WREG,F |
| 318 bra menuview_view9 ; "Layout" (offer alternative layout, aka blind mode) | 335 bra menuview_view_apnoe_quit ; 8: "Quit?" (in apnoe mode only) |
| 336 dcfsnz WREG,F | |
| 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) | |
| 340 dcfsnz WREG,F | |
| 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 ! | |
| 319 | 344 |
| 320 menuview_exit: | 345 menuview_exit: |
| 321 call TFT_standard_color | 346 call TFT_standard_color |
| 322 bcf win_invert ; reset invert flag | 347 bcf win_invert ; reset invert flag |
| 323 return ; active pre-menu = 0, i.e. show nothing | 348 return ; active pre-menu = 0, i.e. show nothing |
| 324 | 349 |
| 325 | 350 |
| 326 menuview_view_gaschange: | 351 menuview_view_gaschange: |
| 327 btfsc request_gaschange ; last gas change request executed yet? | 352 btfsc request_gas_change ; last gas change request executed yet? |
| 328 bra menuview_toggle ; NO - call next option | 353 bra menuview_toggle ; YES - call next option |
| 329 IFDEF _ccr_pscr | 354 IFDEF _ccr_pscr |
| 330 btfsc FLAG_oc_mode ; in OC mode? | 355 btfsc FLAG_oc_mode ; in OC mode? |
| 331 bra menuview_view_gaschange_OC ; YES | 356 bra menuview_view_gaschange_OC ; YES |
| 332 btfsc bailout_mode ; in bailout? | 357 btfsc bailout_mode ; in bailout? |
| 333 bra menuview_view_gaschange_OC ; YES | 358 bra menuview_view_gaschange_OC ; YES |
| 346 menuview_view_gaschange_com: | 371 menuview_view_gaschange_com: |
| 347 decf PRODL,F ; (1-5) -> (0-4) | 372 decf PRODL,F ; (1-5) -> (0-4) |
| 348 bsf short_gas_descriptions ; use short version of gaslist_strcat_gas_cd and gaslist_strcat_setpoint | 373 bsf short_gas_descriptions ; use short version of gaslist_strcat_gas_cd and gaslist_strcat_setpoint |
| 349 bsf better_gas_hint ; color-code as best gas/diluent | 374 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 | 375 call gaslist_strcat_gas_cd ; append gas description of gas #PRODL (0-4) to current string |
| 351 movlw .5 | 376 movlw .5 ; point to 6th character (5 chars are used for the gas/dil description) |
| 352 movwf FSR2L ; point to 6th character (5 chars are used for the gas/dil description) | 377 movwf FSR2L ; ... |
| 353 STRCAT_PRINT "?" | 378 STRCAT_PRINT "?" ; print question mark |
| 354 bra menuview_exit ; done | 379 bra menuview_exit ; done |
| 355 | 380 |
| 356 menuview_view1: | 381 menuview_view_divemenu: |
| 357 btfsc FLAG_apnoe_mode ; in apnoe mode? | 382 btfsc FLAG_apnoe_mode ; in apnoe mode? |
| 358 bra menuview_toggle ; YES - goto next option | 383 bra menuview_toggle ; YES - goto next option |
| 359 btfsc FLAG_gauge_mode ; NO - in gauge mode? | 384 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
| 360 bra menuview_toggle ; YES - goto next option | 385 bra menuview_toggle ; YES - goto next option |
| 361 PUTC "\xb7" ; NO - print '->' symbol | 386 PUTC "\xb7" ; NO - print '->' symbol |
| 362 STRCAT_TEXT_PRINT tDivePreMenu ; - print "Menu?" | 387 STRCAT_TEXT_PRINT tDivePreMenu ; - print "Menu?" |
| 363 bra menuview_exit ; - done | 388 bra menuview_exit ; - done |
| 364 | 389 |
| 365 menuview_view2: | 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: | |
| 366 btfss simulatormode ; in simulator mode? | 400 btfss simulatormode ; in simulator mode? |
| 367 bra menuview_toggle ; NO - goto next option | 401 bra menuview_toggle ; NO - goto next option |
| 368 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Simulation?" | 402 STRCPY_TEXT_PRINT tQuitSim ; YES - print "Quit Simulation?" |
| 369 bra menuview_exit ; - done | 403 bra menuview_exit ; - done |
| 370 | 404 |
| 371 menuview_view3: | 405 menuview_view_sim_down: |
| 372 btfss simulatormode ; in simulator mode? | 406 btfss simulatormode ; in simulator mode? |
| 373 bra menuview_toggle ; NO - goto next option | 407 bra menuview_toggle ; NO - goto next option |
| 374 STRCPY_PRINT "Sim\xb8" ; print down arrow for going down | 408 STRCPY_PRINT "Sim\xb8" ; print down arrow for going down |
| 375 bra menuview_exit ; done | 409 bra menuview_exit ; done |
| 376 | 410 |
| 377 menuview_view4: | 411 menuview_view_sim_up: |
| 378 btfss simulatormode ; in simulator mode? | 412 btfss simulatormode ; in simulator mode? |
| 379 bra menuview_toggle ; NO - goto next option | 413 bra menuview_toggle ; NO - goto next option |
| 380 STRCPY_PRINT "Sim\xb9" ; YES - print up arrow for going up | 414 STRCPY_PRINT "Sim\xb9" ; YES - print up arrow for going up |
| 381 bra menuview_exit ; - done | 415 bra menuview_exit ; - done |
| 382 | 416 |
| 383 menuview_view5: | 417 menuview_view_sim_time: |
| 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 | |
| 390 | |
| 391 menuview_view6: | |
| 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 | |
| 396 | |
| 397 menuview_view7: | |
| 398 btfss simulatormode ; in simulator mode? | 418 btfss simulatormode ; in simulator mode? |
| 399 bra menuview_toggle ; NO - goto next option | 419 bra menuview_toggle ; NO - goto next option |
| 400 btfsc FLAG_gauge_mode ; YES - in gauge mode? | 420 btfsc FLAG_gauge_mode ; YES - in gauge mode? |
| 401 bra menuview_toggle ; YES - goto next option | 421 bra menuview_toggle ; YES - goto next option |
| 402 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? | 422 btfsc FLAG_apnoe_mode ; NO - in apnoe mode? |
| 403 bra menuview_toggle ; YES - goto next option | 423 bra menuview_toggle ; YES - goto next option |
| 404 STRCPY_PRINT "Sim+5'" ; NO - print "Sim+5'" | 424 STRCPY_PRINT "Sim+5'" ; NO - print "Sim+5'" |
| 405 bra menuview_exit ; - done | 425 bra menuview_exit ; - done |
| 406 | 426 |
| 407 menuview_view8: | 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: | |
| 408 IFDEF _compass | 442 IFDEF _compass |
| 409 movlw index_compass_dm ; index of compass view | 443 movlw index_compass_dm ; index of compass view |
| 410 cpfseq active_customview ; in compass view? | 444 cpfseq active_customview ; in compass view? |
| 411 bra menuview_toggle ; NO - goto next option | 445 bra menuview_toggle ; NO - goto next option |
| 412 STRCPY_TEXT_PRINT tSetHeading ; YES - print "Heading" | 446 STRCPY_TEXT_PRINT tSetHeading ; YES - print "Heading" |
| 413 bra menuview_exit ; - done | 447 bra menuview_exit ; - done |
| 414 ELSE | 448 ELSE |
| 415 bra menuview_toggle ; not available without compass compiled in, goto next option | 449 bra menuview_toggle ; not available without compass compiled in, goto next option |
| 416 ENDIF | 450 ENDIF |
| 417 | 451 |
| 418 menuview_view9: | 452 menuview_view_layout: |
| 419 btfsc FLAG_apnoe_mode ; in apnoe mode? | 453 btfsc FLAG_apnoe_mode ; in apnoe mode? |
| 420 bra menuview_toggle ; YES - goto next option | 454 bra menuview_toggle ; YES - goto next option |
| 421 STRCPY_TEXT_PRINT tDiveLayout ; NO - print "Layout" | 455 STRCPY_TEXT_PRINT tDiveLayout ; NO - print "Layout" |
| 422 bra menuview_exit ; - done | 456 bra menuview_exit ; - done |
| 423 | 457 |
| 424 ;----------------------------------------------------------------------------- | 458 ;----------------------------------------------------------------------------- |
| 425 | 459 |
| 426 ; Show next dive mode custom view (and delete this flag) | 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 | |
| 427 global dive_customview_toggle | 477 global dive_customview_toggle |
| 428 dive_customview_toggle: | 478 dive_customview_toggle: |
| 429 incf active_customview,F ; increment number of custom view to show | 479 incf active_customview,F ; increment number of custom view to show |
| 430 | |
| 431 movlw index_compass_dm ; index of custom view compass | |
| 432 cpfseq active_customview ; will compass be shown in custom view? | |
| 433 call I2C_sleep_compass ; NO - stop compass | |
| 434 | |
| 435 movlw index_cv_dm_max ; highest index in use in dive mode custom view | 480 movlw index_cv_dm_max ; highest index in use in dive mode custom view |
| 436 cpfsgt active_customview ; max reached? | 481 cpfsgt active_customview ; max reached? |
| 437 bra dive_customview_mask ; NO - show | 482 bra dive_customview_callup ; NO - call-up the custom view |
| 438 clrf active_customview ; YES - reset to zero (zero = no custom view) | 483 clrf active_customview ; YES - reset to zero (zero = blank custom view) |
| 439 ;bra dive_customview_mask ; - show | 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 | |
| 440 | 492 |
| 441 ;---------------------------------------------------------------------------------- | 493 ;---------------------------------------------------------------------------------- |
| 442 ; Jump table for initialization of the every-second tasks in custom view area (dive mode) | 494 ; Jump table for initialization of the every-second tasks in custom view area (dive mode) |
| 443 ; | 495 ; |
| 444 ; Attention: the ordering must be in line with the every-second update jump table | 496 ; Attention: the ordering must be in line with the every-second update jump table |
| 445 ; and the index numbers defined in hwos.inc! | 497 ; and the index numbers defined in hwos.inc! |
| 446 ; | 498 ; |
| 447 global dive_customview_mask | 499 dive_customview_init: |
| 448 dive_customview_mask: | |
| 449 ; clear custom view area in dive mode | 500 ; clear custom view area in dive mode |
| 450 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right | 501 WIN_BOX_BLACK dm_customview_row, dm_customview_bot-.2, dm_customview_column, dm_customview_rgt ; top, bottom, left, right |
| 451 movf active_customview,W ; get custom view to show | 502 movf active_customview,W ; get custom view to show |
| 452 dcfsnz WREG,F ; 1: | 503 dcfsnz WREG,F ; |
| 453 bra init_avr_stopwatch ; average depth and stopwatch | 504 bra init_avr_stopwatch ; 1: average depth and stopwatch |
| 454 dcfsnz WREG,F ; 2: | 505 dcfsnz WREG,F ; |
| 455 bra init_TFT_dive_compass ; compass | 506 bra init_TFT_dive_compass ; 2: compass |
| 456 dcfsnz WREG,F ; 3: | 507 dcfsnz WREG,F ; |
| 457 bra init_ppo2_sensors ; ppO2 sensors | 508 bra init_ppo2_sensors ; 3: ppO2 sensors |
| 458 dcfsnz WREG,F ; 4: | 509 dcfsnz WREG,F ; |
| 459 bra init_sensor_check ; sensor check | 510 bra init_sensor_check ; 4: sensor check |
| 460 dcfsnz WREG,F ; 5: | 511 dcfsnz WREG,F ; |
| 461 bra init_pscr_info ; pSCR data | 512 bra init_pscr_info ; 5: pSCR data |
| 462 dcfsnz WREG,F ; 6: | 513 dcfsnz WREG,F ; |
| 463 bra init_pressures_SAC ; tank pressure and SAC rate | 514 bra init_pressures_SAC ; 6: tank pressure and SAC rate |
| 464 dcfsnz WREG,F ; 7: | 515 dcfsnz WREG,F ; |
| 465 bra init_gas_needs_ascent ; gas needs for ascent / cave return | 516 bra init_gas_needs_ascent ; 7: gas needs for ascent / cave return |
| 466 dcfsnz WREG,F ; 8: | 517 dcfsnz WREG,F ; |
| 467 bra init_decoplan ; deco plan | 518 bra init_cave_tts ; 8: cave mode TTS |
| 468 dcfsnz WREG,F ; 9: | 519 dcfsnz WREG,F ; |
| 469 bra init_ceiling_GF_tissue ; ceiling, current GF and tissues | 520 bra init_decoplan ; 9: deco plan (next stops) |
| 470 dcfsnz WREG,F ; 10: | 521 dcfsnz WREG,F ; |
| 471 bra init_CNS ; CNS values | 522 bra init_ceiling_GF_tissue ; 10: ceiling, current GF and tissues |
| 472 dcfsnz WREG,F ; 11: | 523 dcfsnz WREG,F ; |
| 473 bra init_ppo2_ead_end_cns ; ppO2, END/EAD and CNS | 524 bra init_CNS ; 11: CNS values |
| 474 dcfsnz WREG,F ; 12: | 525 dcfsnz WREG,F ; |
| 475 bra init_gf_factors ; GF factors | 526 bra init_ppo2_ead_end_cns ; 12: ppO2, END/EAD and CNS |
| 476 dcfsnz WREG,F ; 13: | 527 dcfsnz WREG,F ; |
| 477 bra init_clock_batt_surfpress ; clock, battery and surface pressure | 528 bra init_clock_batt_surfpress ; 13: clock, battery and surface pressure |
| 478 bra customview_toggle_exit ; no view (blank screen in custom view area) | 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) | |
| 479 | 534 |
| 480 | 535 |
| 481 init_ppo2_sensors: | 536 init_ppo2_sensors: |
| 482 IFDEF _external_sensor | 537 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 | 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 |
| 521 init_clock_batt_surfpress: | 576 init_clock_batt_surfpress: |
| 522 call TFT_clock_batt_surfpress_mask ; mask for clock, battery and surface pressure | 577 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 | 578 call TFT_clock_batt_surfpress ; data for clock, battery and surface pressure |
| 524 bra customview_toggle_exit ; done | 579 bra customview_toggle_exit ; done |
| 525 | 580 |
| 526 init_gf_factors: | |
| 527 btfsc FLAG_apnoe_mode ; in apnoe mode? | |
| 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 | |
| 535 | |
| 536 init_TFT_dive_compass: ; compass | 581 init_TFT_dive_compass: ; compass |
| 537 IFDEF _compass | 582 IFDEF _compass |
| 538 call I2C_init_compass ; start compass | 583 call I2C_init_compass ; start compass |
| 539 call TFT_dive_compass_mask ; show compass mask | 584 call TFT_dive_compass_mask ; show compass mask |
| 540 bra customview_toggle_exit ; done | 585 bra customview_toggle_exit ; done |
| 605 init_gas_needs_ascent: ; gas needs for ascent | 650 init_gas_needs_ascent: ; gas needs for ascent |
| 606 btfsc FLAG_apnoe_mode ; in apnoe mode? | 651 btfsc FLAG_apnoe_mode ; in apnoe mode? |
| 607 bra dive_customview_toggle ; YES - goto next view | 652 bra dive_customview_toggle ; YES - goto next view |
| 608 btfsc FLAG_gauge_mode ; NO - in gauge mode? | 653 btfsc FLAG_gauge_mode ; NO - in gauge mode? |
| 609 bra dive_customview_toggle ; YES - goto next view | 654 bra dive_customview_toggle ; YES - goto next view |
| 610 TSTOSS opt_calc_asc_gasvolume ; NO - check if gas volume calculation is switched on | 655 TSTOSS opt_calc_gasvolume ; NO - check if gas volume calculation is switched on |
| 611 bra dive_customview_toggle ; NO - goto next view | 656 bra dive_customview_toggle ; NO - goto next view |
| 612 call TFT_gas_needs_ascent_mask ; YES - mask for gas needs ascent | 657 call TFT_gas_needs_mask ; YES - mask for gas needs ascent |
| 613 call TFT_gas_needs_ascent ; - data for gas needs ascent | 658 call TFT_gas_needs ; - data for gas needs ascent |
| 614 bra customview_toggle_exit ; - done | 659 bra customview_toggle_exit ; - done |
| 660 | |
| 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 | |
| 615 | 684 |
| 616 customview_toggle_exit: | 685 customview_toggle_exit: |
| 617 bcf request_next_custview ; clear request flag | 686 bcf request_next_custview ; clear request flag |
| 618 return ; done | 687 return ; done |
| 619 | 688 |
