comparison src/menu_tree.asm @ 628:cd58f7fc86db

3.05 stable work
author heinrichsweikamp
date Thu, 19 Sep 2019 12:01:29 +0200
parents c40025d8e750
children 237931377539
comparison
equal deleted inserted replaced
627:bf5fee575701 628:cd58f7fc86db
1 ;============================================================================= 1 ;=============================================================================
2 ; 2 ;
3 ; File menu_tree.asm next combined generation V3.03.3 3 ; File menu_tree.asm next combined generation V3.04.3
4 ; 4 ;
5 ; OSTC Surface Menus 5 ; OSTC Surface Menus
6 ; 6 ;
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
8 ;============================================================================= 8 ;=============================================================================
114 bcf imprint_sensor_mv ; stop imprinting of live O2 sensor mV data 114 bcf imprint_sensor_mv ; stop imprinting of live O2 sensor mV data
115 btfsc analog_o2_input 115 btfsc analog_o2_input
116 bra do_ccr_menu_cR 116 bra do_ccr_menu_cR
117 ENDIF 117 ENDIF
118 118
119 MENU_BEGIN tCCRSetup, .6 ; OSTC3 menu (and currently also the OSTC2 menu) 119 MENU_BEGIN tCCRSetup, .5 ; OSTC3 menu (and currently also the OSTC2 menu)
120 MENU_OPTION tCCRMode, oCCRMode, 0 120 MENU_OPTION tCCRMode, oCCRMode, 0
121 MENU_CALL tDiluentSetup, do_diluent_setup 121 MENU_CALL tDiluentSetup, do_diluent_setup
122 MENU_CALL tFixedSetpoints, do_fixed_setpoints 122 MENU_CALL tFixedSetpoints, do_fixed_setpoints
123 MENU_CALL tPSCRMenu, do_PSCR_menu 123 MENU_CALL tMore, do_ccr_menu_more
124 MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0
125 MENU_CALL tBack, do_return_main_menu 124 MENU_CALL tBack, do_return_main_menu
126 MENU_END 125 MENU_END
127 126
128 127
129 IFDEF _external_sensor 128 IFDEF _external_sensor
130 129
131 do_ccr_menu_cR: ; cR menu 130 do_ccr_menu_cR: ; cR menu
132 MENU_BEGIN tCCRSetup, .7 131 MENU_BEGIN tCCRSetup, .6
133 MENU_OPTION tCCRMode, oCCRMode, 0 132 MENU_OPTION tCCRMode, oCCRMode, 0
134 MENU_CALL tCalibrateMenu, do_calibrate_menu 133 MENU_CALL tCalibrateMenu, do_calibrate_menu
135 MENU_CALL tDiluentSetup, do_diluent_setup 134 MENU_CALL tDiluentSetup, do_diluent_setup
136 MENU_CALL tFixedSetpoints, do_fixed_setpoints 135 MENU_CALL tFixedSetpoints, do_fixed_setpoints
137 MENU_CALL tPSCRMenu, do_PSCR_menu 136 MENU_CALL tMore, do_ccr_menu_more
138 MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0
139 MENU_CALL tBack, do_return_main_menu 137 MENU_CALL tBack, do_return_main_menu
140 MENU_END 138 MENU_END
141 139
142 140
143 do_calibrate_menu: 141 do_calibrate_menu:
209 MENU_CALL tDepthMinus, gaslist_spdepthminus 207 MENU_CALL tDepthMinus, gaslist_spdepthminus
210 MENU_CALL tBack, do_return_fixed_setpoints 208 MENU_CALL tBack, do_return_fixed_setpoints
211 MENU_END 209 MENU_END
212 210
213 211
214 do_PSCR_menu: 212 do_ccr_menu_more:
215 MENU_BEGIN tPSCRMenu, .3 ; pSCR Menu 213 MENU_BEGIN tCCRSetup, .5 ; CCR/pSCR more menu
214 MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0
215 MENU_OPTION tDilppO2Check, oDilppO2Check, 0
216 MENU_OPTION tPSCR_O2_drop, oPSCR_drop, 0 216 MENU_OPTION tPSCR_O2_drop, oPSCR_drop, 0
217 MENU_OPTION tPSCR_lungratio, oPSCR_lungratio, 0 217 MENU_OPTION tPSCR_lungratio, oPSCR_lungratio, 0
218 MENU_CALL tBack, do_return_ccr_menu 218 MENU_CALL tBack, do_return_ccr_menu
219 MENU_END 219 MENU_END
220 220
353 353
354 ;============================================================================= 354 ;=============================================================================
355 ; Simulator Menus 355 ; Simulator Menus
356 356
357 do_return_planner_menu: 357 do_return_planner_menu:
358 call menu_processor_pop ; drop exit line and ... 358 call menu_processor_double_pop ; drop exit line and back to last line
359 bra do_planner_common_1
359 360
360 global do_return_demo_planner 361 global do_return_demo_planner
361 do_return_demo_planner: 362 do_return_demo_planner:
362 call menu_processor_pop ; back to last line 363 call menu_processor_pop ; back to last line
363 bra do_planner_common 364 bra do_planner_common
364 365
365 do_planner_menu: 366 do_planner_menu:
366 ; ensure correct simulator results after mode changes without prior excursion to surface mode 367 ; ensure correct simulator results after mode changes without prior excursion to surface mode
367 call option_save_all 368 call option_save_all
368 369
369 ; reset dive time/depth to default values 370 ; reset planning parameters to default values
370 lfsr FSR0,odiveInterval 371 lfsr FSR0,odiveInterval
371 call option_reset 372 call option_reset
372 lfsr FSR0,obottomTime 373 lfsr FSR0,obottomTime
373 call option_reset 374 call option_reset
374 lfsr FSR0,obottomDepth 375 lfsr FSR0,obottomDepth
375 call option_reset 376 call option_reset
376 lfsr FSR0,oSimAGF 377 lfsr FSR0,oSimAGF
377 call option_reset 378 call option_reset
378 379
380 IFDEF _gas_contingency
381 ; switch off gas contingency mode by default
382 clrf WREG
383 movff WREG,char_I_gas_contingency
384 ENDIF
385
379 do_planner_common: 386 do_planner_common:
380 call restart_set_modes_and_flags ; initialize dive mode settings 387 call restart_set_modes_and_flags ; initialize dive mode settings
388 do_planner_common_1:
381 movff opt_dive_mode,WREG ; get dive mode: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR 389 movff opt_dive_mode,WREG ; get dive mode: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR
382 dcfsnz WREG,W ; subtract one, became zero? 390 dcfsnz WREG,W ; subtract one, became zero?
383 bra do_planner_common_ccr ; YES - use CCR version 391 bra do_planner_common_ccr ; YES - use CCR version
384 392
385 MENU_BEGIN tPlan, .7 393 MENU_BEGIN tPlan, .7
402 MENU_CALL tDeco, do_demo_planner 410 MENU_CALL tDeco, do_demo_planner
403 MENU_CALL tBack, do_return_main_menu 411 MENU_CALL tBack, do_return_main_menu
404 MENU_END 412 MENU_END
405 413
406 do_planner_config: 414 do_planner_config:
415 IFDEF _gas_contingency
416 MENU_BEGIN tPlan, .4
417 MENU_OPTION tSelectSetpoint, oSimSetpoint, 0
418 MENU_OPTION tuseAGF, oSimAGF, 0
419 MENU_OPTION tGasContingency, oGasContingency, 0
420 MENU_CALL tBack, do_return_planner_menu
421 MENU_END
422 ELSE
407 MENU_BEGIN tPlan, .3 423 MENU_BEGIN tPlan, .3
408 MENU_OPTION tSelectSetpoint, oSimSetpoint, 0 424 MENU_OPTION tSelectSetpoint, oSimSetpoint, 0
409 MENU_OPTION tuseAGF, oSimAGF, 0 425 MENU_OPTION tuseAGF, oSimAGF, 0
410 MENU_CALL tBack, do_return_planner_menu 426 MENU_CALL tBack, do_return_planner_menu
411 MENU_END 427 MENU_END
428 ENDIF
412 429
413 430
414 ;============================================================================= 431 ;=============================================================================
415 ; Divemode Menu 432 ; Divemode Menu
416 433
511 MENU_END 528 MENU_END
512 529
513 530
514 ;============================================================================= 531 ;=============================================================================
515 ; Setup Menu 532 ; Setup Menu
516 533 do_return_settings_deeper: ; entry point for return from info menu 2
534 call menu_processor_pop ; drop one more stack entry
535
517 do_return_settings: 536 do_return_settings:
518 bcf imprint_time_date ; stop imprinting of current time & date 537 bcf imprint_time_date ; stop imprinting of current time & date
519 call menu_processor_double_pop ; drop exit line and back to last line 538 call menu_processor_double_pop ; drop exit line and back to last line
520 IFDEF _rx_mode 539 IFDEF _rx_mode
521 bcf tr_functions_activated ; set TR functions as deactivated by default 540 bcf tr_functions_activated ; set TR functions as deactivated by default
574 ENDIF 593 ENDIF
575 594
576 MENU_BEGIN tInfoMenu, .6 595 MENU_BEGIN tInfoMenu, .6
577 MENU_DYNAMIC info_menu_serial, 0 596 MENU_DYNAMIC info_menu_serial, 0
578 MENU_DYNAMIC info_menu_firmware, 0 597 MENU_DYNAMIC info_menu_firmware, 0
598 MENU_DYNAMIC info_menu_config, 0
579 MENU_DYNAMIC info_menu_battery_volts, 0 599 MENU_DYNAMIC info_menu_battery_volts, 0
580 MENU_DYNAMIC info_menu_uptime, 0 600 MENU_DYNAMIC info_menu_uptime, 0
581 MENU_DYNAMIC info_menu_total_dives, 0 601 MENU_CALL tMore, do_info_menu2
582 MENU_CALL tBack, do_return_settings
583 MENU_END 602 MENU_END
584 603
585 IFDEF _rx_functions 604 IFDEF _rx_functions
586 do_info_menu_TR: 605 do_info_menu_TR:
587 MENU_BEGIN tInfoMenu, .7 606 MENU_BEGIN tInfoMenu, .7
588 MENU_DYNAMIC info_menu_serial, 0 607 MENU_DYNAMIC info_menu_serial, 0
589 MENU_DYNAMIC info_menu_firmware, 0 608 MENU_DYNAMIC info_menu_firmware, 0
590 MENU_DYNAMIC info_menu_firmware_rx, 0 609 MENU_DYNAMIC info_menu_firmware_rx, 0
591 MENU_DYNAMIC info_menu_total_dives, 0 610 MENU_DYNAMIC info_menu_config, 0
592 MENU_DYNAMIC info_menu_battery_volts, 0 611 MENU_DYNAMIC info_menu_battery_volts, 0
593 MENU_DYNAMIC info_menu_uptime, 0 612 MENU_DYNAMIC info_menu_uptime, 0
594 MENU_CALL tBack, do_return_settings 613 MENU_CALL tMore, do_info_menu2
595 MENU_END 614 MENU_END
596 ENDIF 615 ENDIF
597 616
617 do_info_menu2: ;same for all hardware versions
618 MENU_BEGIN tInfoMenu, .2
619 MENU_DYNAMIC info_menu_total_dives, 0
620 MENU_CALL tBack, do_return_settings_deeper
621 MENU_END
622
623
598 624
599 IFDEF _rx_functions 625 IFDEF _rx_functions
600 626
601 do_settings_menu_TR: 627 do_settings_menu_TR:
602 movff opt_dive_mode,WREG ; get dive mode: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR 628 movff opt_dive_mode,WREG ; get dive mode: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR