comparison src/i2c.asm @ 235:23311219dacc

under construction: new hardware_flag to configure different hardware versions
author heinrichsweikamp
date Wed, 25 Feb 2015 16:49:59 +0100
parents 4147cd5c0c8e
children 653a3ab08062
comparison
equal deleted inserted replaced
234:57155164faad 235:23311219dacc
401 rcall WaitMSSP 401 rcall WaitMSSP
402 return 402 return
403 403
404 global lt2942_get_status 404 global lt2942_get_status
405 lt2942_get_status: ; Read status register 405 lt2942_get_status: ; Read status register
406 bcf cr_hardware ; Clear flag 406 bcf rechargeable ; Clear flag
407 clrf i2c_temp 407 clrf i2c_temp
408 movlw 0x00 ; Point to Status reg 408 movlw 0x00 ; Point to Status reg
409 call I2C_TX_GAUGE 409 call I2C_TX_GAUGE
410 call I2C_RX_GAUGE 410 call I2C_RX_GAUGE
411 movff SSP1BUF,WREG 411 movff SSP1BUF,WREG
412 btfss WREG,7 ; 2942 found? 412 btfss WREG,7 ; 2942 found?
413 bsf cr_hardware ; Yes, set flag 413 bsf rechargeable ; Yes, set flag
414 bsf SSP1CON2,PEN ; Stop condition 414 bsf SSP1CON2,PEN ; Stop condition
415 rcall WaitMSSP 415 rcall WaitMSSP
416 return 416 return
417 417
418 418