You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If port in non-smb_mode, successfully reads the loop continues when it should attempt to write. I modified the code to work as intended (I think) with comments below.
foraddrinrange(cls.HIGHEST_I2C_SLAVE_ADDRESS+1):
port=i2c.get_port(addr)
ifsmb_mode:
try:
ifaddrincls.SMB_READ_RANGE:
port.read(0)
slaves.append('R')
else:
port.write([])
slaves.append('W')
exceptI2cNackError:
slaves.append('.')
else:
try:
port.read(0)
slaves.append('R')
# continue <<< move to exceptionexceptI2cNackError:
slaves.append('.')
continue# pass <<< deletetry:
port.write([])
# slaves.append('W') <<< deleteslaves[-1] ='W'# overwrite the R with WexceptI2cNackError:
slaves.append('.')
The text was updated successfully, but these errors were encountered:
Best not to make any changes on this yet. There seems to be an issue with a zero byte read, port.read(0). If one is to believe the doc strings for read() (Read one or more bytes....) this function does not support zero bytes but the default is readlen = int 0. Something doesn't like port.read(0). I'm not sure if it is pyftdi, the ftdi driver, the device I am communicating with or my protocol analyzer. Changing to port.read(1) seems to make the problem go away. I may dig into this more later but for now I have a work-around.
If port in non-smb_mode, successfully reads the loop continues when it should attempt to write. I modified the code to work as intended (I think) with comments below.
The text was updated successfully, but these errors were encountered: