File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -340,16 +340,16 @@ def _read_u8(self, address):
340340 # Read an 8-bit unsigned value from the specified 8-bit address.
341341 with self ._device as i2c :
342342 self ._BUFFER [0 ] = (address | _COMMAND_BIT ) & 0xFF
343- i2c .write (self ._BUFFER , end = 1 , stop = False )
344- i2c . readinto ( self . _BUFFER , end = 1 )
343+ i2c .write_then_readinto (self ._BUFFER , self . _BUFFER ,
344+ out_end = 1 , in_end = 1 )
345345 return self ._BUFFER [0 ]
346346
347347 def _read_u16 (self , address ):
348348 # Read a 16-bit unsigned value from the specified 8-bit address.
349349 with self ._device as i2c :
350350 self ._BUFFER [0 ] = (address | _COMMAND_BIT ) & 0xFF
351- i2c .write (self ._BUFFER , end = 1 , stop = False )
352- i2c . readinto ( self . _BUFFER , end = 2 )
351+ i2c .write_then_readinto (self ._BUFFER , self . _BUFFER ,
352+ out_end = 1 , in_end = 2 )
353353 return (self ._BUFFER [1 ] << 8 ) | self ._BUFFER [0 ]
354354
355355 def _write_u8 (self , address , val ):
You can’t perform that action at this time.
0 commit comments