Mercurial > public > hwos_code
comparison src/divemenu_tree.asm @ 656:8af5aefbcdaf default tip
Update to 3.31 beta
| author | heinrichsweikamp |
|---|---|
| date | Thu, 27 Nov 2025 18:32:58 +0100 |
| parents | 75e90cd0c2c3 |
| children |
comparison
equal
deleted
inserted
replaced
| 655:c7b7b8a358cd | 656:8af5aefbcdaf |
|---|---|
| 126 MENU_CALL tExit, do_exit_divemode_menu | 126 MENU_CALL tExit, do_exit_divemode_menu |
| 127 MENU_END | 127 MENU_END |
| 128 | 128 |
| 129 | 129 |
| 130 main_divemenu_pscr: | 130 main_divemenu_pscr: |
| 131 IFDEF _external_sensor | 131 IFDEF _external_sensor_eccr |
| 132 btfsc ext_input_s8_ana ; do we have an S8/analog input (OSTC cR)? | 132 btfsc ext_input_s8_ana ; do we have an S8/analog input (OSTC cR)? |
| 133 bra main_divemenu_pscr_sensors ; YES - do menu with calibration | 133 bra main_divemenu_pscr_sensors ; YES - do menu with calibration |
| 134 btfsc ext_input_optical ; do we have an optical input (OSTC 3)? | 134 btfsc ext_input_optical ; do we have an optical input (OSTC 3)? |
| 135 bra main_divemenu_pscr_sensors ; YES - do menu with calibration | 135 bra main_divemenu_pscr_sensors ; YES - do menu with calibration |
| 136 ENDIF ; _external_sensor | 136 btfsc ext_s8_full_digital ; NO - are we in external S8 full digital mode? |
| 137 bra main_divemenu_pscr_sensors ; YES - do menu with calibration | |
| 138 ENDIF ; _external_sensor_eccr | |
| 137 | 139 |
| 138 main_divemenu_pscr_no_sensors: | 140 main_divemenu_pscr_no_sensors: |
| 139 MENU_BEGIN_DIVE tMainMenu, .6 | 141 MENU_BEGIN_DIVE tMainMenu, .6 |
| 140 MENU_CALL tDiveBailout, do_divemode_gaslist_bail | 142 MENU_CALL tDiveBailout, do_divemode_gaslist_bail |
| 141 MENU_CALL tDivemenu_Premix, do_divemode_gaslist | 143 MENU_CALL tDivemenu_Premix, do_divemode_gaslist |
| 143 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr | 145 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr |
| 144 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf | 146 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf |
| 145 MENU_CALL tExit, do_exit_divemode_menu | 147 MENU_CALL tExit, do_exit_divemode_menu |
| 146 MENU_END | 148 MENU_END |
| 147 | 149 |
| 148 IFDEF _external_sensor | 150 IFDEF _external_sensor_eccr |
| 149 main_divemenu_pscr_sensors: | 151 main_divemenu_pscr_sensors: |
| 150 MENU_BEGIN_DIVE tMainMenu, .6 | 152 MENU_BEGIN_DIVE tMainMenu, .6 |
| 151 MENU_CALL tDiveBailout, do_divemode_gaslist_bail | 153 MENU_CALL tDiveBailout, do_divemode_gaslist_bail |
| 152 MENU_CALL tCCRModeSensor, do_divemode_setpoint_pscr | 154 MENU_CALL tCCRModeSensor, do_divemode_setpoint_pscr |
| 153 MENU_CALL tDivemenu_Premix, do_divemode_gaslist | 155 MENU_CALL tDivemenu_Premix, do_divemode_gaslist |
| 154 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr | 156 MENU_CALL tDivemenu_Avg_Mkr, do_reset_avg_set_mkr |
| 155 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf | 157 MENU_DYNAMIC dyn_toggle_gf, do_toggle_gf |
| 156 MENU_CALL tExit, do_exit_divemode_menu | 158 MENU_CALL tExit, do_exit_divemode_menu |
| 157 MENU_END | 159 MENU_END |
| 158 ENDIF ; _external_sensor | 160 ENDIF ; _external_sensor_eccr |
| 159 | 161 |
| 160 | 162 |
| 161 ;----------------------------------------------------------------------------- | 163 ;----------------------------------------------------------------------------- |
| 162 ; Call Function - start Bailout Condition | 164 ; Call Function - start Bailout Condition |
| 163 ; | 165 ; |
| 533 movlw .6 ; YES - load menu item number for 'sensor' | 535 movlw .6 ; YES - load menu item number for 'sensor' |
| 534 btfsc warn_det_sensors_lost ; all sensors lost? | 536 btfsc warn_det_sensors_lost ; all sensors lost? |
| 535 movlw .1 ; YES - revert to first menu item | 537 movlw .1 ; YES - revert to first menu item |
| 536 movwf menu_pos_cur ; set cursor position | 538 movwf menu_pos_cur ; set cursor position |
| 537 | 539 |
| 538 IFDEF _external_sensor | 540 IFDEF _external_sensor_eccr |
| 539 btfsc ext_input_s8_ana ; do we have an S8/analog input (OSTC cR)? | 541 btfsc ext_input_s8_ana ; do we have an S8/analog input (OSTC cR)? |
| 540 bra do_divemode_splist_sensor ; YES | 542 bra do_divemode_splist_sensor ; YES |
| 541 btfsc ext_input_optical ; do we have an optical input (OSTC 3)? | 543 btfsc ext_input_optical ; do we have an optical input (OSTC 3)? |
| 542 bra do_divemode_splist_sensor ; YES | 544 bra do_divemode_splist_sensor ; YES |
| 543 ENDIF ; _external_sensor | 545 btfsc ext_s8_full_digital ; NO - are we in external S8 full digital mode? |
| 546 bra main_divemenu_pscr_sensors ; YES - do menu with calibration | |
| 547 ENDIF ; _external_sensor_eccr | |
| 544 | 548 |
| 545 do_divemode_splist_no_sensor: | 549 do_divemode_splist_no_sensor: |
| 546 MENU_BEGIN_DIVE tFixedSetpoints, .6 | 550 MENU_BEGIN_DIVE tFixedSetpoints, .6 |
| 547 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp | 551 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp |
| 548 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp | 552 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp |
| 551 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp | 555 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp |
| 552 MENU_CALL tCCRModeAutoSP, do_switch_auto | 556 MENU_CALL tCCRModeAutoSP, do_switch_auto |
| 553 MENU_END | 557 MENU_END |
| 554 | 558 |
| 555 | 559 |
| 556 IFDEF _external_sensor | 560 IFDEF _external_sensor_eccr |
| 557 | 561 |
| 558 do_divemode_splist_sensor: | 562 do_divemode_splist_sensor: |
| 559 MENU_BEGIN_DIVE tFixedSetpoints, .6 | 563 MENU_BEGIN_DIVE tFixedSetpoints, .6 |
| 560 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp | 564 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp |
| 561 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp | 565 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp |
| 563 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp | 567 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp |
| 564 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp | 568 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_switch_sp |
| 565 MENU_CALL tCCRModeSensor, do_divemode_sensor | 569 MENU_CALL tCCRModeSensor, do_divemode_sensor |
| 566 MENU_END | 570 MENU_END |
| 567 | 571 |
| 568 ENDIF ; _external_sensor | 572 ENDIF ; _external_sensor_eccr |
| 569 | 573 |
| 570 | 574 |
| 571 ;----------------------------------------------------------------------------- | 575 ;----------------------------------------------------------------------------- |
| 572 ; dynamic Title - print Setpoint | 576 ; dynamic Title - print Setpoint |
| 573 ; | 577 ; |
| 580 ; | 584 ; |
| 581 do_switch_sp: | 585 do_switch_sp: |
| 582 decf menu_pos_cur,W ; 1-5 -> 0-4 | 586 decf menu_pos_cur,W ; 1-5 -> 0-4 |
| 583 lfsr FSR1,opt_setpoint_cbar ; load base address | 587 lfsr FSR1,opt_setpoint_cbar ; load base address |
| 584 movff PLUSW1,char_I_const_ppO2 ; set selected setpoint | 588 movff PLUSW1,char_I_const_ppO2 ; set selected setpoint |
| 585 IFDEF _external_sensor | 589 IFDEF _external_sensor_eccr |
| 586 call transmit_setpoint ; transmit current setpoint from WREG (in cbar) to external electronics | 590 call transmit_setpoint ; transmit current setpoint from WREG (in cbar) to external electronics |
| 587 ENDIF | 591 ENDIF |
| 588 bcf warn_det_sensors_lost ; clear fallback condition (revoke all sensors lost warning) | 592 bcf warn_det_sensors_lost ; clear fallback condition (revoke all sensors lost warning) |
| 589 clrf dive_ccr_mode ; switch to fixed SP | 593 clrf dive_ccr_mode ; switch to fixed SP |
| 590 bra do_switch_sp_com ; continue with common part | 594 bra do_switch_sp_com ; continue with common part |
| 621 bsf request_gas_change ; initiate reconfiguration to loop mode on last diluent | 625 bsf request_gas_change ; initiate reconfiguration to loop mode on last diluent |
| 622 | 626 |
| 623 bra do_exit_divemode_menu ; continue exiting the menu | 627 bra do_exit_divemode_menu ; continue exiting the menu |
| 624 | 628 |
| 625 | 629 |
| 626 IFDEF _external_sensor | 630 IFDEF _external_sensor_eccr |
| 627 | 631 |
| 628 | 632 |
| 629 ;----------------------------------------------------------------------------- | 633 ;----------------------------------------------------------------------------- |
| 630 ; Return to Sub Menu toggle Sensor Usage / select Sensors from Menu Action | 634 ; Return to Sub Menu toggle Sensor Usage / select Sensors from Menu Action |
| 631 ; | 635 ; |
| 674 movlw .1 ; switch to sensor (0: fixed/ calculated SP, 1: Sensor, 2: AutoSP) | 678 movlw .1 ; switch to sensor (0: fixed/ calculated SP, 1: Sensor, 2: AutoSP) |
| 675 movwf dive_ccr_mode ; ... | 679 movwf dive_ccr_mode ; ... |
| 676 | 680 |
| 677 ; check for external HUD/ppO2 Monitor | 681 ; check for external HUD/ppO2 Monitor |
| 678 btfss ext_input_optical ; do we have an optical input? | 682 btfss ext_input_optical ; do we have an optical input? |
| 683 bra do_switch_sp_com ; NO - continue with common part | |
| 684 btfss ext_s8_full_digital ; are we in external S8 full digital mode? | |
| 679 bra do_switch_sp_com ; NO - continue with common part | 685 bra do_switch_sp_com ; NO - continue with common part |
| 680 btfsc sensor1_active ; YES - process flags from HUD/ppO2 Monitor | 686 btfsc sensor1_active ; YES - process flags from HUD/ppO2 Monitor |
| 681 bsf use_O2_sensor1 ; - ... | 687 bsf use_O2_sensor1 ; - ... |
| 682 btfsc sensor2_active ; - ... | 688 btfsc sensor2_active ; - ... |
| 683 bsf use_O2_sensor2 ; - ... | 689 bsf use_O2_sensor2 ; - ... |
| 698 btg use_O2_sensor2 ; YES - toggle sensor 2 state | 704 btg use_O2_sensor2 ; YES - toggle sensor 2 state |
| 699 dcfsnz WREG ; cursor on item sensor 3 ? | 705 dcfsnz WREG ; cursor on item sensor 3 ? |
| 700 btg use_O2_sensor3 ; YES - toggle sensor 3 state | 706 btg use_O2_sensor3 ; YES - toggle sensor 3 state |
| 701 bra do_return_divemode_sensor ; back to same menu | 707 bra do_return_divemode_sensor ; back to same menu |
| 702 | 708 |
| 703 ENDIF ; _external_sensor | 709 ENDIF ; _external_sensor_eccr |
| 704 ENDIF ; _ccr_pscr | 710 ENDIF ; _ccr_pscr |
| 705 | 711 |
| 706 | 712 |
| 707 IFDEF _cave_mode | 713 IFDEF _cave_mode |
| 708 | 714 |
