Merge pull request #5 from tannewt/remove_stop
Remove stop kwarg and use write_then_readinto.
This commit is contained in:
commit
4e70f39b51
1 changed files with 2 additions and 2 deletions
|
|
@ -74,7 +74,7 @@ def _eeprom_i2c_wait(i2c, i2c_addr, mem_addr, timeout=1.0):
|
||||||
timestamp = time.monotonic()
|
timestamp = time.monotonic()
|
||||||
while time.monotonic() < timestamp + timeout:
|
while time.monotonic() < timestamp + timeout:
|
||||||
try:
|
try:
|
||||||
i2c.writeto(i2c_addr, bytearray([mem_addr]), end=1, stop=False)
|
i2c.writeto(i2c_addr, bytearray([mem_addr]), end=1)
|
||||||
return True
|
return True
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
@ -113,7 +113,7 @@ def _eeprom_i2c_read_byte(i2c, i2c_addr, mem_addr, timeout=1.0):
|
||||||
|
|
||||||
# Finish the read
|
# Finish the read
|
||||||
buf = bytearray(1)
|
buf = bytearray(1)
|
||||||
i2c.readfrom_into(i2c_addr, buf)
|
i2c.writeto_then_readfrom(i2c_addr, bytearray([mem_addr]), buf)
|
||||||
|
|
||||||
return True, buf
|
return True, buf
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue