comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 647:e6ac142e82b0

New Diluent Submenu in Divemode
author heinrichsweikamp
date Sun, 07 Oct 2012 21:31:19 +0200
parents 3b50c9949b84
children 8c01edcf57fc
comparison
equal deleted inserted replaced
646:06ffc99a405f 647:e6ac142e82b0
2024 btfss simulatormode_active ; do not disable in simulator mode! 2024 btfss simulatormode_active ; do not disable in simulator mode!
2025 call disable_rs232 ; Disable RS232 2025 call disable_rs232 ; Disable RS232
2026 2026
2027 ; Read Start Gas and configure char_I_He_ratio, char_I_O2_ratio and char_I_N2_ratio 2027 ; Read Start Gas and configure char_I_He_ratio, char_I_O2_ratio and char_I_N2_ratio
2028 set_first_gas: 2028 set_first_gas:
2029 btfsc FLAG_const_ppO2_mode
2030 bra set_first_gas_ccr ; In CCR mode
2029 read_int_eeprom d'33' ; Read byte (stored in EEDATA) 2031 read_int_eeprom d'33' ; Read byte (stored in EEDATA)
2030 movff EEDATA,active_gas ; Read start gas (1-5) 2032 movff EEDATA,active_gas ; Read start gas (1-5)
2031 movff EEDATA,char_I_current_gas 2033 movff EEDATA,char_I_current_gas
2032 2034
2033 decf active_gas,W ; Gas 0-4 2035 decf active_gas,W ; Gas 0-4
2052 2054
2053 ; Configure gaslist_active flag register 2055 ; Configure gaslist_active flag register
2054 read_int_eeprom d'27' 2056 read_int_eeprom d'27'
2055 movff EEDATA, gaslist_active 2057 movff EEDATA, gaslist_active
2056 return 2058 return
2059
2060 set_first_gas_ccr: ; Set Diluent
2061 movlw .1
2062 movwf active_diluent ; Always start with Diluent 1 (EEPROM 96/97)
2063 read_int_eeprom d'97' ; Read He
2064 movff EEDATA,char_I_He_ratio ; And copy into hold register
2065 read_int_eeprom d'96' ; Read O2
2066 movff EEDATA, char_I_O2_ratio ; O2 ratio
2067 movff char_I_He_ratio, wait_temp ; copy into bank1 register
2068 bsf STATUS,C ; Borrow bit
2069 movlw d'100' ; 100%
2070 subfwb wait_temp,W ; minus He
2071 bsf STATUS,C ; Borrow bit
2072 subfwb EEDATA,W ; minus O2
2073 movff WREG, char_I_N2_ratio ; = N2!
2074 return