Call unlock() without any prior calls to try_lock(). Example on a linux machine using an MCP2221:
user$ python3
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> i2c = board.I2C()
>>> i2c.unlock()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/blinka/lib/python3.8/site-packages/adafruit_blinka/__init__.py", line 76, in unlock
raise ValueError("Not locked")
ValueError: Not locked
>>>
For contrast, here's the same thing on a native CP board:
Board Name
Any Blinka board that supports busio
Steps
Call
unlock()
without any prior calls totry_lock()
. Example on a linux machine using an MCP2221:For contrast, here's the same thing on a native CP board:
Description
No response
Additional information
CircuitPython
busio
documentation: https://docs.circuitpython.org/en/latest/shared-bindings/busio/The native CP behavior seems to return a
None
type when callingunlock()
regardless of current state: