File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -276,13 +276,15 @@ def _read_8(self, address):
276
276
# Read and return a byte from the specified 16-bit register address.
277
277
with self ._device as i2c :
278
278
result = bytearray (1 )
279
- i2c .write_then_readinto (bytes ([(address >> 8 ) & 0xFF , address & 0xFF ]), result )
279
+ i2c .write (bytes ([(address >> 8 ) & 0xFF , address & 0xFF ]))
280
+ i2c .readinto (result )
280
281
return result [0 ]
281
282
282
283
def _read_16 (self , address ):
283
284
# Read and return a 16-bit unsigned big endian value read from the
284
285
# specified 16-bit register address.
285
286
with self ._device as i2c :
286
287
result = bytearray (2 )
287
- i2c .write_then_readinto (bytes ([(address >> 8 ) & 0xFF , address & 0xFF ]), result )
288
+ i2c .write (bytes ([(address >> 8 ) & 0xFF , address & 0xFF ]))
289
+ i2c .readinto (result )
288
290
return (result [0 ] << 8 ) | result [1 ]
You can’t perform that action at this time.
0 commit comments