Merge pull request #9 from jerryneedell/jerryn_issue_8

fix issue#8 -- RPI  I/O error
This commit is contained in:
Melissa LeBlanc-Williams 2019-03-07 13:39:47 -08:00 committed by GitHub
commit d49b7bf4f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -207,8 +207,8 @@ class FRAM_I2C(FRAM):
dev_id_addr = 0xF8 >> 1
read_buf = bytearray(3)
with i2cdev(i2c_bus, dev_id_addr) as dev_id:
dev_id.write(bytearray([(address << 1)]), stop=False)
dev_id.readinto(read_buf)
dev_id.write_then_readinto(bytearray([(address << 1)]),
read_buf, stop=False)
manf_id = (((read_buf[0] << 4) +(read_buf[1] >> 4)))
prod_id = (((read_buf[1] & 0x0F) << 8) + read_buf[2])
if (manf_id != _I2C_MANF_ID) and (prod_id != _I2C_PROD_ID):