Mercurial > public > hwos_code
comparison src/divemode.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 | c34516c99ca8 |
children | 24b3fd59e61f |
comparison
equal
deleted
inserted
replaced
96:a4bff632e97b | 97:53a99a2dc6a1 |
---|---|
792 banksel common | 792 banksel common |
793 return | 793 return |
794 | 794 |
795 global setup_dil_registers | 795 global setup_dil_registers |
796 setup_dil_registers: ; With WREG=dil 0-4 | 796 setup_dil_registers: ; With WREG=dil 0-4 |
797 btfsc is_bailout | |
798 return ; Ignore in bailout | |
797 lfsr FSR1,opt_dil_O2_ratio+0 | 799 lfsr FSR1,opt_dil_O2_ratio+0 |
798 movff PLUSW1,char_I_O2_ratio ; O2 (For ppO2 calculations) | 800 movff PLUSW1,char_I_O2_ratio ; O2 (For ppO2 calculations) |
799 lfsr FSR1,opt_dil_He_ratio+0 | 801 lfsr FSR1,opt_dil_He_ratio+0 |
800 movff PLUSW1,char_I_He_ratio ; He | 802 movff PLUSW1,char_I_He_ratio ; He |
801 incf WREG,W ; Gas# 1-5 | 803 incf WREG,W ; Gas# 1-5 |
802 movff WREG,char_I_current_gas ; Set gas | 804 movff WREG,char_I_current_gas ; Set gas |
803 movff WREG,active_gas ; Set for logbook and display | 805 movff WREG,active_gas ; Set for logbook and display |
806 movff WREG,active_diluent ; As a backup when switching back from Bailout to CCR | |
804 banksel char_I_O2_ratio | 807 banksel char_I_O2_ratio |
805 movf char_I_O2_ratio,W ; Add O2... | 808 movf char_I_O2_ratio,W ; Add O2... |
806 addwf char_I_He_ratio,W ; ...and He... | 809 addwf char_I_He_ratio,W ; ...and He... |
807 sublw .100 ; ...subtract both from 100 | 810 sublw .100 ; ...subtract both from 100 |
808 movwf char_I_N2_ratio ; -> N2! | 811 movwf char_I_N2_ratio ; -> N2! |
968 bra check_gas_common2 ; No | 971 bra check_gas_common2 ; No |
969 return ; Yes, skip test for active gas | 972 return ; Yes, skip test for active gas |
970 check_gas_common2: | 973 check_gas_common2: |
971 decf WREG,W ; 0-4 | 974 decf WREG,W ; 0-4 |
972 movwf hi ; Save tested gas 0-4 | 975 movwf hi ; Save tested gas 0-4 |
973 lfsr FSR1,char_I_deco_gas_change | 976 lfsr FSR1,opt_OC_bail_gas_change |
974 movff PLUSW1,lo ; Change depth into lo | 977 movff PLUSW1,lo ; Change depth into lo |
975 movlw minimum_change_depth | 978 movlw minimum_change_depth |
976 cpfsgt lo ; Change depth>minimum_change_depth? | 979 cpfsgt lo ; Change depth>minimum_change_depth? |
977 return ; No, Change depth not deep enough, skip! | 980 return ; No, Change depth not deep enough, skip! |
978 movf xC+0,W ; load depth in m into WREG | 981 movf xC+0,W ; load depth in m into WREG |