Mercurial > public > hwos_code
annotate src/gaslist.asm @ 510:377d958252fb
BUGFIX: Planner in CCR mode used OC gases for volume calculations in some cases
author | heinrichsweikamp |
---|---|
date | Fri, 30 Jun 2017 15:12:56 +0200 |
parents | 4e6f5c36f4cc |
children | 72f6cb65ca4a |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File gaslist.asm | |
4 ; | |
275 | 5 ; Managing OSTC gas list |
0 | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-08-11 : [jDG] Creation. | |
11 | |
275 | 12 #include "hwos.inc" ; Mandatory header |
0 | 13 #include "convert.inc" |
14 #include "math.inc" ; div16x16 for MOD calculations | |
15 #include "strings.inc" | |
16 #include "tft.inc" | |
17 #include "tft_outputs.inc" | |
18 | |
19 #include "shared_definitions.h" | |
20 | |
21 CBLOCK tmp+0x40 ; Keep space for menu processor | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
22 gaslist_gas ; Check ram position in menu_tree.asm, too! |
0 | 23 gaslist_O2 |
24 gaslist_He | |
25 gaslist_depth | |
26 gaslist_Type | |
27 ; Reserved to tmp+0x5F | |
28 ENDC | |
29 | |
30 extern convert_mbar_to_feet | |
31 | |
32 gui CODE | |
33 ;============================================================================= | |
34 ; Append gas description to current string. | |
35 ; Input: PRODL : gas number (0..4) | |
36 ; FSR2 : Current string position. | |
37 ; Output: Text appended into buffer pointed by FSR2. | |
38 extern customview_show_mix | |
39 global gaslist_strcat_gas | |
40 gaslist_strcat_gas: | |
41 rcall gaslist_setgas ; Sets gaslist_gas (0-4 for OC/Bailout, 5-9 for Diluents) | |
42 ; Retrieve gas definition: | |
43 gaslist_strcat_gas_0: | |
44 movf gaslist_gas,W | |
45 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
46 movff PLUSW1,gaslist_O2 | |
47 movf gaslist_gas,W | |
48 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] | |
49 movff PLUSW1,gaslist_He | |
50 | |
51 movff gaslist_O2,lo | |
52 movff gaslist_He,hi | |
53 call customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | |
54 return | |
55 | |
56 | |
57 ;============================================================================= | |
58 ; Append current mix to current string (For divemode) | |
59 ; Input: FSR2 : Current string position. | |
60 ; Output: Text appended into buffer pointed by FSR2. | |
61 global gaslist_strcat_gasx | |
62 gaslist_strcat_gasx: ; Show current O2/He mix | |
63 STRCAT_TEXT tGas | |
64 STRCAT ": " | |
65 movff char_I_O2_ratio,lo | |
66 movff char_I_He_ratio,hi | |
67 call customview_show_mix ; Put "Nxlo", "Txlo/hi", "Air" or "O2" into Postinc2 | |
68 return | |
69 | |
70 global gaslist_show_type | |
71 extern tGasDisabled | |
72 extern tDilDisabled | |
73 gaslist_show_type: | |
74 movf gaslist_gas,W | |
75 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] | |
76 movff PLUSW1,gaslist_Type | |
77 STRCAT_TEXT tType | |
78 lfsr FSR1,tGasDisabled ; Base text number | |
79 btfsc ccr_diluent_setup ; In CCR setup? | |
80 lfsr FSR1,tDilDisabled ; Base text number | |
81 movff gaslist_Type,WREG ; 0-3 | |
82 rlncf WREG ; x2 | |
83 addwf FSR1L,F | |
84 movlw .0 | |
85 addwfc FSR1H,F | |
86 call strcat_text | |
87 return | |
88 | |
89 global gaslist_toggle_type | |
90 gaslist_toggle_type: | |
91 movf gaslist_gas,W | |
92 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] | |
93 movff PLUSW1,gaslist_Type | |
94 incf gaslist_Type,F ; 0-3/0-2 | |
95 btfsc ccr_diluent_setup ; In CCR setup? | |
96 bra gaslist_toggle_type2 ; Yes | |
97 btfsc gaslist_Type,2 ; >3? | |
98 clrf gaslist_Type ; Clear to zero | |
99 movff gaslist_Type,PLUSW1 ; Copy back result | |
100 return | |
101 | |
102 gaslist_toggle_type2: | |
103 movlw .3 | |
104 cpfslt gaslist_Type ; >2? | |
105 clrf gaslist_Type ; Clear to zero | |
106 movf gaslist_gas,W | |
107 movff gaslist_Type,PLUSW1 ; Copy back result | |
108 return | |
109 | |
110 global gaslist_setSP | |
111 gaslist_setSP: | |
112 movff PRODL,gaslist_gas ; 0-4 | |
113 return | |
114 | |
115 extern tbar | |
116 global gaslist_strcat_setpoint | |
117 global gaslist_strcat_setpoint_0 | |
118 gaslist_strcat_setpoint: | |
119 call gaslist_setSP | |
120 gaslist_strcat_setpoint_0: | |
121 bsf leftbind | |
122 btfsc short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint | |
123 bra gaslist_strcat_setpoint2 ; Short version | |
124 STRCAT_TEXT tSP | |
125 incf gaslist_gas,W | |
126 movwf lo | |
127 output_8 | |
128 bcf leftbind | |
129 PUTC ":" | |
130 gaslist_strcat_setpoint2: ; Short version | |
131 btfsc divemode | |
132 bra gaslist_strcat_setpoint4 ; no "*" in divemode | |
95
3dfc2b7ced6d
BUGFIX: Show "*" always in front of the initial Setpoint 1
heinrichsweikamp
parents:
50
diff
changeset
|
133 movf gaslist_gas,W ; Number-1 into WREG |
3dfc2b7ced6d
BUGFIX: Show "*" always in front of the initial Setpoint 1
heinrichsweikamp
parents:
50
diff
changeset
|
134 bnz gaslist_strcat_setpoint3 ; Not SP1 |
0 | 135 PUTC "*" |
136 bra gaslist_strcat_setpoint4 | |
137 gaslist_strcat_setpoint3: | |
138 PUTC " " | |
139 gaslist_strcat_setpoint4: | |
140 movf gaslist_gas,W | |
141 lfsr FSR1,char_I_setpoint_cbar | |
142 movf PLUSW1,W | |
143 movwf lo | |
144 clrf hi | |
145 bsf leftbind | |
146 output_16dp d'3' | |
147 btfsc divemode | |
148 bra gaslist_strcat_setpoint5 ; Skip text in divemode | |
149 STRCAT_TEXT tbar | |
150 gaslist_strcat_setpoint5: | |
151 PUTC " " | |
152 ; Read switch depth | |
153 movf gaslist_gas,W | |
154 lfsr FSR1,char_I_setpoint_change | |
155 movff PLUSW1,lo | |
156 bra gaslist_strcat_4 ; And return... | |
157 | |
158 ;---------------------------------------------------------------------------- | |
159 ; Append gas description to current string. | |
160 ; Input: PRODL : gas number (0..4) | |
161 ; FSR2 : Current string position. | |
162 ; Output: Text appended into buffer pointed by FSR2. | |
163 ; | |
164 ; NOTE: used in the menu-tree for the MENU_CALLBACK entry. | |
165 | |
166 gaslist_strcat_gas_better: ; Yes, check if this is a "better gas" | |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
174
diff
changeset
|
167 bcf win_invert |
160
99ac325586ce
BUGFIX: Fast diluent (w/o dive mode menu) change did not work correctly
heinrichsweikamp
parents:
154
diff
changeset
|
168 decf better_gas_number,W ; better_gas_number-1 -> WREG |
99ac325586ce
BUGFIX: Fast diluent (w/o dive mode menu) change did not work correctly
heinrichsweikamp
parents:
154
diff
changeset
|
169 btfsc ccr_diluent_setup ; in CCR menus? |
99ac325586ce
BUGFIX: Fast diluent (w/o dive mode menu) change did not work correctly
heinrichsweikamp
parents:
154
diff
changeset
|
170 addlw .5 ; Yes, offset to gases 5-9 |
99ac325586ce
BUGFIX: Fast diluent (w/o dive mode menu) change did not work correctly
heinrichsweikamp
parents:
154
diff
changeset
|
171 cpfseq gaslist_gas ; 0-4 for OC/Bailout, 5-9 for Diluents |
0 | 172 return |
50 | 173 call TFT_attention_color ; show in yellow |
189
e79bc535ef9e
ignore un-calibrated sensors even if they become valid
heinrichsweikamp
parents:
174
diff
changeset
|
174 bsf win_invert ; And invert |
0 | 175 return |
176 | |
177 global gaslist_strcat_gas_mod | |
178 gaslist_strcat_gas_mod: | |
179 rcall gaslist_setgas ; Sets gaslist_gas (0-4 for OC/Bailout, 5-9 for Diluents) | |
180 | |
181 global gaslist_gastitle | |
182 gaslist_gastitle: | |
183 btfsc short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint | |
184 bra gaslist_gastitle2 ; Short version | |
185 STRCAT_TEXT tGas | |
186 incf gaslist_gas,W | |
187 movwf lo | |
188 bsf leftbind | |
189 output_8 | |
190 bcf leftbind | |
191 PUTC ":" | |
192 | |
193 gaslist_gastitle2: ; Short version | |
194 lfsr FSR1,opt_gas_type | |
195 btfsc divemode | |
196 bra gaslist_gastitle3 ; no "*" in divemode | |
197 movf gaslist_gas,W | |
198 decf PLUSW1,W ; Type-1 into WREG | |
199 bnz gaslist_gastitle1 ; Not "First" | |
200 PUTC "*" | |
201 bra gaslist_gastitle3 | |
202 gaslist_gastitle1: | |
203 PUTC " " | |
204 gaslist_gastitle3: ; Short version | |
205 call TFT_standard_color | |
206 | |
207 btfsc divemode ; In divemode? | |
208 rcall gaslist_strcat_gas_better ; Yes, check if this is a "better gas" | |
209 | |
210 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) | |
211 movf PLUSW1,W | |
212 bnz gaslist_strcat_3 | |
213 call TFT_disabled_color | |
214 gaslist_strcat_3: | |
215 rcall gaslist_strcat_gas_0 | |
216 PUTC " " | |
217 ; Read switch depth | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
218 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
219 movlw .4 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
220 cpfsgt gaslist_gas ; >4? (-> Diluents) |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
221 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
222 |
0 | 223 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) |
224 movff PLUSW1,lo | |
225 rcall gaslist_calc_mod ; Compute MOD into WREG | |
226 cpfsgt lo | |
227 bra gaslist_strcat_4 | |
50 | 228 call TFT_warnings_color ; Turn red if bigger |
0 | 229 gaslist_strcat_4: |
230 TSTOSS opt_units ; 0=Meters, 1=Feets | |
231 bra gaslist_strcat_3_metric | |
232 ;gaslist_strcat_3_imperial: | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
233 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
234 bra gaslist_imperial_non_travel |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
235 movf gaslist_gas,W |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
236 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
237 movff PLUSW1,gaslist_Type |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
238 movlw .2 ; 2=Travel |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
239 cpfseq gaslist_Type |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
240 bra gaslist_imperial_non_travel ; Non-Travel Gas |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
241 bra gaslist_strcat_depth_travel ; Show "---" instead of "0m"... |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
242 |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
243 gaslist_imperial_non_travel: |
0 | 244 movf lo,W |
245 mullw .100 ; convert meters to mbar | |
246 movff PRODL,lo | |
247 movff PRODH,hi | |
248 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
249 bsf leftbind | |
225
31088352ee32
BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents:
189
diff
changeset
|
250 output_16_3 ; limit to 999 and display only (0-999) |
0 | 251 STRCAT_TEXT tFeets ; "ft" |
252 return | |
253 | |
254 gaslist_strcat_3_metric: | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
255 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
256 bra gaslist_metric_non_travel |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
257 movf gaslist_gas,W |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
258 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
259 movff PLUSW1,gaslist_Type |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
260 movlw .2 ; 2=Travel |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
261 cpfseq gaslist_Type |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
262 bra gaslist_metric_non_travel ; Non-Travel Gas |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
263 gaslist_strcat_depth_travel: ; Show "---" instead of "0m"... |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
264 STRCAT "---" |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
265 return |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
266 gaslist_metric_non_travel: |
0 | 267 output_99 |
268 STRCAT_TEXT tMeters ; "m" | |
269 return | |
270 | |
271 ;---------------------------------------------------------------------------- | |
272 ; Store current menu item, and display gas description later. | |
273 ; Input: PRODL : gas number (0..4) | |
274 ; NOTE: used in the menu-tree for the MENU_CALLBACK entry. | |
275 global gaslist_setgas | |
276 gaslist_setgas: | |
277 movff PRODL,gaslist_gas | |
278 movlw .5 | |
279 btfsc ccr_diluent_setup ; in CCR menus? | |
280 addwf gaslist_gas,F ; Yes, offset to gases 5-9 | |
281 return | |
282 | |
283 | |
284 global gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth | |
285 gaslist_cleanup_list: | |
286 bcf ignore_last_edited_gas | |
287 movlw .0 | |
288 btfsc ccr_diluent_setup ; In CCR-Menu? | |
289 addlw .5 ; Yes, adjust offset | |
290 subwf gaslist_gas,F | |
291 gaslist_cleanup_list1: | |
292 clrf lo | |
293 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] | |
294 movlw .5 ; Check 5 gases | |
295 movwf hi | |
296 gaslist_cleanup_list2: | |
297 decf hi,w ; 0-4 | |
298 btfsc ccr_diluent_setup ; In CCR-Menu? | |
299 addlw .5 ; Yes, adjust offset | |
300 movff PLUSW1,hi_temp | |
301 movlw .1 | |
302 cpfseq hi_temp ; gas = first ? | |
303 bra gaslist_cleanup_list3 ; No | |
304 incf lo,F ; Yes, count "first gases" | |
305 | |
306 btfss ignore_last_edited_gas ; If we are not in the second-pass mode | |
307 bra gaslist_cleanup_list2b | |
308 | |
309 decf hi,w ; 0-4 | |
310 cpfseq gaslist_gas ; Do not disable last edited gas | |
311 gaslist_cleanup_list2b: | |
312 movff hi,lo_temp ; Keep the last "first gas" found | |
313 gaslist_cleanup_list3: | |
314 decfsz hi,F | |
315 bra gaslist_cleanup_list2 ; Loop | |
316 | |
317 tstfsz lo ; No gas active? | |
318 bra gaslist_cleanup_list4 ; No, at least one is active | |
319 | |
320 btfsc ccr_diluent_setup ; In CCR-Menu? | |
321 bra gaslist_cleanup_list3a ; Yes. | |
322 ; make gas1 first and zero | |
323 movlw .1 ; First | |
324 movwf lo_temp | |
325 movwf INDF1 | |
326 bra gaslist_cleanup_list5 ; Set change depth to zero | |
327 | |
328 gaslist_cleanup_list3a: | |
329 movlw .5 | |
330 addwf FSR1L,F | |
331 movlw .0 | |
332 addwfc FSR1H,F ; Setup to Diluents | |
333 ; make dil1 first and zero | |
334 movlw .1 ; First | |
335 movwf lo_temp | |
336 movwf INDF1 | |
337 bra gaslist_cleanup_list5 ; Set change depth to zero | |
338 | |
339 gaslist_cleanup_list4: | |
340 movlw .1 | |
341 cpfsgt lo ; More then one "first gas"? | |
342 bra gaslist_cleanup_list5 ; No, done. | |
343 ; More then one Gas is "first gas" | |
344 ; Disable last found "first gas" but keep it's change depth | |
345 decf lo_temp,W ; 0-4 | |
346 cpfseq gaslist_gas ; Do not disable last edited gas | |
347 bra gaslist_cleanup_list4b | |
348 ; Do not disable last edited gas | |
349 ; search again but ignore last edited gas | |
350 bsf ignore_last_edited_gas | |
351 bra gaslist_cleanup_list1 ; Loop until only one "first gas" is left | |
352 | |
353 gaslist_cleanup_list4b: | |
354 btfsc ccr_diluent_setup ; In CCR-Menu? | |
355 addlw .5 ; Yes, adjust offset | |
356 clrf PLUSW1 ; Disable gas | |
357 bra gaslist_cleanup_list ; Loop until only one "first gas" is left | |
358 | |
359 gaslist_cleanup_list5: | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
360 ; Read switch depth |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
361 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
362 btfss ccr_diluent_setup ; In CCR-Menu? |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
363 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases |
0 | 364 decf lo_temp,W |
365 btfsc ccr_diluent_setup ; In CCR-Menu? | |
366 addlw .5 ; Yes, adjust offset | |
367 clrf PLUSW1 ; Set First gas to zero m | |
368 return | |
369 | |
370 ;---------------------------------------------------------------------------- | |
371 ; Increment/Decrement O2 ratio | |
372 global gaslist_pO2 | |
373 gaslist_pO2: | |
374 movf gaslist_gas,W | |
375 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] | |
376 movff PLUSW1,gaslist_He | |
377 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
378 movff PLUSW1,gaslist_O2 | |
379 | |
380 incf gaslist_O2,F ; O2++ | |
381 movf gaslist_He,W | |
382 addwf gaslist_O2,W | |
383 movwf lo | |
384 movlw .101 | |
385 cpfslt lo ; O2+He<101? | |
386 decf gaslist_O2,F ; O2-- (Unchanged) | |
387 | |
388 movf gaslist_gas,W | |
389 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] | |
390 return | |
391 | |
392 global gaslist_mO2 | |
393 gaslist_mO2: | |
394 movf gaslist_gas,W | |
395 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
396 movff PLUSW1,gaslist_O2 | |
397 | |
398 decf gaslist_O2,F | |
399 movlw gaslist_min_o2 | |
400 cpfslt gaslist_O2 | |
401 bra gaslist_mO2_1 | |
402 movlw gaslist_min_o2 | |
403 movwf gaslist_O2 | |
404 gaslist_mO2_1: | |
405 movf gaslist_gas,W | |
406 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] | |
407 return | |
408 | |
409 ;---------------------------------------------------------------------------- | |
410 ; Increment/Decrement He ratio | |
411 global gaslist_pHe | |
412 gaslist_pHe: | |
413 movf gaslist_gas,W | |
414 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
415 movff PLUSW1,gaslist_O2 | |
416 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] | |
417 movff PLUSW1,gaslist_He | |
418 | |
419 incf gaslist_He,F ; He++ | |
420 movf gaslist_He,W | |
421 addwf gaslist_O2,W | |
422 movwf lo | |
423 movlw .101 | |
424 cpfslt lo ; O2+He<101? | |
425 decf gaslist_He,F ; Yes, He-- (Unchanged) | |
426 | |
427 movf gaslist_gas,W | |
428 movff gaslist_He,PLUSW1 ; And write back to opt_gas_He_ratio[WREG] | |
429 return | |
430 | |
431 global gaslist_mHe | |
432 gaslist_mHe: | |
433 movf gaslist_gas,W | |
434 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] | |
435 movff PLUSW1,gaslist_He | |
436 | |
437 decf gaslist_He,F | |
438 bnn gaslist_mHe_1 | |
439 clrf gaslist_He | |
440 gaslist_mHe_1: | |
441 movf gaslist_gas,W | |
442 movff gaslist_He,PLUSW1 ; And write back to opt_gas_He_ratio[WREG] | |
443 return | |
444 | |
445 ;---------------------------------------------------------------------------- | |
446 ; Increment/Decrement switch depth | |
447 global gaslist_pDepth | |
448 gaslist_pDepth: | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
449 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
450 movlw .4 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
451 cpfsgt gaslist_gas ; >4? (-> Diluents) |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
452 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
453 |
0 | 454 movf gaslist_gas,W |
455 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | |
456 | |
457 incf gaslist_O2,F | |
458 movlw gaslist_max_change_depth | |
459 cpfsgt gaslist_O2 | |
460 bra gaslist_pDepth_1 | |
461 movlw gaslist_max_change_depth | |
462 movwf gaslist_O2 | |
463 gaslist_pDepth_1: | |
464 movf gaslist_gas,W | |
465 movff gaslist_O2,PLUSW1 ; Write back to char_I_deco_gas_change[WREG] | |
466 return | |
467 | |
468 global gaslist_mDepth | |
469 gaslist_mDepth: | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
470 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
471 movlw .4 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
472 cpfsgt gaslist_gas ; >4? (-> Diluents) |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
473 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
474 |
0 | 475 movf gaslist_gas,W |
476 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | |
477 | |
478 decf gaslist_O2,F | |
479 btfsc STATUS,N | |
480 clrf gaslist_O2 | |
481 | |
482 movf gaslist_gas,W | |
483 movff gaslist_O2,PLUSW1 ; And write back to char_I_deco_gas_change[WREG] | |
484 return | |
485 | |
486 global gaslist_spplus | |
487 gaslist_spplus: | |
488 movf gaslist_gas,W | |
489 lfsr FSR1,char_I_setpoint_cbar | |
490 movff PLUSW1,lo ; Read char_I_setpoint_cbar[WREG] | |
491 movlw gaslist_sp_stepsize | |
492 addwf lo,F | |
493 movlw gaslist_sp_max | |
494 cpfsgt lo | |
495 bra gaslist_spplus2 | |
496 movlw gaslist_sp_min | |
497 movwf lo | |
498 gaslist_spplus2: | |
499 movf gaslist_gas,W | |
500 movff lo,PLUSW1 ; Write back to char_I_setpoint_cbar | |
501 return | |
502 | |
503 global gaslist_spdepthplus | |
504 gaslist_spdepthplus: | |
505 movf gaslist_gas,W | |
506 bz gaslist_spdepthplus3 ; Setpoint 1 is always 0m | |
507 lfsr FSR1,char_I_setpoint_change | |
508 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | |
509 incf gaslist_O2,F | |
510 movlw gaslist_max_change_depth | |
511 cpfsgt gaslist_O2 | |
512 bra gaslist_spdepthplus_1 | |
513 movlw gaslist_max_change_depth | |
514 movwf gaslist_O2 | |
515 gaslist_spdepthplus_1: | |
516 movf gaslist_gas,W | |
517 movff gaslist_O2,PLUSW1 ; Write back to char_I_deco_gas_change[WREG] | |
518 return | |
519 | |
520 gaslist_spdepthplus3: | |
521 movlw .0 | |
522 movff WREG,char_I_setpoint_change+0 ; Reset to 0m | |
523 return | |
524 | |
525 global gaslist_spdepthminus | |
526 gaslist_spdepthminus: | |
527 movf gaslist_gas,W | |
528 bz gaslist_spdepthplus3 ; Setpoint 1 is always 0m | |
529 lfsr FSR1,char_I_setpoint_change | |
530 movff PLUSW1,gaslist_O2 ; Read opt_gas_O2_ratio[WREG] | |
531 decf gaslist_O2,F | |
532 btfsc STATUS,N | |
533 clrf gaslist_O2 | |
534 movf gaslist_gas,W | |
535 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] | |
536 return | |
537 | |
538 ;---------------------------------------------------------------------------- | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
539 ; Compute MOD from opt_ppO2_max/opt_ppO2_max_deco and current O2 Ratio. |
0 | 540 ; |
541 ; Input: gaslist_gas = current gas index. | |
542 ; opt_gas_O2_ratio[gaslist_gas] = current O2 ratio | |
543 ; Output: WREG = MOD [m] | |
544 ; | |
545 gaslist_calc_mod: | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
546 movff gaslist_gas,gaslist_gas_global ; copy for color coding |
0 | 547 movf gaslist_gas,W ; Read current gas O2 ratio |
548 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
549 movf PLUSW1,W | |
550 | |
551 btfsc divemode ; In divemode? | |
552 bra gaslist_calc_mod_divemode ; Yes. | |
553 | |
554 ; Pamb max = ppO2 Max / O2 ratio | |
555 movwf xB+0 | |
556 | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
557 movf gaslist_gas,W ; Read current gas O2 ratio |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
558 lfsr FSR1,opt_gas_type ; 0=Disabled, 1=First, 2=Travel, 3=Deco for OC gases and 0=Disabled, 1=First, 2=Normal for diluents |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
559 movff PLUSW1,xA+0 ; xA+0 used as temp here -> holds type |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
560 |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
561 movff opt_ppO2_max_deco,xB+1 ; xB+1 used as temp here |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
562 movlw .3 |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
563 cpfseq xA+0 ; Deco? |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
564 movff opt_ppO2_max,xB+1 ; No, overwrite with travel/bottom max |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
565 movf xB+1,W ; Result in WREG |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
566 |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
567 clrf xB+1 ; Clear for div16x16 |
0 | 568 mullw .10 |
569 movff PRODL,xA+0 | |
570 movff PRODH,xA+1 | |
571 call div16x16 | |
572 | |
573 ; Prof = Pamb - 1bar. | |
574 movf xC+0,W | |
575 addlw -.10 | |
576 return | |
577 | |
578 gaslist_calc_mod_divemode: | |
579 extern TFT_color_code1 | |
580 movwf hi ; Copy O2% | |
581 movlw warn_gas_in_gaslist | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
582 call TFT_color_code1 ; Color-code current row in Gaslist (%O2 in hi), opt_ppO2_max/opt_ppO2_max_deco as threshold |
0 | 583 return |
584 ;---------------------------------------------------------------------------- | |
154
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
585 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
586 global gaslist_ppo2 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
587 gaslist_ppo2: |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
588 STRCAT_TEXT tppO2 ; ppO2: |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
589 movf gaslist_gas,W |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
590 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
591 btfss ccr_diluent_setup ; In CCR-Menu? |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
592 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC/Bailout Gases |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
593 movf PLUSW1,W |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
594 mullw .10 ; PROD=Depth in mbar/10 (100 = 1.00 bar) |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
595 movlw .100 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
596 addwf PRODL,F |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
597 movlw .0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
598 addwfc PRODH,F ; add 1bar |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
599 movff PRODL,xA+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
600 movff PRODH,xA+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
601 movf gaslist_gas,W ; Read current gas O2 ratio |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
602 lfsr FSR1,opt_dil_O2_ratio-.5 ; Read dil_gas_O2_ratio[WREG] |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
603 btfss ccr_diluent_setup ; In CCR-Menu? |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
604 lfsr FSR1,opt_gas_O2_ratio ; No, read opt_gas_O2_ratio[WREG] |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
605 movff PLUSW1,xB+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
606 clrf xB+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
607 call mult16x16 ; char_I_O2_ratio * (p_amb/10) |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
608 movff xC+0,xA+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
609 movff xC+1,xA+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
610 movlw d'100' |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
611 movwf xB+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
612 clrf xB+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
613 call div16x16 ; xC=(char_I_O2_ratio * p_amb/10)/100 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
614 ; Check very high ppO2 manually |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
615 tstfsz xC+2 ; char_I_O2_ratio * p_amb/10 > 65536, ppO2>6,55bar? |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
616 bra gaslist_ppo2_2 ; Yes, display fixed Value! |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
617 movff xC+0,lo |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
618 movff xC+1,hi |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
619 bcf ignore_digit4 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
620 bsf leftbind |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
621 output_16dp d'3' ; x.xx |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
622 STRCAT_TEXT tbar ; bar |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
623 return |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
624 gaslist_ppo2_2: |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
625 STRCAT ">6.6" |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
626 return |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
627 |
0 | 628 global gaslist_MOD_END |
629 gaslist_MOD_END: | |
630 rcall gaslist_calc_mod ; Compute MOD into WREG | |
631 movwf lo ; Copy to lo | |
14 | 632 STRCAT_TEXT tMOD ; MOD: |
0 | 633 TSTOSS opt_units ; 0=Meters, 1=Feets |
634 bra gaslist_MOD_metric | |
635 ;gaslist_MOD_imperial: | |
636 movf lo,W | |
637 mullw .100 ; convert meters to mbar | |
638 movff PRODL,lo | |
639 movff PRODH,hi | |
640 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
641 bsf leftbind | |
225
31088352ee32
BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents:
189
diff
changeset
|
642 output_16_3 ; limit to 999 and display only (0-999) |
0 | 643 STRCAT_TEXT tFeets ; "ft" |
644 bra gaslist_MOD_common | |
645 gaslist_MOD_metric: | |
646 output_8 | |
647 STRCAT_TEXT tMeters ; m | |
648 gaslist_MOD_common: | |
649 PUTC "/" | |
650 STRCAT_TEXT tEND ; END: | |
651 rcall gaslist_calc_mod ; Output: WREG = MOD [m] | |
652 addlw .10 ; MOD=MOD+10m | |
653 movwf xB+0 | |
654 clrf xB+1 | |
655 movlw d'100' | |
656 movwf xA+0 | |
657 movf gaslist_He,W ; He value in % -> WREG | |
658 subwf xA+0,F ; xA+0 = 100 - He Value in % | |
659 clrf xA+1 | |
660 call mult16x16 ; xA*xB=xC | |
661 movff xC+0,xA+0 | |
662 movff xC+1,xA+1 | |
663 movlw d'100' | |
664 movwf xB+0 | |
665 clrf xB+1 | |
666 call div16x16 ; xA/xB=xC with xA as remainder | |
667 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100 | |
668 movlw d'10' | |
669 subwf xC+0,F ; Subtract 10m... | |
670 movff xC+0,lo | |
671 ; END 8Bit only | |
672 ; movlw d'0' | |
673 ; subwfb xC+1,F | |
674 ; movff xC+1,hi | |
675 TSTOSS opt_units ; 0=Meters, 1=Feets | |
676 bra gaslist_END_metric | |
677 ;gaslist_END_imperial: | |
678 movf lo,W | |
679 mullw .100 ; convert meters to mbar | |
680 movff PRODL,lo | |
681 movff PRODH,hi | |
682 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
683 bsf leftbind | |
225
31088352ee32
BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents:
189
diff
changeset
|
684 output_16_3 ; limit to 999 and display only (0-999) |
0 | 685 STRCAT_TEXT tFeets ; "ft" |
686 return | |
687 gaslist_END_metric: | |
688 output_8 | |
689 STRCAT_TEXT tMeters ; m | |
690 return | |
691 | |
692 ;---------------------------------------------------------------------------- | |
693 global gaslist_reset_mod_title | |
694 gaslist_reset_mod_title: | |
695 STRCAT_TEXT tDepthReset | |
696 | |
697 gaslist_reset_mod_title2: | |
698 rcall gaslist_calc_mod ; Compute MOD into WREG | |
699 movwf lo ; Copy to lo | |
700 | |
701 movf gaslist_gas,W ; Compare to switch depth | |
505
bef07a837a60
BUGFIX: Reset to MOD in Diluent Menu did reset Setpoint change depth
heinrichsweikamp
parents:
275
diff
changeset
|
702 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
703 btfss ccr_diluent_setup ; In CCR-Menu? |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
704 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases |
0 | 705 movf PLUSW1,W |
706 cpfslt lo | |
707 bra gaslist_strcat_4 ; And return... | |
50 | 708 call TFT_warnings_color ; Turn red if bigger ! |
0 | 709 bra gaslist_strcat_4 ; And return... |
710 | |
711 ;---------------------------------------------------------------------------- | |
712 global gaslist_reset_mod | |
713 gaslist_reset_mod: | |
714 rcall gaslist_calc_mod ; Compute MOD | |
715 movwf gaslist_depth | |
716 | |
717 movf gaslist_gas,W ; Read current gas O2 ratio | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
718 |
505
bef07a837a60
BUGFIX: Reset to MOD in Diluent Menu did reset Setpoint change depth
heinrichsweikamp
parents:
275
diff
changeset
|
719 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
720 btfss ccr_diluent_setup ; In CCR-Menu? |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
721 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
722 |
0 | 723 movff gaslist_depth,PLUSW1 ; And save new change depth |
724 return | |
725 ;---------------------------------------------------------------------------- | |
726 END |