comparison code_part1/OSTC_code_asm_part1/surfmode.asm @ 703:39e02673db4c

some cleanup
author heinrichsweikamp
date Sun, 17 Mar 2013 13:33:17 +0100
parents 6e456a6398e0
children 91ae251d379f
comparison
equal deleted inserted replaced
702:e6ff73e88e45 703:39e02673db4c
308 308
309 ; Disable when no USB power is attached 309 ; Disable when no USB power is attached
310 btfsc RCSTA,7 ; RS232 already disabled 310 btfsc RCSTA,7 ; RS232 already disabled
311 call disable_rs232 ; No, disable UART module 311 call disable_rs232 ; No, disable UART module
312 312
313 clrf EEADRH
313 btfss charge_done ; charge done? 314 btfss charge_done ; charge done?
314 bra test_charger2 ; No, add incomplete cycle! 315 bra test_charger2 ; No, add incomplete cycle!
315 316
316 ; Yes, store all data for complete cycle 317 ; Yes, store all data for complete cycle
317 bcf charge_started ; Clear flag 318 bcf charge_started ; Clear flag
406 movff EEDATA,temp1 ; Low byte 407 movff EEDATA,temp1 ; Low byte
407 read_int_eeprom d'51' ; Read byte (stored in EEDATA) 408 read_int_eeprom d'51' ; Read byte (stored in EEDATA)
408 movff EEDATA,temp2 ; high byte 409 movff EEDATA,temp2 ; high byte
409 bcf STATUS,C 410 bcf STATUS,C
410 movlw d'1' 411 movlw d'1'
411 addwf temp1 412 addwf temp1,F
412 movlw d'0' 413 movlw d'0'
413 addwfc temp2 414 addwfc temp2,F
414 movff temp1,EEDATA 415 movff temp1,EEDATA
415 write_int_eeprom d'50' ; write byte stored in EEDATA 416 write_int_eeprom d'50' ; write byte stored in EEDATA
416 movff temp2,EEDATA 417 movff temp2,EEDATA
417 write_int_eeprom d'51' ; write byte stored in EEDATA 418 write_int_eeprom d'51' ; write byte stored in EEDATA
418 return 419 return
425 WAITMS d'100' 426 WAITMS d'100'
426 bcf LED_red 427 bcf LED_red
427 WAITMS d'100' 428 WAITMS d'100'
428 bsf LED_red 429 bsf LED_red
429 bsf charge_done ; Charge cycle finished 430 bsf charge_done ; Charge cycle finished
431 bsf charge_started ; Charger started in CV mode
430 return 432 return
431 433
432 show_cc_active: ; CC mode 434 show_cc_active: ; CC mode
433 ; Enable only when USB power attached 435 ; Enable only when USB power attached
434 btfss RCSTA,7 ; RS232 already enabled? 436 btfss RCSTA,7 ; RS232 already enabled?