Skip to content

Commit d49b7bf

Browse files
authored
Merge pull request #9 from jerryneedell/jerryn_issue_8
fix issue#8 -- RPI I/O error
2 parents 7d8369f + d2aea8d commit d49b7bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_fram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def __init__(self, i2c_bus, address=0x50, write_protect=False,
207207
dev_id_addr = 0xF8 >> 1
208208
read_buf = bytearray(3)
209209
with i2cdev(i2c_bus, dev_id_addr) as dev_id:
210-
dev_id.write(bytearray([(address << 1)]), stop=False)
211-
dev_id.readinto(read_buf)
210+
dev_id.write_then_readinto(bytearray([(address << 1)]),
211+
read_buf, stop=False)
212212
manf_id = (((read_buf[0] << 4) +(read_buf[1] >> 4)))
213213
prod_id = (((read_buf[1] & 0x0F) << 8) + read_buf[2])
214214
if (manf_id != _I2C_MANF_ID) and (prod_id != _I2C_PROD_ID):

0 commit comments

Comments
 (0)