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