comparison src/divemode.asm @ 274:9347893b74ce

BUGFIX: Fast Gas change near the ppO2 limit could cause switching to a non-available Gas #0
author heinrichsweikamp
date Tue, 05 May 2015 14:58:16 +0200
parents 5b4ef0b9090d
children 653a3ab08062
comparison
equal deleted inserted replaced
273:12ee30cbced9 274:9347893b74ce
892 return 892 return
893 893
894 gas_switched_common: 894 gas_switched_common:
895 bcf divemode_gaschange ; Clear flag 895 bcf divemode_gaschange ; Clear flag
896 896
897 tstfsz menupos ; menupos=0?
898 bra $+4 ; No
899 return ; Yes, do not switch gas (There is no Gas #0 !)
900
897 decf menupos,W ; 1-5 -> 0-4 901 decf menupos,W ; 1-5 -> 0-4
898 btfss FLAG_ccr_mode ; Choose OC Gases 902 btfss FLAG_ccr_mode ; Choose OC Gases
899 rcall setup_gas_registers ; With WREG=Gas 0-4 903 rcall setup_gas_registers ; With WREG=Gas 0-4
900 btfsc FLAG_ccr_mode ; Choose CC Diluents 904 btfsc FLAG_ccr_mode ; Choose CC Diluents
901 rcall setup_dil_registers ; With WREG=Gas 0-4 905 rcall setup_dil_registers ; With WREG=Gas 0-4