annotate src/divemenu_tree.asm @ 600:cb59872ad53d

fix typo
author heinrichsweikamp
date Sun, 12 Aug 2018 18:18:41 +0200
parents 6636cbe64c6d
children ca4556fb60b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
3 ; File divemenu_tree.asm REFACTORED VERSION V2.98
0
heinrichsweikamp
parents:
diff changeset
4 ;
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 249
diff changeset
5 ; OSTC dive mode menu
0
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2013-02-02 : [mH] Made out of menu_tree.asm
heinrichsweikamp
parents:
diff changeset
11
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
12 #include "hwos.inc" ; Mandatory header
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
13 #include "menu_processor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
14 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
15 #include "tft_outputs.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
16 #include "customview.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
17 #include "strings.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
18 #include "calibrate.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
19
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
20 extern timeout_divemode_menu2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
21 extern diveloop_loop4
0
heinrichsweikamp
parents:
diff changeset
22
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
23
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
24 divegui CODE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
25
0
heinrichsweikamp
parents:
diff changeset
26 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
27 ; Main Menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
28 global do_main_divemenu
0
heinrichsweikamp
parents:
diff changeset
29 do_main_divemenu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
30 call menu_processor_reset ; restart from first icon
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
31 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
32 movwf menupos1 ; set to first option in divemode menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
33 btfsc FLAG_ccr_mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
34 bra main_divemenu_loop ; goto CCR / pSCR Menu menu
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
35 btfsc FLAG_pscr_mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
36 bra main_divemenu_loop ; goto CCR / pSCR Menu menu
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
37
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
38 main_divemenu_OC:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
39 bcf ccr_diluent_setup
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
40 bcf is_bailout_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
41
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
42 MENU_BEGIN tMainMenu, .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
43 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
44 MENU_CALL tDivemenu_ResetAvg, do_reset_average
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
45 MENU_CALL tDivemenu_ToggleGF, do_toggle_gf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
46 MENU_CALL tDivemenu_Marker, do_set_marker
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
47 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
48 MENU_END
0
heinrichsweikamp
parents:
diff changeset
49
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
50 main_divemenu_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
51 bsf ccr_diluent_setup ; default to operations on diluents
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
52 bcf is_bailout_menu ; default to none-bailout menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
53 btfsc FLAG_pscr_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
54 bra main_divemenu_pscr ; PSCR Menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
55
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
56 MENU_BEGIN tMainMenu, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
57 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
58 MENU_CALL tDivemenu_Setpoint, do_divemode_splist
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
59 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
60 MENU_CALL tDivemenu_ResetAvg, do_reset_average
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
61 MENU_CALL tDivemenu_ToggleGF, do_toggle_gf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
62 MENU_CALL tExit, do_exit_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
63 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
64
485
18e047102e49 3.14 BETA release
heinrichsweikamp
parents: 437
diff changeset
65 main_divemenu_pscr:
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
66 btfsc analog_o2_input ; do we have an analog input?
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
67 bra main_divemenu_pscr_sensors ; YES
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
68 btfsc s8_digital ; do we have a digital input?
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
69 bra main_divemenu_pscr_sensors ; YES
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
70 btfsc optical_input ; do we have an optical input?
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
71 bra main_divemenu_pscr_sensors ; YES
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
72
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
73 main_divemenu_pscr_no_sensors:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
74 MENU_BEGIN tMainMenu, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
75 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
76 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
77 MENU_CALL tDivemenu_ResetAvg, do_reset_average
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
78 MENU_CALL tDivemenu_ToggleGF, do_toggle_gf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
79 MENU_CALL tDivemenu_Marker, do_set_marker
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
80 MENU_CALL tExit, do_exit_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
81 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
82
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
83 main_divemenu_pscr_sensors:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
84 MENU_BEGIN tMainMenu, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
85 MENU_CALL tDiveBailout, do_divemode_gaslist_bail
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
86 MENU_CALL tCCRSensor, do_divemode_setpoint_pscr
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
87 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
88 MENU_CALL tDivemenu_ResetAvg, do_reset_average
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
89 MENU_CALL tDivemenu_ToggleGF, do_toggle_gf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
90 MENU_CALL tExit, do_exit_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
91 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
92
0
heinrichsweikamp
parents:
diff changeset
93
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
94 do_toggle_gf:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
95 movff char_I_deco_model,WREG ; 0 = ZH-L16, 1 = ZH-L16-GF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
96 decfsz WREG,W ; Toggle GF only in GF modes - in GF mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
97 bra do_main_divemenu ; No, do nothing and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
98 TSTOSS opt_enable_aGF ; =1: aGF can be selected underwater
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
99 bra do_main_divemenu ; No, do nothing and return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
100 movlw .4 ; Set customview to 5 (GF informations)
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
101 movwf menupos3 ; Customview to come-1
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
102 bsf toggle_customview ; Set flag, the customview will be toggled very soon now...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
103 movlw .1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
104 movwf menupos1 ; Set to first option in divemode menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
105
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
106 MENU_BEGIN tDivemenu_ToggleGF, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
107 MENU_CALL tDivemenu_ToggleGF, do_togglegf
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
108 MENU_CALL tBack, do_main_divemenu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
109 MENU_END
0
heinrichsweikamp
parents:
diff changeset
110
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
111 do_togglegf:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
112 ;TSTOSS opt_enable_aGF ; =1: aGF can be selected underwater ; check is now done before entering menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
113 ;bra do_exit_divemode_menu ; continue with exiting menu code
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
114 bsf toggle_gf ; Set flag...
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
115 bra do_exit_divemode_menu ; continue with exiting menu code
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
116
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
117
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
118 do_set_marker:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
119 bsf FLAG_set_marker ; set flag...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
120 bra do_exit_divemode_menu ; ... and exit
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
121
53
2825f1d2262f NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents: 0
diff changeset
122
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
123 do_reset_average:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
124 bsf reset_average_depth ; Set Flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
125 bra do_exit_divemode_menu ; continue with exiting menu code
0
heinrichsweikamp
parents:
diff changeset
126
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
127
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
128 do_switch_sensor: ; entry point when coming from switch to sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
129 movlw .1 ; Switch to Sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
130 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
131 ; enable all sensors
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
132 bsf use_O2_sensor1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
133 bsf use_O2_sensor2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
134 bsf use_O2_sensor3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
135 bra do_switch_sp_com ; continue with common part
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
136
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
137 do_switch_sp: ; entry point when coming from manual setpoint selection (CCR)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
138 decf menupos1,W ; 1-5 -> 0-4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
139 lfsr FSR1,char_I_setpoint_cbar
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
140 movff PLUSW1,char_I_const_ppO2 ; setup fixed setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
141 movff char_I_const_ppO2,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
142 call transmit_setpoint ; transmit current setpoint from WREG (in cbar) to external electronics
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
143 bcf setpoint_fallback ; clear fallback condition (stops fallback warning)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
144 clrf WREG ; Switch to fixed SP
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
145 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
146 bra do_switch_sp_com
0
heinrichsweikamp
parents:
diff changeset
147
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
148 do_switch_sp_calc: ; entry point when coming from switch to calculated ppO2 (pSCR)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
149 bcf setpoint_fallback ; clear fallback condition (stops fallback warning)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
150 clrf WREG ; Switch to fixed SP
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
151 movff WREG,opt_ccr_mode ; =0: Fixed SP (CCR) / calculated (pSCR), =1: Sensor, =2: Auto SP
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
152 movff WREG,char_I_const_ppO2 ; set setpoint to 0, this forces deco engine to take the computed ppO2
97
53a99a2dc6a1 CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents: 53
diff changeset
153
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
154 do_switch_sp_com: ; merge point to common part
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
155 bsf event_occured ; set global event byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
156 bsf setpoint_changed ; set flag (for profile)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
157
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
158 ; Clear some flags in case we were in bailout before...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
159 bcf is_bailout ; end bailout mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
160 ;bcf is_bailout_menu ; not needed
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
161 bcf better_gas_available ; =1: A better gas is available and a gas change is advised in divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
162 bcf blinking_better_gas ; clear blinking flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
163 call customview_mask ; update customview mask to (eventually) rewrite ppO2(Dil): to ppO2:
0
heinrichsweikamp
parents:
diff changeset
164
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
165 bsf FLAG_back_to_loop ; indicate that it is a switchback from OC bailout to CCR/pSCR loop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
166 bsf divemode_gaschange ; initiate reconfiguration to loop mode on last diluent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
167
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
168 bra do_exit_divemode_menu ; continue with exiting menu code
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
169
0
heinrichsweikamp
parents:
diff changeset
170
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
171 do_divemode_gaslist_bail: ; entry point from CCR/pSCR to bailout to OC gases
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
172 bcf ccr_diluent_setup ; switch to OC gases
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
173 bsf is_bailout_menu ; flag it is a bailout action
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
174 do_divemode_gaslist: ; entry point for switching: OC -> gases, loop -> diluents
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
175 btfsc is_bailout ; in bailout mode?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
176 bcf ccr_diluent_setup ; yes - for safety reasons, redirect to OC (bailout) gases
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
177 do_divemode_gaslist_com:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
178 bsf short_gas_decriptions
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
179 movlw .1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
180 movwf menupos1 ; Set to first option in divemode menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
181 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
182 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
183 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
184 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
185 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
186 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
187 MENU_CALL tMore, do_divemode_gaslist_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
188 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
189
0
heinrichsweikamp
parents:
diff changeset
190
heinrichsweikamp
parents:
diff changeset
191 do_divemode_gaslist_more:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
192 movlw .1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
193 movwf menupos1 ; Set to first option in divemode menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
194
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
195 movff char_I_O2_ratio,gas6_O2_ratio ; initialize gas6 with currently breathed gas - O2 ratio
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
196 movff char_I_He_ratio,gas6_He_ratio ; initialize gas6 with currently breathed gas - He ratio
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
197
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
198 do_divemode_gaslist_more_common:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
199 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
200 MENU_CALL tO2Plus, do_dive_pO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
201 MENU_CALL tO2Minus, do_dive_mO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
202 MENU_CALL tHePlus, do_dive_pHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
203 MENU_CALL tHeMinus, do_dive_mHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
204 MENU_DYNAMIC gaslist_strcat_gas6, do_switch_gas6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
205 MENU_CALL tDivemenu_LostGas, do_lost_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
206 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
207
403
6e60012bb3fc NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents: 401
diff changeset
208
6e60012bb3fc NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents: 401
diff changeset
209 do_lost_gas:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
210 movlw .1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
211 movwf menupos1 ; Set to first option in divemode menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
212 do_lost_gas_common:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
213 bsf short_gas_decriptions
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
214 MENU_BEGIN tDivemenu_LostGas, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
215 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
216 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
217 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
218 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
219 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
220 MENU_CALL tExit, do_exit_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
221 MENU_END
0
heinrichsweikamp
parents:
diff changeset
222
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
223
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
224 do_switch_gas6:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
225 movlw .6 ; gas 6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
226 movwf menupos1 ; transfer register for selected gas towards gas_switched_common:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
227 bsf gas6_changed ; set flag for profile recording
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
228 ;bra do_switch_gas ; continue with common gas-switched code
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
229
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
230 do_switch_gas:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
231 bsf divemode_gaschange ; Set flag, will also trigger restart of deco_engine
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
232 btfsc is_bailout_menu ; Bailout confirmed?
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
233 bsf is_bailout ; begin bailout mode
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
234 call customview_mask ; update custom view mask to (eventually) rewrite ppO2(Dil): to ppO2:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
235 ;bra do_exit_divemode_menu ; continue with exiting menu code
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
236
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
237 do_exit_divemode_menu:
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
238 call timeout_divemode_menu2
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
239 clrf STKPTR
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
240 goto diveloop_loop4
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
241
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
242
403
6e60012bb3fc NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents: 401
diff changeset
243 do_toggle_active:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
244 extern restart_deco_engine_wo_ceiling
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
245 call restart_deco_engine_wo_ceiling
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
246 movlw .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
247 btfsc ccr_diluent_setup ; diluents?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
248 addwf menupos1,F ; yes 1-5 -> 6-10
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
249 decf menupos1,W ; -> 0-4 for gases / 5-9 for diluents
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
250 lfsr FSR1,opt_gas_type+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
251 movff PLUSW1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
252 tstfsz lo ; Already disabled?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
253 bra do_toggle_active2 ; No, disable now!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
254 lfsr FSR1,opt_gas_type_backup+0 ; copy opt_gas_type_backup+W back to opt_gas_type+W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
255 movff PLUSW1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
256 lfsr FSR1,opt_gas_type+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
257 movff lo,PLUSW1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
258 lfsr FSR1,opt_OC_bail_gas_change_backup+0 ; copy opt_OC_bail_gas_change_backup+W back to opt_OC_bail_gas_change+W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
259 movff PLUSW1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
260 lfsr FSR1,opt_OC_bail_gas_change+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
261 movff lo,PLUSW1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
262 bra do_toggle_active3
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
263 do_toggle_active2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
264 clrf PLUSW1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
265 lfsr FSR1,opt_OC_bail_gas_change+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
266 clrf PLUSW1 ; also delete change depth here to have the menu updated immediately
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
267 do_toggle_active3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
268 movlw .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
269 btfsc ccr_diluent_setup ; use OC gases?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
270 subwf menupos1,F ; back to 1-5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
271 bra do_lost_gas ; return to list and show updated result
511
7db10ebae205 BUGFIX: Lost Diluent now possible in CCR and PSCR mode
heinrichsweikamp
parents: 502
diff changeset
272
0
heinrichsweikamp
parents:
diff changeset
273
heinrichsweikamp
parents:
diff changeset
274 do_dive_pO2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
275 banksel gas6_O2_ratio
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
276 incf gas6_O2_ratio,F ; O2++
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
277 movf gas6_He_ratio,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
278 addwf gas6_O2_ratio,W
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
279 movwf gas6_temp
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
280 movlw .101
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
281 cpfslt gas6_temp ; O2 + He < 101 ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
282 decf gas6_O2_ratio,F ; O2-- (unchanged)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
283 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
284 bra do_divemode_gaslist_more_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
285
0
heinrichsweikamp
parents:
diff changeset
286 do_dive_mO2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
287 banksel gas6_O2_ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
288 decf gas6_O2_ratio,F ; O2--
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
289 movlw gaslist_min_o2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
290 cpfslt gas6_O2_ratio ; O2 < minimum allowed %O2?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
291 bra do_dive_mO2_done ; NO
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
292 movlw gaslist_min_o2 ; YES - restore minimum
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
293 movwf gas6_O2_ratio
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
294 do_dive_mO2_done:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
295 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
296 bra do_divemode_gaslist_more_common
0
heinrichsweikamp
parents:
diff changeset
297
heinrichsweikamp
parents:
diff changeset
298 do_dive_pHe:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
299 banksel gas6_O2_ratio
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
300 incf gas6_He_ratio,F ; He++
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
301 movf gas6_He_ratio,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
302 addwf gas6_O2_ratio,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
303 movwf lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
304 movlw .101
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
305 cpfslt lo ; O2 + He < 101 ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
306 decf gas6_He_ratio,F ; Yes, He-- (Unchanged)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
307 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
308 bra do_divemode_gaslist_more_common
0
heinrichsweikamp
parents:
diff changeset
309
heinrichsweikamp
parents:
diff changeset
310 do_dive_mHe:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
311 banksel gas6_O2_ratio
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
312 decf gas6_He_ratio,F ; He--
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
313 bnn do_dive_mHe_done ; H2 < 0?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
314 clrf gas6_He_ratio ; YES - reset to 0
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
315 do_dive_mHe_done:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
316 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
317 bra do_divemode_gaslist_more_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
318
0
heinrichsweikamp
parents:
diff changeset
319
heinrichsweikamp
parents:
diff changeset
320 do_divemode_splist:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
321 bsf short_gas_decriptions
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
322 movlw .1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
323 movwf menupos1 ; set to first option in divemode menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
324
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
325 do_divemode_splist_common:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
326 btfsc analog_o2_input ; do we have an analog input?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
327 bra do_divemode_splist_sensor ; YES
583
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
328 btfsc s8_digital ; do we have a digital input?
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
329 bra do_divemode_splist_sensor ; YES
6636cbe64c6d optical input work
heinrichsweikamp
parents: 582
diff changeset
330 btfsc optical_input ; do we have an optical input?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
331 bra do_divemode_splist_sensor ; YES
0
heinrichsweikamp
parents:
diff changeset
332
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
333 do_divemode_splist_no_sensor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
334 MENU_BEGIN tGaslist, .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
335 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
336 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
337 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
338 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
339 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
340 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
341
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
342 do_divemode_splist_sensor:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
343 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
344 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
345 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
346 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
347 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
348 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
349 MENU_CALL tCCRSensor, do_divemode_sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
350 MENU_END
249
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 195
diff changeset
351
94bf757690cf ignore sensor for non-sensor hardware
heinrichsweikamp
parents: 195
diff changeset
352
0
heinrichsweikamp
parents:
diff changeset
353 do_divemode_sensor:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
354 clrf menupos3 ; show customview 1 (HUD Data)
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
355 bsf toggle_customview
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
356 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
357 movwf menupos1 ; Set to 1st option: use sensors
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
358
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
359 do_return_divemode_sensor:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
360 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
361 MENU_CALL tDivemenu_UseSensor, do_switch_sensor
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
362 MENU_CALL tBack, do_divemode_splist
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
363 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
364 MENU_CALL tDiveHudMask1, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
365 MENU_CALL tDiveHudMask2, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
366 MENU_CALL tDiveHudMask3, do_toggle_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
367 MENU_END
0
heinrichsweikamp
parents:
diff changeset
368
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
369 do_divemode_setpoint_pscr:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
370 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
371 movwf menupos1 ; Set to 1st option: use calculated ppO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
372 MENU_BEGIN tGaslist, .6
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
373 MENU_CALL tCalculated, do_switch_sp_calc
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
374 MENU_CALL tDivemenu_UseSensor, do_switch_sensor
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
375 MENU_CALL tExit, do_exit_divemode_menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
376 MENU_CALL tDiveHudMask1, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
377 MENU_CALL tDiveHudMask2, do_toggle_sensor
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
378 MENU_CALL tDiveHudMask3, do_toggle_sensor
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
379 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
380
0
heinrichsweikamp
parents:
diff changeset
381
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
382 do_toggle_sensor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
383 movff menupos1,lo ; backup position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
384 decf menupos1,f ; 4, 5, 6 -> 3, 4, 5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
385 decf menupos1,f ; 3, 4, 5 -> 2, 3, 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
386 decf menupos1,f ; 2, 3, 4 -> 1, 2, 3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
387 dcfsnz menupos1 ; 1, 2, 3 -> 0, 1, 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
388 btg use_O2_sensor1 ; =
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
389 dcfsnz menupos1 ; 0, 1, 2 -> -1, 0, 1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
390 btg use_O2_sensor2 ; =
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
391 dcfsnz menupos1 ; -1,0, 1 -> -2,-1, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
392 btg use_O2_sensor3 ; =
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
393 movff lo,menupos1 ; restore position
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
394 bra do_return_divemode_sensor
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 541
diff changeset
395
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 579
diff changeset
396 END