comparison code_part1/OSTC_code_asm_part1/adc_rtc.asm @ 297:ceedf078b2d8

Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
author Heinrichsweikamp
date Fri, 29 Apr 2011 20:17:32 +0200
parents 1efd59d689f8
children 2144f19fa1eb
comparison
equal deleted inserted replaced
296:2986e7cdb68c 297:ceedf078b2d8
118 btfss initialize_battery1 ; battery need to be initialised? 118 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 119 bra get_battery_no_init ; No, we have already valid values, just check for new extremas
120 120
121 btfss initialize_battery2 ; battery need to be initialised? 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 122 bra get_battery_no_init ; No, we have already valid values, just check for new extremas
123 123
124 get_battery_voltage_reset:
124 ; Init EEPROM for battery control 125 ; Init EEPROM for battery control
125 ; Reset lowest battery seen 126 ; Reset lowest battery seen
126 movlw LOW d'4200' ; reset to 4.2V 127 movlw LOW d'4200' ; reset to 4.2V
127 movwf EEDATA 128 movwf EEDATA
128 write_int_eeprom d'40' 129 write_int_eeprom d'40'
230 movwf secs 231 movwf secs
231 movlw .00 232 movlw .00
232 movwf mins 233 movwf mins
233 movlw .12 234 movlw .12
234 movwf hours 235 movwf hours
235 movlw .10 236 movlw .5
236 movwf day 237 movwf day
237 movlw .4 238 movlw .5
238 movwf month 239 movwf month
239 movlw .11 240 movlw .11
240 movwf year 241 movwf year
241 bsf PIE1, TMR1IE 242 bsf PIE1, TMR1IE
242 return 243 return
244
245 reset_battery_stats:
246 bcf uart_reset_battery_stats ; Clear flag
247 bcf PIE1,RCIE ; no interrupt for UART
248 call rs232_get_byte ; Get Byte
249 bcf PIR1,RCIF ; clear flag
250
251 btfsc rs232_recieve_overflow ; Byte received?
252 bra reset_battery_stats_exit ; No, exit
253 movlw 'f'
254 cpfseq RCREG ; Really reset statistics?
255 bra reset_battery_stats_exit ; No, exit
256 call rs232_get_byte ; Get byte
257 bcf PIR1,RCIF ; clear flag
258
259 btfsc rs232_recieve_overflow ; Byte received?
260 bra reset_battery_stats_exit ; No, exit
261 movlw 'f'
262 cpfseq RCREG ; Really reset statistics?
263 bra reset_battery_stats_exit ; No, exit
264 ; Yes, Reset now.
265 rcall get_battery_voltage_reset ; Reset Statistics
266 movlw 'f'
267 movwf TXREG
268 call rs232_wait_tx ; Wait for uart
269
270 reset_battery_stats_exit:
271 bsf PIE1,RCIE ; re-enable interrupt for UART
272 goto surfloop_loop ; return to surface loop