comparison code_part1/OSTC_code_asm_part1/adc_rtc.asm @ 665:259e4c1bf3c2

grey-out TTS and ceiling after gas change (until new plan is ready)
author heinrichsweikamp
date Wed, 14 Nov 2012 12:39:39 +0100
parents f87205426add
children 82f71a73f450
comparison
equal deleted inserted replaced
664:9c13bf8a3033 665:259e4c1bf3c2
89 bsf enter_error_sleep ; enter error routine 89 bsf enter_error_sleep ; enter error routine
90 ; Continue with rest of routine 90 ; Continue with rest of routine
91 91
92 get_battery_voltage4: 92 get_battery_voltage4:
93 ; check if the battery control memory needs to be initialised! 93 ; check if the battery control memory needs to be initialised!
94 bcf initialize_battery1 ; clear check-flags 94 bcf initialize_battery1 ; clear check-flag
95 bcf initialize_battery2 95
96
97 read_int_eeprom d'40' ; get lowest battery voltage seen in mV 96 read_int_eeprom d'40' ; get lowest battery voltage seen in mV
98 movff EEDATA,sub_b+0 97 movff EEDATA,sub_b+0
99 read_int_eeprom d'41' 98 read_int_eeprom d'41'
100 movff EEDATA,sub_b+1 99 movff EEDATA,sub_b+1
101 100
111 movwf sub_a+0 110 movwf sub_a+0
112 movlw HIGH d'4500' 111 movlw HIGH d'4500'
113 movwf sub_a+1 112 movwf sub_a+1
114 call sub16 ; sub_c = sub_a - sub_b 113 call sub16 ; sub_c = sub_a - sub_b
115 btfss neg_flag ; neg_flag=1 if eeprom40:41 < 4500 114 btfss neg_flag ; neg_flag=1 if eeprom40:41 < 4500
116 bsf initialize_battery2 ; battery need to be initialised 115 bsf initialize_battery1 ; battery need to be initialised
117 116
118 btfss initialize_battery1 ; battery need to be initialised? 117 btfss initialize_battery1 ; battery need to be initialised?
119 bra get_battery_no_init ; No, we have already valid values, just check for new extremas
120
121 btfss initialize_battery2 ; battery need to be initialised?
122 bra get_battery_no_init ; No, we have already valid values, just check for new extremas 118 bra get_battery_no_init ; No, we have already valid values, just check for new extremas
123 119
124 get_battery_voltage_reset: 120 get_battery_voltage_reset:
125 ; Init EEPROM for battery control 121 ; Init EEPROM for battery control
126 ; Reset lowest battery seen 122 ; Reset lowest battery seen