Mercurial > public > hwos_code
annotate src/divemenu_tree.asm @ 454:0ef84436df32
minor: fix some alignments for OSTC cR
| author | heinrichsweikamp |
|---|---|
| date | Tue, 27 Sep 2016 16:03:31 +0200 |
| parents | 23b58c4bc6aa |
| children | 18e047102e49 |
| rev | line source |
|---|---|
| 0 | 1 ;============================================================================= |
| 2 ; | |
| 3 ; File divemenu_tree.asm | |
| 4 ; | |
| 275 | 5 ; OSTC dive mode menu |
| 0 | 6 ; |
| 7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
| 8 ;============================================================================= | |
| 9 ; HISTORY | |
| 10 ; 2013-02-02 : [mH] Made out of menu_tree.asm | |
| 11 | |
| 275 | 12 #include "hwos.inc" ; Mandatory header |
| 0 | 13 #include "menu_processor.inc" |
| 14 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c | |
| 15 #include "tft_outputs.inc" | |
| 16 #include "customview.inc" | |
| 17 #include "strings.inc" | |
| 195 | 18 #include "calibrate.inc" |
| 0 | 19 |
| 20 divegui CODE | |
| 21 ;============================================================================= | |
| 22 ; Main Menu | |
| 23 global do_main_divemenu | |
| 24 do_main_divemenu: | |
| 25 call menu_processor_reset ; restart from first icon. | |
| 26 | |
| 27 do_continue_main_divemenu: | |
| 28 call menu_processor_pop ; drop exit line. | |
| 29 call menu_processor_pop ; drop exit line. | |
| 30 | |
| 31 btfsc FLAG_ccr_mode | |
| 32 bra main_divemenu_ccr ; CCR Menu | |
| 33 | |
| 34 bcf ccr_diluent_setup ; For OC gases | |
| 35 bcf is_bailout_menu | |
| 36 movlw .1 | |
| 37 movwf menupos ; Set to first option in divemode menu | |
|
401
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
38 MENU_BEGIN tMainMenu, .5 |
| 0 | 39 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist |
| 437 | 40 MENU_CALL tDivemenu_ResetAvg, do_divemode_resetavg |
| 0 | 41 MENU_CALL tDivemenu_ToggleGF, do_divemode_togglegf |
|
401
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
42 MENU_CALL tDivemenu_Marker, do_set_marker |
| 0 | 43 MENU_CALL tExit, do_exit_divemode_menu |
| 44 MENU_END | |
| 45 | |
|
401
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
46 do_set_marker: |
|
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
47 movlw d'6' ; Type of Alarm (Manual Marker) |
|
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
48 movwf AlarmType ; Copy to Alarm Register |
|
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
49 bsf event_occured ; Set Event Flag |
|
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
50 bra do_exit_divemode_menu ; And exit |
|
7be43d886bb1
Logbook marker can be set in dive mode menu (OC only)
heinrichsweikamp
parents:
377
diff
changeset
|
51 |
| 0 | 52 main_divemenu_ccr: |
| 53 bsf ccr_diluent_setup ; For diluents | |
| 54 movlw .1 | |
| 55 movwf menupos ; Set to first option in divemode menu | |
| 56 MENU_BEGIN tMainMenu, .6 | |
| 57 MENU_CALL tDiveBailout, do_divemode_gaslist_bail | |
| 58 MENU_CALL tDivemenu_Setpoint, do_divemode_splist | |
| 59 MENU_CALL tDivemenu_Gaslist, do_divemode_gaslist | |
| 437 | 60 MENU_CALL tDivemenu_ResetAvg, do_divemode_resetavg |
| 0 | 61 MENU_CALL tDivemenu_ToggleGF, do_divemode_togglegf |
| 62 MENU_CALL tExit, do_exit_divemode_menu | |
| 63 MENU_END | |
| 64 | |
| 65 | |
| 66 do_togglegf: | |
| 67 TSTOSS opt_enable_aGF ; =1: aGF can be selected underwater | |
| 68 bra do_exit_divemode_menu ; exit | |
| 69 bsf toggle_gf ; Set flag... | |
| 70 bra do_exit_divemode_menu ; ...and exit | |
| 71 | |
| 72 do_switch_to_sensor: | |
| 73 movlw .1 ; Switch to Sensor | |
| 426 | 74 movff WREG,opt_ccr_mode ; =0: Fixed SP, =1: Sensor, =2: Auto SP |
| 192 | 75 bsf voting_logic_sensor1 |
| 76 bsf voting_logic_sensor2 | |
| 77 bsf voting_logic_sensor3 | |
| 193 | 78 extern divemode_setup_sensor_values |
| 79 call divemode_setup_sensor_values ; Setup sensor values | |
| 195 | 80 call check_sensors ; Check O2 sensor thresholds for fallback |
| 0 | 81 bra do_switch_sp2 |
| 82 | |
| 437 | 83 do_divemode_resetavg: |
| 0 | 84 bsf reset_average_depth ; Set Flag |
| 85 bra do_exit_divemode_menu ; And exit | |
| 86 | |
|
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
0
diff
changeset
|
87 |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
0
diff
changeset
|
88 do_switch_gas6: |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
0
diff
changeset
|
89 movlw .6 |
|
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
0
diff
changeset
|
90 movwf active_gas ; Gas6 selected |
| 377 | 91 movff WREG,char_I_current_gas ; for p2_deco.c |
|
53
2825f1d2262f
NEW: Dynamic Gaslist in OC mode (Divemode, Customview 7)
heinrichsweikamp
parents:
0
diff
changeset
|
92 bra do_switch_gasX |
| 0 | 93 extern diveloop_loop4 |
| 94 extern timeout_divemode_menu2 | |
| 95 do_switch_gas: | |
| 96 bsf divemode_gaschange ; Set flag | |
| 97 do_switch_gasX: | |
| 98 btfsc is_bailout_menu ; Bailout confirmed? | |
| 99 bsf is_bailout ; =1: Bailout | |
| 100 do_exit_divemode_menu: | |
| 101 call timeout_divemode_menu2 | |
| 102 clrf STKPTR | |
| 103 goto diveloop_loop4 | |
| 104 | |
| 105 do_switch_sp: | |
| 106 decf menupos,W ; 1-5 -> 0-4 | |
| 107 lfsr FSR1,char_I_setpoint_cbar | |
| 108 movff PLUSW1,char_I_const_ppO2; Setup fixed Setpoint | |
|
352
5c6da9fa5cb0
add setpoint change to first sample in CCR mode
heinrichsweikamp
parents:
275
diff
changeset
|
109 movff char_I_const_ppO2,WREG |
|
5c6da9fa5cb0
add setpoint change to first sample in CCR mode
heinrichsweikamp
parents:
275
diff
changeset
|
110 call transmit_setpoint ; Transmit current setpoint from WREG (in cbar) to external electronics |
| 0 | 111 bsf setpoint_changed ; Set flag (For profile) |
|
99
87cc1adfe4da
show event "bailout" in the internal logbook
heinrichsweikamp
parents:
97
diff
changeset
|
112 bsf event_occured ; Set global event byte |
| 0 | 113 |
|
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
53
diff
changeset
|
114 ; Reconfigure last diluent |
|
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
53
diff
changeset
|
115 extern setup_dil_registers |
|
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
53
diff
changeset
|
116 bcf is_bailout ; =1: Bailout |
|
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
53
diff
changeset
|
117 movff active_diluent,WREG ; As a backup when switching back from Bailout to CCR |
|
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
53
diff
changeset
|
118 decf WREG ; 0-4 |
|
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
53
diff
changeset
|
119 call setup_dil_registers ; With WREG=Gas 0-4 |
|
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
53
diff
changeset
|
120 |
| 0 | 121 clrf WREG ; Switch to fixed SP |
| 426 | 122 movff WREG,opt_ccr_mode ; =0: Fixed SP, =1: Sensor, =2: Auto SP |
| 0 | 123 clrf WREG |
| 124 movff WREG,char_O_deco_status ; Restart decoplan computation | |
| 125 | |
| 126 do_switch_sp2: | |
| 127 ; Clear some flags in case we were in bailout before... | |
| 128 bcf is_bailout ; =1: Bailout | |
| 129 bcf is_bailout_menu ; | |
| 130 bcf better_gas_available ;=1: A better gas is available and a gas change is advised in divemode | |
| 131 bcf blinking_better_gas ; Clear blinking flag | |
| 132 bra do_exit_divemode_menu ; And exit | |
| 133 | |
| 134 do_divemode_gaslist_bail: | |
| 135 bcf ccr_diluent_setup ; For OC gases | |
| 136 bsf is_bailout_menu ; =1: Bailout | |
| 137 do_divemode_gaslist: | |
| 138 btfsc is_bailout ; In Bailout case? | |
| 139 bcf ccr_diluent_setup ; Yes, use OC gases | |
| 140 bsf short_gas_decriptions | |
| 141 movlw .1 | |
| 142 movwf menupos ; Set to first option in divemode menu | |
| 143 MENU_BEGIN tGaslist, .6 | |
| 144 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas | |
| 145 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas | |
| 146 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas | |
| 147 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas | |
| 148 MENU_DYNAMIC gaslist_strcat_gas_mod, do_switch_gas | |
| 149 MENU_CALL tMore, do_divemode_gaslist_more0 | |
| 150 MENU_END | |
| 151 | |
| 152 do_divemode_gaslist_more0: | |
| 153 movlw .1 | |
| 154 movwf menupos ; Set to first option in divemode menu | |
| 155 do_divemode_gaslist_more: | |
| 156 MENU_BEGIN tGaslist, .6 | |
| 157 MENU_CALL tO2Plus, do_dive_pO2 | |
| 158 MENU_CALL tO2Minus, do_dive_mO2 | |
| 159 MENU_CALL tHePlus, do_dive_pHe | |
| 160 MENU_CALL tHeMinus, do_dive_mHe | |
|
403
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
161 MENU_DYNAMIC gaslist_strcat_gasx, do_switch_gas6 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
162 MENU_CALL tDivemenu_LostGas, do_lost_gas |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
163 MENU_END |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
164 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
165 do_lost_gas: |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
166 movlw .1 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
167 movwf menupos ; Set to first option in divemode menu |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
168 do_lost_gas0: |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
169 bcf ccr_diluent_setup ; use OC gases |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
170 bsf is_bailout_menu ; =1: Bailout |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
171 bsf short_gas_decriptions |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
172 MENU_BEGIN tDivemenu_LostGas, .6 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
173 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
174 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
175 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
176 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
177 MENU_DYNAMIC gaslist_strcat_gas_mod, do_toggle_active ; Toggle the gas (in)active |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
178 MENU_CALL tExit, do_exit_divemode_menu |
| 0 | 179 MENU_END |
| 180 | |
|
403
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
181 do_toggle_active: |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
182 decf menupos,W ; 1-5 -> 0-4 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
183 lfsr FSR1,opt_gas_type+0 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
184 movff PLUSW1,lo |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
185 tstfsz lo ; Already disabled? |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
186 bra do_toggle_active2 ; No, disable now! |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
187 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
188 ; Copy opt_gas_type_backup+W back to opt_gas_type+W |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
189 decf menupos,W ; 1-5 -> 0-4 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
190 lfsr FSR1,opt_gas_type_backup+0 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
191 movff PLUSW1,lo |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
192 decf menupos,W ; 1-5 -> 0-4 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
193 lfsr FSR1,opt_gas_type+0 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
194 movff lo,PLUSW1 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
195 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
196 ; Copy opt_OC_bail_gas_change_backup+W back to opt_OC_bail_gas_change+W |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
197 decf menupos,W ; 1-5 -> 0-4 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
198 lfsr FSR1,opt_OC_bail_gas_change_backup+0 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
199 movff PLUSW1,lo |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
200 decf menupos,W ; 1-5 -> 0-4 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
201 lfsr FSR1,opt_OC_bail_gas_change+0 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
202 movff lo,PLUSW1 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
203 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
204 bra do_lost_gas0 ; Return to list and show updated result |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
205 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
206 do_toggle_active2: |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
207 clrf PLUSW1 ; 0=Disabled, 1=First, 2=Travel, 3=Deco |
|
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 ; Also delete change depth here to have the menu updated immediately |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
210 lfsr FSR1,opt_OC_bail_gas_change+0 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
211 clrf PLUSW1 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
212 |
|
6e60012bb3fc
NEW: "Lost Gas" feature allows disabling gases during the dive
heinrichsweikamp
parents:
401
diff
changeset
|
213 bra do_lost_gas0 ; Return to list and show updated result |
| 0 | 214 |
| 215 do_dive_pO2: | |
| 216 banksel char_I_O2_ratio | |
| 217 incf char_I_O2_ratio,F ; O2++ | |
| 218 movf char_I_He_ratio,W | |
| 219 addwf char_I_O2_ratio,W | |
| 220 movwf temp_bankx400 | |
| 221 movlw .101 | |
| 222 cpfslt temp_bankx400 ; O2+He<101? | |
| 223 decf char_I_O2_ratio,F ; O2-- (Unchanged) | |
| 224 ; bra do_divemode_gaslist_more_common | |
| 225 do_divemode_gaslist_more_common: | |
|
181
32c17df38423
BUGFIX: END/EAD updated when adjusting current gas during the dive
heinrichsweikamp
parents:
99
diff
changeset
|
226 movf char_I_O2_ratio,W ; Add O2... |
|
32c17df38423
BUGFIX: END/EAD updated when adjusting current gas during the dive
heinrichsweikamp
parents:
99
diff
changeset
|
227 addwf char_I_He_ratio,W ; ...and He... |
|
32c17df38423
BUGFIX: END/EAD updated when adjusting current gas during the dive
heinrichsweikamp
parents:
99
diff
changeset
|
228 sublw .100 ; ...subtract both from 100 |
|
32c17df38423
BUGFIX: END/EAD updated when adjusting current gas during the dive
heinrichsweikamp
parents:
99
diff
changeset
|
229 movwf char_I_N2_ratio ; -> N2! |
| 0 | 230 banksel common |
| 231 bsf gas6_changed ; Set flag | |
| 232 bra do_divemode_gaslist_more | |
| 233 | |
| 234 do_dive_mO2: | |
| 235 banksel char_I_O2_ratio | |
| 236 decf char_I_O2_ratio,F ; O2-- | |
| 237 movlw gaslist_min_o2 | |
| 238 cpfslt char_I_O2_ratio | |
| 239 bra do_divemode_gaslist_more_common | |
| 240 movlw gaslist_min_o2 | |
| 241 movwf char_I_O2_ratio | |
| 242 bra do_divemode_gaslist_more_common | |
| 243 | |
| 244 | |
| 245 do_dive_pHe: | |
| 246 banksel char_I_O2_ratio | |
| 247 incf char_I_He_ratio,F ; He++ | |
| 248 movf char_I_He_ratio,W | |
| 249 addwf char_I_O2_ratio,W | |
| 250 movwf lo | |
| 251 movlw .101 | |
| 252 cpfslt lo ; O2+He<101? | |
| 253 decf char_I_He_ratio,F ; Yes, He-- (Unchanged) | |
| 254 bra do_divemode_gaslist_more_common | |
| 255 | |
| 256 do_dive_mHe: | |
| 257 banksel char_I_O2_ratio | |
| 258 decf char_I_He_ratio,F ; He-- | |
| 259 bnn do_divemode_gaslist_more_common | |
| 260 clrf char_I_He_ratio | |
| 261 bra do_divemode_gaslist_more_common | |
| 262 | |
| 263 do_divemode_splist: | |
| 264 bsf short_gas_decriptions | |
| 265 movlw .1 | |
| 266 movwf menupos ; Set to first option in divemode menu | |
| 249 | 267 movf hardware_flag,W |
| 268 sublw 0x11 ; 2 with BLE | |
| 269 btfsc STATUS,Z | |
| 270 bra do_divemode_splist2 | |
| 0 | 271 MENU_BEGIN tGaslist, .6 |
| 272 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 273 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 274 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 275 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 276 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 277 MENU_CALL tCCRSensor, do_divemode_sensor | |
| 278 MENU_END | |
| 279 | |
| 249 | 280 do_divemode_splist2: |
| 281 MENU_BEGIN tGaslist, .5 | |
| 282 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 283 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 284 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 285 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 286 MENU_DYNAMIC gaslist_strcat_setpoint, do_switch_sp | |
| 287 MENU_END | |
| 288 | |
| 289 | |
| 0 | 290 do_divemode_sensor: |
| 291 ; Set customview to 1 (HUD Data) | |
| 292 clrf menupos3 ; customview to come-1 | |
| 293 bsf toggle_customview ; Set flag, the customview will be toggled very soon now... | |
| 294 movlw .1 | |
| 295 movwf menupos ; Set to first option in divemode menu | |
| 296 MENU_BEGIN tGaslist, .2 | |
| 297 MENU_CALL tDivemenu_UseSensor, do_switch_to_sensor | |
| 298 MENU_CALL tExit, do_continue_main_divemenu | |
| 299 MENU_END | |
| 300 | |
| 301 do_divemode_togglegf: | |
| 302 ; Set customview to 5 (GF informations) | |
| 303 movlw .4 | |
| 304 movwf menupos3 ; Customview to come-1 | |
| 305 bsf toggle_customview ; Set flag, the customview will be toggled very soon now... | |
| 306 movlw .1 | |
| 307 movwf menupos ; Set to first option in divemode menu | |
| 308 MENU_BEGIN tDivemenu_ToggleGF, .2 | |
| 309 MENU_CALL tDivemenu_ToggleGF, do_togglegf | |
| 310 MENU_CALL tExit, do_continue_main_divemenu | |
| 311 MENU_END | |
| 312 | |
| 313 END |
