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