From: Vladimir Shtarev <73039810+DarkMechanikum@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:50:18 +0000 (+0300) Subject: Merge branch 'adafruit:main' into main X-Git-Tag: 8.46.0~2^2~2 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/9de26f1535a5cce11156afd3816c00758cf03a38?hp=6b2d57a752d03e6cbba71a7fdc614a93e9673b32 Merge branch 'adafruit:main' into main --- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3cedce..a0eb8f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/* diff --git a/src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py b/src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py index 90ed49e..2dcc539 100644 --- a/src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py +++ b/src/adafruit_blinka/microcontroller/mcp2221/mcp2221.py @@ -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)