diff --git a/adafruit_fram.py b/adafruit_fram.py index 69340c7..e0e3c24 100755 --- a/adafruit_fram.py +++ b/adafruit_fram.py @@ -207,8 +207,8 @@ def __init__(self, i2c_bus, address=0x50, write_protect=False, 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):