Mercurial > public > hwos_code
comparison src/gaslist.asm @ 97:53a99a2dc6a1
CHANGE: Always compute bailout plan based on all active gases
CHANGE: Re-select last diluent when returning from bailout to OC
author | heinrichsweikamp |
---|---|
date | Mon, 28 Apr 2014 16:26:31 +0200 |
parents | 3dfc2b7ced6d |
children | afa31c815f24 |
comparison
equal
deleted
inserted
replaced
96:a4bff632e97b | 97:53a99a2dc6a1 |
---|---|
213 call TFT_disabled_color | 213 call TFT_disabled_color |
214 gaslist_strcat_3: | 214 gaslist_strcat_3: |
215 rcall gaslist_strcat_gas_0 | 215 rcall gaslist_strcat_gas_0 |
216 PUTC " " | 216 PUTC " " |
217 ; Read switch depth | 217 ; Read switch depth |
218 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 | |
219 movlw .4 | |
220 cpfsgt gaslist_gas ; >4? (-> Diluents) | |
221 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases | |
222 | |
218 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) | 223 movf gaslist_gas,W ; (0-4 for OC/Bailout, 5-9 for Diluents) |
219 lfsr FSR1,char_I_deco_gas_change | |
220 movff PLUSW1,lo | 224 movff PLUSW1,lo |
221 rcall gaslist_calc_mod ; Compute MOD into WREG | 225 rcall gaslist_calc_mod ; Compute MOD into WREG |
222 cpfsgt lo | 226 cpfsgt lo |
223 bra gaslist_strcat_4 | 227 bra gaslist_strcat_4 |
224 call TFT_warnings_color ; Turn red if bigger | 228 call TFT_warnings_color ; Turn red if bigger |
328 addlw .5 ; Yes, adjust offset | 332 addlw .5 ; Yes, adjust offset |
329 clrf PLUSW1 ; Disable gas | 333 clrf PLUSW1 ; Disable gas |
330 bra gaslist_cleanup_list ; Loop until only one "first gas" is left | 334 bra gaslist_cleanup_list ; Loop until only one "first gas" is left |
331 | 335 |
332 gaslist_cleanup_list5: | 336 gaslist_cleanup_list5: |
333 lfsr FSR1,char_I_deco_gas_change | 337 ; Read switch depth |
338 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 | |
339 btfss ccr_diluent_setup ; In CCR-Menu? | |
340 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases | |
334 decf lo_temp,W | 341 decf lo_temp,W |
335 btfsc ccr_diluent_setup ; In CCR-Menu? | 342 btfsc ccr_diluent_setup ; In CCR-Menu? |
336 addlw .5 ; Yes, adjust offset | 343 addlw .5 ; Yes, adjust offset |
337 clrf PLUSW1 ; Set First gas to zero m | 344 clrf PLUSW1 ; Set First gas to zero m |
338 return | 345 return |
414 | 421 |
415 ;---------------------------------------------------------------------------- | 422 ;---------------------------------------------------------------------------- |
416 ; Increment/Decrement switch depth | 423 ; Increment/Decrement switch depth |
417 global gaslist_pDepth | 424 global gaslist_pDepth |
418 gaslist_pDepth: | 425 gaslist_pDepth: |
419 movf gaslist_gas,W | 426 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 |
420 lfsr FSR1,char_I_deco_gas_change | 427 movlw .4 |
428 cpfsgt gaslist_gas ; >4? (-> Diluents) | |
429 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases | |
430 | |
431 movf gaslist_gas,W | |
421 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | 432 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] |
422 | 433 |
423 incf gaslist_O2,F | 434 incf gaslist_O2,F |
424 movlw gaslist_max_change_depth | 435 movlw gaslist_max_change_depth |
425 cpfsgt gaslist_O2 | 436 cpfsgt gaslist_O2 |
431 movff gaslist_O2,PLUSW1 ; Write back to char_I_deco_gas_change[WREG] | 442 movff gaslist_O2,PLUSW1 ; Write back to char_I_deco_gas_change[WREG] |
432 return | 443 return |
433 | 444 |
434 global gaslist_mDepth | 445 global gaslist_mDepth |
435 gaslist_mDepth: | 446 gaslist_mDepth: |
436 movf gaslist_gas,W | 447 lfsr FSR1,char_I_dil_change-.5 ; Setup Diluents-5 |
437 lfsr FSR1,char_I_deco_gas_change | 448 movlw .4 |
449 cpfsgt gaslist_gas ; >4? (-> Diluents) | |
450 lfsr FSR1,opt_OC_bail_gas_change ; Setup OC Gases | |
451 | |
452 movf gaslist_gas,W | |
438 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] | 453 movff PLUSW1,gaslist_O2 ; Read char_I_deco_gas_change[WREG] |
439 | 454 |
440 decf gaslist_O2,F | 455 decf gaslist_O2,F |
441 btfsc STATUS,N | 456 btfsc STATUS,N |
442 clrf gaslist_O2 | 457 clrf gaslist_O2 |
606 gaslist_reset_mod_title2: | 621 gaslist_reset_mod_title2: |
607 rcall gaslist_calc_mod ; Compute MOD into WREG | 622 rcall gaslist_calc_mod ; Compute MOD into WREG |
608 movwf lo ; Copy to lo | 623 movwf lo ; Copy to lo |
609 | 624 |
610 movf gaslist_gas,W ; Compare to switch depth | 625 movf gaslist_gas,W ; Compare to switch depth |
611 lfsr FSR1,char_I_deco_gas_change | 626 lfsr FSR1,char_I_dil_change ; Setup Diluents mH |
627 btfss ccr_diluent_setup ; In CCR-Menu? | |
628 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases | |
612 movf PLUSW1,W | 629 movf PLUSW1,W |
613 cpfslt lo | 630 cpfslt lo |
614 bra gaslist_strcat_4 ; And return... | 631 bra gaslist_strcat_4 ; And return... |
615 call TFT_warnings_color ; Turn red if bigger ! | 632 call TFT_warnings_color ; Turn red if bigger ! |
616 bra gaslist_strcat_4 ; And return... | 633 bra gaslist_strcat_4 ; And return... |
620 gaslist_reset_mod: | 637 gaslist_reset_mod: |
621 rcall gaslist_calc_mod ; Compute MOD | 638 rcall gaslist_calc_mod ; Compute MOD |
622 movwf gaslist_depth | 639 movwf gaslist_depth |
623 | 640 |
624 movf gaslist_gas,W ; Read current gas O2 ratio | 641 movf gaslist_gas,W ; Read current gas O2 ratio |
625 lfsr FSR1,char_I_deco_gas_change | 642 |
643 lfsr FSR1,char_I_dil_change ; Setup Diluents mH | |
644 btfss ccr_diluent_setup ; In CCR-Menu? | |
645 lfsr FSR1,opt_OC_bail_gas_change ; No, setup OC Gases | |
646 | |
626 movff gaslist_depth,PLUSW1 ; And save new change depth | 647 movff gaslist_depth,PLUSW1 ; And save new change depth |
627 return | 648 return |
628 ;---------------------------------------------------------------------------- | 649 ;---------------------------------------------------------------------------- |
629 END | 650 END |