]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Merge branch 'adafruit:main' into main
authorVladimir Shtarev <73039810+DarkMechanikum@users.noreply.github.com>
Fri, 5 Jul 2024 11:50:18 +0000 (14:50 +0300)
committerGitHub <noreply@github.com>
Fri, 5 Jul 2024 11:50:18 +0000 (14:50 +0300)
.github/workflows/release.yml
src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py

index a3cedce02ca7bcd9a14069e9dc92b816d6399107..a0eb8f585040b9b917433fced8551f7ff75c3f37 100644 (file)
@@ -35,5 +35,5 @@ jobs:
         for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
             sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file;
         done;
-        python -m build -s
+        python -m build
         twine upload dist/*
index 90ed49e50c046ba10d48259a1e4e96a1b6a6b6a3..2dcc5394718eb79efd25a5c0706b79187e015b97 100644 (file)
@@ -248,7 +248,7 @@ class MCP2221:
         for _ in range(MCP2221_RETRY_MAX):
             status = self._i2c_status()
             if status[20] & MASK_ADDR_NACK:
-                raise RuntimeError("I2C slave address was NACK'd")
+                raise OSError("I2C slave address was NACK'd")
             usb_cmd_status = status[8]
             if usb_cmd_status == 0:
                 break
@@ -360,7 +360,8 @@ class MCP2221:
             # try a write
             try:
                 self.i2c_writeto(addr, b"\x00")
-            except RuntimeError:  # no reply!
+            except OSError:  # no reply!
+                # We got a NACK, which could be correct
                 continue
             # store if success
             found.append(addr)