]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py
If the number of retries is exceeded raise an error
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / mcp2221 / mcp2221.py
index 0275e66b92d7f0da4ff57fb50b476415eced4aac..e01eb7b1e59f5222ebd4edf31eafb740688510fd 100644 (file)
@@ -285,6 +285,8 @@ class MCP2221:
                     continue
                 if resp[2] in (RESP_READ_COMPL, RESP_READ_PARTIAL):
                     break
+            else:
+                raise RuntimeError("I2C read error: max retries reached.")
 
             # move data into buffer
             chunk = min(end - start, 60)