Mercurial > public > hwos_code
annotate src/gaslist.asm @ 531:e6d730e771e6
2.21 start
author | heinrichsweikamp |
---|---|
date | Fri, 18 Aug 2017 15:19:35 +0200 |
parents | d36f9fca10ae |
children | 72ae62440597 |
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 | |
521
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
156 bra gaslist_strcat_5 ; And return... |
0 | 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 | |
530 | 214 ;bra gaslist_strcat_3 ; NEW ; No MOD-check and red color for disabled gases |
0 | 215 gaslist_strcat_3: |
521
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
216 rcall gaslist_strcat_gas_0 |
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
217 PUTC " " |
0 | 218 ; Read switch depth |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
219 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
|
220 movlw .4 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
221 cpfsgt gaslist_gas ; >4? (-> Diluents) |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
222 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
|
223 |
0 | 224 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) |
225 movff PLUSW1,lo | |
226 rcall gaslist_calc_mod ; Compute MOD into WREG | |
227 cpfsgt lo | |
521
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
228 bra gaslist_strcat_5 |
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
229 |
530 | 230 movf gaslist_gas,W ; load gas index |
231 lfsr FSR1,opt_gas_type ; set-up index read from gas table | |
232 movff PLUSW1,gaslist_Type ; get current gas type into lo | |
233 movlw .3 ; compare current gas type with 3 = deco | |
234 cpfseq gaslist_Type ; skip next line if gas is of type deco | |
235 bra gaslist_strcat_5 ; gas is not deco gas | |
236 | |
237 call TFT_warnings_color ; Turn red if bigger and gas is a deco gas | |
238 ;bra gaslist_strcat_5 ; skip gaslist_strcat_gas_0 here | |
521
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
239 |
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
240 gaslist_strcat_5: |
518
72f6cb65ca4a
BUGFIX: Do not check ppO2 for disabled gases
heinrichsweikamp
parents:
507
diff
changeset
|
241 TSTOSS opt_units ; 0=Meters, 1=Feets |
72f6cb65ca4a
BUGFIX: Do not check ppO2 for disabled gases
heinrichsweikamp
parents:
507
diff
changeset
|
242 bra gaslist_strcat_3_metric |
0 | 243 ;gaslist_strcat_3_imperial: |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
244 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") |
530 | 245 bra gaslist_imperial_decogas |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
246 movf gaslist_gas,W |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
247 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
248 movff PLUSW1,gaslist_Type |
530 | 249 movlw .3 ; 0= Diabled, 1 = First, 2=Travel/Normal, 3 = Deco |
250 cpfslt gaslist_Type ; skip next line for disabled, first and travel gases | |
251 bra gaslist_imperial_decogas ; Deco gas ? show meters | |
252 bra gaslist_strcat_depth_nondeco ; Show "---" instead of "0m"... | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
253 |
530 | 254 gaslist_imperial_decogas: |
0 | 255 movf lo,W |
256 mullw .100 ; convert meters to mbar | |
257 movff PRODL,lo | |
258 movff PRODH,hi | |
259 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
260 bsf leftbind | |
225
31088352ee32
BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents:
189
diff
changeset
|
261 output_16_3 ; limit to 999 and display only (0-999) |
0 | 262 STRCAT_TEXT tFeets ; "ft" |
263 return | |
264 | |
265 gaslist_strcat_3_metric: | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
266 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") |
530 | 267 bra gaslist_metric_decogas |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
268 movf gaslist_gas,W |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
269 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
270 movff PLUSW1,gaslist_Type |
530 | 271 movlw .3 ; 0= Diabled, 1 = First, 2=Travel/Normal, 3 = Deco |
272 cpfslt gaslist_Type ; skip next line for disabled, first and travel gases | |
273 bra gaslist_metric_decogas ; Deco gas ? show meters | |
274 gaslist_strcat_depth_nondeco: ; Show "---" instead of "0m"... | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
275 STRCAT "---" |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
160
diff
changeset
|
276 return |
530 | 277 gaslist_metric_decogas: |
0 | 278 output_99 |
279 STRCAT_TEXT tMeters ; "m" | |
280 return | |
281 | |
282 ;---------------------------------------------------------------------------- | |
283 ; Store current menu item, and display gas description later. | |
284 ; Input: PRODL : gas number (0..4) | |
285 ; NOTE: used in the menu-tree for the MENU_CALLBACK entry. | |
286 global gaslist_setgas | |
287 gaslist_setgas: | |
288 movff PRODL,gaslist_gas | |
289 movlw .5 | |
290 btfsc ccr_diluent_setup ; in CCR menus? | |
291 addwf gaslist_gas,F ; Yes, offset to gases 5-9 | |
292 return | |
293 | |
294 | |
295 global gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth | |
296 gaslist_cleanup_list: | |
297 bcf ignore_last_edited_gas | |
298 movlw .0 | |
299 btfsc ccr_diluent_setup ; In CCR-Menu? | |
300 addlw .5 ; Yes, adjust offset | |
301 subwf gaslist_gas,F | |
302 gaslist_cleanup_list1: | |
303 clrf lo | |
304 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] | |
305 movlw .5 ; Check 5 gases | |
306 movwf hi | |
307 gaslist_cleanup_list2: | |
308 decf hi,w ; 0-4 | |
309 btfsc ccr_diluent_setup ; In CCR-Menu? | |
310 addlw .5 ; Yes, adjust offset | |
311 movff PLUSW1,hi_temp | |
312 movlw .1 | |
313 cpfseq hi_temp ; gas = first ? | |
314 bra gaslist_cleanup_list3 ; No | |
315 incf lo,F ; Yes, count "first gases" | |
316 | |
317 btfss ignore_last_edited_gas ; If we are not in the second-pass mode | |
318 bra gaslist_cleanup_list2b | |
319 | |
320 decf hi,w ; 0-4 | |
321 cpfseq gaslist_gas ; Do not disable last edited gas | |
322 gaslist_cleanup_list2b: | |
323 movff hi,lo_temp ; Keep the last "first gas" found | |
324 gaslist_cleanup_list3: | |
325 decfsz hi,F | |
326 bra gaslist_cleanup_list2 ; Loop | |
327 | |
328 tstfsz lo ; No gas active? | |
329 bra gaslist_cleanup_list4 ; No, at least one is active | |
330 | |
331 btfsc ccr_diluent_setup ; In CCR-Menu? | |
332 bra gaslist_cleanup_list3a ; Yes. | |
333 ; make gas1 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_list3a: | |
340 movlw .5 | |
341 addwf FSR1L,F | |
342 movlw .0 | |
343 addwfc FSR1H,F ; Setup to Diluents | |
344 ; make dil1 first and zero | |
345 movlw .1 ; First | |
346 movwf lo_temp | |
347 movwf INDF1 | |
348 bra gaslist_cleanup_list5 ; Set change depth to zero | |
349 | |
350 gaslist_cleanup_list4: | |
351 movlw .1 | |
352 cpfsgt lo ; More then one "first gas"? | |
353 bra gaslist_cleanup_list5 ; No, done. | |
354 ; More then one Gas is "first gas" | |
355 ; Disable last found "first gas" but keep it's change depth | |
356 decf lo_temp,W ; 0-4 | |
357 cpfseq gaslist_gas ; Do not disable last edited gas | |
358 bra gaslist_cleanup_list4b | |
359 ; Do not disable last edited gas | |
360 ; search again but ignore last edited gas | |
361 bsf ignore_last_edited_gas | |
362 bra gaslist_cleanup_list1 ; Loop until only one "first gas" is left | |
363 | |
364 gaslist_cleanup_list4b: | |
365 btfsc ccr_diluent_setup ; In CCR-Menu? | |
366 addlw .5 ; Yes, adjust offset | |
367 clrf PLUSW1 ; Disable gas | |
368 bra gaslist_cleanup_list ; Loop until only one "first gas" is left | |
369 | |
370 gaslist_cleanup_list5: | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
371 ; Read switch depth |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
372 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
|
373 btfss ccr_diluent_setup ; In CCR-Menu? |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
374 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases |
0 | 375 decf lo_temp,W |
376 btfsc ccr_diluent_setup ; In CCR-Menu? | |
377 addlw .5 ; Yes, adjust offset | |
378 clrf PLUSW1 ; Set First gas to zero m | |
379 return | |
380 | |
381 ;---------------------------------------------------------------------------- | |
382 ; Increment/Decrement O2 ratio | |
383 global gaslist_pO2 | |
384 gaslist_pO2: | |
385 movf gaslist_gas,W | |
386 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] | |
387 movff PLUSW1,gaslist_He | |
388 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
389 movff PLUSW1,gaslist_O2 | |
390 | |
391 incf gaslist_O2,F ; O2++ | |
392 movf gaslist_He,W | |
393 addwf gaslist_O2,W | |
394 movwf lo | |
395 movlw .101 | |
396 cpfslt lo ; O2+He<101? | |
397 decf gaslist_O2,F ; O2-- (Unchanged) | |
398 | |
399 movf gaslist_gas,W | |
400 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] | |
401 return | |
402 | |
403 global gaslist_mO2 | |
404 gaslist_mO2: | |
405 movf gaslist_gas,W | |
406 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
407 movff PLUSW1,gaslist_O2 | |
408 | |
409 decf gaslist_O2,F | |
410 movlw gaslist_min_o2 | |
411 cpfslt gaslist_O2 | |
412 bra gaslist_mO2_1 | |
413 movlw gaslist_min_o2 | |
414 movwf gaslist_O2 | |
415 gaslist_mO2_1: | |
416 movf gaslist_gas,W | |
417 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] | |
418 return | |
419 | |
420 ;---------------------------------------------------------------------------- | |
421 ; Increment/Decrement He ratio | |
422 global gaslist_pHe | |
423 gaslist_pHe: | |
424 movf gaslist_gas,W | |
425 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
426 movff PLUSW1,gaslist_O2 | |
427 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] | |
428 movff PLUSW1,gaslist_He | |
429 | |
430 incf gaslist_He,F ; He++ | |
431 movf gaslist_He,W | |
432 addwf gaslist_O2,W | |
433 movwf lo | |
434 movlw .101 | |
435 cpfslt lo ; O2+He<101? | |
436 decf gaslist_He,F ; Yes, He-- (Unchanged) | |
437 | |
438 movf gaslist_gas,W | |
439 movff gaslist_He,PLUSW1 ; And write back to opt_gas_He_ratio[WREG] | |
440 return | |
441 | |
442 global gaslist_mHe | |
443 gaslist_mHe: | |
444 movf gaslist_gas,W | |
445 lfsr FSR1,opt_gas_He_ratio ; Read opt_gas_He_ratio[WREG] | |
446 movff PLUSW1,gaslist_He | |
447 | |
448 decf gaslist_He,F | |
449 bnn gaslist_mHe_1 | |
450 clrf gaslist_He | |
451 gaslist_mHe_1: | |
452 movf gaslist_gas,W | |
453 movff gaslist_He,PLUSW1 ; And write back to opt_gas_He_ratio[WREG] | |
454 return | |
455 | |
456 ;---------------------------------------------------------------------------- | |
457 ; Increment/Decrement switch depth | |
458 global gaslist_pDepth | |
459 gaslist_pDepth: | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
460 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
|
461 movlw .4 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
462 cpfsgt gaslist_gas ; >4? (-> Diluents) |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
463 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
|
464 |
0 | 465 movf gaslist_gas,W |
466 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | |
467 | |
468 incf gaslist_O2,F | |
469 movlw gaslist_max_change_depth | |
470 cpfsgt gaslist_O2 | |
471 bra gaslist_pDepth_1 | |
472 movlw gaslist_max_change_depth | |
473 movwf gaslist_O2 | |
474 gaslist_pDepth_1: | |
475 movf gaslist_gas,W | |
476 movff gaslist_O2,PLUSW1 ; Write back to char_I_deco_gas_change[WREG] | |
477 return | |
478 | |
479 global gaslist_mDepth | |
480 gaslist_mDepth: | |
97
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
481 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
|
482 movlw .4 |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
483 cpfsgt gaslist_gas ; >4? (-> Diluents) |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
484 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
|
485 |
0 | 486 movf gaslist_gas,W |
487 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | |
488 | |
489 decf gaslist_O2,F | |
490 btfsc STATUS,N | |
491 clrf gaslist_O2 | |
492 | |
493 movf gaslist_gas,W | |
494 movff gaslist_O2,PLUSW1 ; And write back to char_I_deco_gas_change[WREG] | |
495 return | |
496 | |
497 global gaslist_spplus | |
498 gaslist_spplus: | |
499 movf gaslist_gas,W | |
500 lfsr FSR1,char_I_setpoint_cbar | |
501 movff PLUSW1,lo ; Read char_I_setpoint_cbar[WREG] | |
502 movlw gaslist_sp_stepsize | |
503 addwf lo,F | |
504 movlw gaslist_sp_max | |
505 cpfsgt lo | |
506 bra gaslist_spplus2 | |
507 movlw gaslist_sp_min | |
508 movwf lo | |
509 gaslist_spplus2: | |
510 movf gaslist_gas,W | |
511 movff lo,PLUSW1 ; Write back to char_I_setpoint_cbar | |
512 return | |
513 | |
514 global gaslist_spdepthplus | |
515 gaslist_spdepthplus: | |
516 movf gaslist_gas,W | |
517 bz gaslist_spdepthplus3 ; Setpoint 1 is always 0m | |
518 lfsr FSR1,char_I_setpoint_change | |
519 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | |
520 incf gaslist_O2,F | |
521 movlw gaslist_max_change_depth | |
522 cpfsgt gaslist_O2 | |
523 bra gaslist_spdepthplus_1 | |
524 movlw gaslist_max_change_depth | |
525 movwf gaslist_O2 | |
526 gaslist_spdepthplus_1: | |
527 movf gaslist_gas,W | |
528 movff gaslist_O2,PLUSW1 ; Write back to char_I_deco_gas_change[WREG] | |
529 return | |
530 | |
531 gaslist_spdepthplus3: | |
532 movlw .0 | |
533 movff WREG,char_I_setpoint_change+0 ; Reset to 0m | |
534 return | |
535 | |
536 global gaslist_spdepthminus | |
537 gaslist_spdepthminus: | |
538 movf gaslist_gas,W | |
539 bz gaslist_spdepthplus3 ; Setpoint 1 is always 0m | |
540 lfsr FSR1,char_I_setpoint_change | |
541 movff PLUSW1,gaslist_O2 ; Read opt_gas_O2_ratio[WREG] | |
542 decf gaslist_O2,F | |
543 btfsc STATUS,N | |
544 clrf gaslist_O2 | |
545 movf gaslist_gas,W | |
546 movff gaslist_O2,PLUSW1 ; And write back to opt_gas_O2_ratio[WREG] | |
547 return | |
548 | |
549 ;---------------------------------------------------------------------------- | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
550 ; Compute MOD from opt_ppO2_max/opt_ppO2_max_deco and current O2 Ratio. |
0 | 551 ; |
552 ; Input: gaslist_gas = current gas index. | |
553 ; opt_gas_O2_ratio[gaslist_gas] = current O2 ratio | |
554 ; Output: WREG = MOD [m] | |
555 ; | |
556 gaslist_calc_mod: | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
557 movff gaslist_gas,gaslist_gas_global ; copy for color coding |
0 | 558 movf gaslist_gas,W ; Read current gas O2 ratio |
559 lfsr FSR1,opt_gas_O2_ratio ; Read opt_gas_O2_ratio[WREG] | |
560 movf PLUSW1,W | |
561 | |
562 btfsc divemode ; In divemode? | |
563 bra gaslist_calc_mod_divemode ; Yes. | |
564 | |
565 ; Pamb max = ppO2 Max / O2 ratio | |
566 movwf xB+0 | |
567 | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
568 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
|
569 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
|
570 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
|
571 |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
572 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
|
573 movlw .3 |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
574 cpfseq xA+0 ; Deco? |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
575 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
|
576 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
|
577 |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
578 clrf xB+1 ; Clear for div16x16 |
0 | 579 mullw .10 |
580 movff PRODL,xA+0 | |
581 movff PRODH,xA+1 | |
582 call div16x16 | |
583 | |
584 ; Prof = Pamb - 1bar. | |
585 movf xC+0,W | |
586 addlw -.10 | |
587 return | |
588 | |
589 gaslist_calc_mod_divemode: | |
590 extern TFT_color_code1 | |
591 movwf hi ; Copy O2% | |
592 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
|
593 call TFT_color_code1 ; Color-code current row in Gaslist (%O2 in hi), opt_ppO2_max/opt_ppO2_max_deco as threshold |
0 | 594 return |
595 ;---------------------------------------------------------------------------- | |
154
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
596 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
597 global gaslist_ppo2 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
598 gaslist_ppo2: |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
599 STRCAT_TEXT tppO2 ; ppO2: |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
600 movf gaslist_gas,W |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
601 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
602 btfss ccr_diluent_setup ; In CCR-Menu? |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
603 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
|
604 movf PLUSW1,W |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
605 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
|
606 movlw .100 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
607 addwf PRODL,F |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
608 movlw .0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
609 addwfc PRODH,F ; add 1bar |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
610 movff PRODL,xA+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
611 movff PRODH,xA+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
612 movf gaslist_gas,W ; Read current gas O2 ratio |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
613 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
|
614 btfss ccr_diluent_setup ; In CCR-Menu? |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
615 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
|
616 movff PLUSW1,xB+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
617 clrf xB+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
618 call mult16x16 ; char_I_O2_ratio * (p_amb/10) |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
619 movff xC+0,xA+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
620 movff xC+1,xA+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
621 movlw d'100' |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
622 movwf xB+0 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
623 clrf xB+1 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
624 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
|
625 ; Check very high ppO2 manually |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
626 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
|
627 bra gaslist_ppo2_2 ; Yes, display fixed Value! |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
628 movff xC+0,lo |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
629 movff xC+1,hi |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
630 bcf ignore_digit4 |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
631 bsf leftbind |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
632 output_16dp d'3' ; x.xx |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
633 STRCAT_TEXT tbar ; bar |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
634 return |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
635 gaslist_ppo2_2: |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
636 STRCAT ">6.6" |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
637 return |
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
97
diff
changeset
|
638 |
0 | 639 global gaslist_MOD_END |
640 gaslist_MOD_END: | |
641 rcall gaslist_calc_mod ; Compute MOD into WREG | |
642 movwf lo ; Copy to lo | |
14 | 643 STRCAT_TEXT tMOD ; MOD: |
0 | 644 TSTOSS opt_units ; 0=Meters, 1=Feets |
645 bra gaslist_MOD_metric | |
646 ;gaslist_MOD_imperial: | |
647 movf lo,W | |
648 mullw .100 ; convert meters to mbar | |
649 movff PRODL,lo | |
650 movff PRODH,hi | |
651 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
652 bsf leftbind | |
225
31088352ee32
BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents:
189
diff
changeset
|
653 output_16_3 ; limit to 999 and display only (0-999) |
0 | 654 STRCAT_TEXT tFeets ; "ft" |
655 bra gaslist_MOD_common | |
656 gaslist_MOD_metric: | |
657 output_8 | |
658 STRCAT_TEXT tMeters ; m | |
659 gaslist_MOD_common: | |
660 PUTC "/" | |
661 STRCAT_TEXT tEND ; END: | |
662 rcall gaslist_calc_mod ; Output: WREG = MOD [m] | |
663 addlw .10 ; MOD=MOD+10m | |
664 movwf xB+0 | |
665 clrf xB+1 | |
666 movlw d'100' | |
667 movwf xA+0 | |
668 movf gaslist_He,W ; He value in % -> WREG | |
669 subwf xA+0,F ; xA+0 = 100 - He Value in % | |
670 clrf xA+1 | |
671 call mult16x16 ; xA*xB=xC | |
672 movff xC+0,xA+0 | |
673 movff xC+1,xA+1 | |
674 movlw d'100' | |
675 movwf xB+0 | |
676 clrf xB+1 | |
677 call div16x16 ; xA/xB=xC with xA as remainder | |
678 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100 | |
679 movlw d'10' | |
680 subwf xC+0,F ; Subtract 10m... | |
681 movff xC+0,lo | |
682 ; END 8Bit only | |
683 ; movlw d'0' | |
684 ; subwfb xC+1,F | |
685 ; movff xC+1,hi | |
686 TSTOSS opt_units ; 0=Meters, 1=Feets | |
687 bra gaslist_END_metric | |
688 ;gaslist_END_imperial: | |
689 movf lo,W | |
690 mullw .100 ; convert meters to mbar | |
691 movff PRODL,lo | |
692 movff PRODH,hi | |
693 call convert_mbar_to_feet ; convert value in lo:hi from mbar to feet | |
694 bsf leftbind | |
225
31088352ee32
BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents:
189
diff
changeset
|
695 output_16_3 ; limit to 999 and display only (0-999) |
0 | 696 STRCAT_TEXT tFeets ; "ft" |
697 return | |
698 gaslist_END_metric: | |
699 output_8 | |
700 STRCAT_TEXT tMeters ; m | |
701 return | |
702 | |
703 ;---------------------------------------------------------------------------- | |
704 global gaslist_reset_mod_title | |
705 gaslist_reset_mod_title: | |
706 STRCAT_TEXT tDepthReset | |
707 | |
708 gaslist_reset_mod_title2: | |
709 rcall gaslist_calc_mod ; Compute MOD into WREG | |
710 movwf lo ; Copy to lo | |
711 | |
712 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
|
713 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
|
714 btfss ccr_diluent_setup ; In CCR-Menu? |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
715 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases |
0 | 716 movf PLUSW1,W |
717 cpfslt lo | |
521
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
718 bra gaslist_strcat_5 ; And return... |
50 | 719 call TFT_warnings_color ; Turn red if bigger ! |
521
06e9370c6d75
CHANGE: Apply safety margin parameters to both models (GF and non-GF)
heinrichsweikamp
parents:
518
diff
changeset
|
720 bra gaslist_strcat_5 ; And return... |
0 | 721 |
722 ;---------------------------------------------------------------------------- | |
723 global gaslist_reset_mod | |
724 gaslist_reset_mod: | |
725 rcall gaslist_calc_mod ; Compute MOD | |
726 movwf gaslist_depth | |
727 | |
728 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
|
729 |
505
bef07a837a60
BUGFIX: Reset to MOD in Diluent Menu did reset Setpoint change depth
heinrichsweikamp
parents:
275
diff
changeset
|
730 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
|
731 btfss ccr_diluent_setup ; In CCR-Menu? |
53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
heinrichsweikamp
parents:
95
diff
changeset
|
732 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
|
733 |
0 | 734 movff gaslist_depth,PLUSW1 ; And save new change depth |
735 return | |
736 ;---------------------------------------------------------------------------- | |
737 END |