pypicoboot 1.1__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pypicoboot-1.1 → pypicoboot-1.1.2}/PKG-INFO +1 -1
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/_version.py +1 -1
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/picoboot.py +9 -8
- {pypicoboot-1.1 → pypicoboot-1.1.2}/pypicoboot.egg-info/PKG-INFO +1 -1
- {pypicoboot-1.1 → pypicoboot-1.1.2}/LICENSE +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/README.md +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/__init__.py +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/core/__init__.py +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/core/enums.py +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/picobootmonitor.py +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/tools/picotool.py +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/picoboot/utils.py +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/pypicoboot.egg-info/SOURCES.txt +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/pypicoboot.egg-info/dependency_links.txt +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/pypicoboot.egg-info/requires.txt +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/pypicoboot.egg-info/top_level.txt +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/pyproject.toml +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/setup.cfg +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/setup.py +0 -0
- {pypicoboot-1.1 → pypicoboot-1.1.2}/tests/test_000_init.py +0 -0
|
@@ -158,22 +158,23 @@ class PicoBoot:
|
|
|
158
158
|
if disconnected:
|
|
159
159
|
self.__device.close()
|
|
160
160
|
|
|
161
|
-
self.__observer = PicoBootObserver(self
|
|
161
|
+
self.__observer = PicoBootObserver(self)
|
|
162
162
|
self.__monitor = PicoBootMonitor(device=self.dev, cls_callback=self.__observer)
|
|
163
163
|
|
|
164
164
|
@classmethod
|
|
165
165
|
def open(cls, vid: int = DEFAULT_VID, pid: list[int] = [DEFAULT_PID_RP2040, DEFAULT_PID_RP2350], serial: Optional[str] = None) -> "PicoBoot":
|
|
166
|
-
class
|
|
166
|
+
class find_vidpids(object):
|
|
167
167
|
|
|
168
|
-
def __init__(self, pids: list[int]):
|
|
168
|
+
def __init__(self, vid: int, pids: list[int]):
|
|
169
|
+
self._vid = vid
|
|
169
170
|
self._pids = pids
|
|
170
171
|
|
|
171
172
|
def __call__(self, device: usb.core.Device) -> bool:
|
|
172
|
-
if device.idProduct in self._pids:
|
|
173
|
+
if device.idProduct in self._pids and device.idVendor == self._vid:
|
|
173
174
|
return True
|
|
174
175
|
return False
|
|
175
176
|
|
|
176
|
-
devices = usb.core.find(find_all=True, custom_match=
|
|
177
|
+
devices = usb.core.find(find_all=True, custom_match=find_vidpids(vid, pid))
|
|
177
178
|
devices = list(devices) if devices is not None else []
|
|
178
179
|
if not devices:
|
|
179
180
|
raise PicoBootError("No device found in PICOBOOT mode")
|
|
@@ -196,8 +197,8 @@ class PicoBoot:
|
|
|
196
197
|
# Ensure active configuration
|
|
197
198
|
# macOS does not allow detach_kernel_driver, and often returns Access Denied
|
|
198
199
|
try:
|
|
199
|
-
if dev.is_kernel_driver_active(
|
|
200
|
-
dev.detach_kernel_driver(
|
|
200
|
+
if dev.is_kernel_driver_active(1):
|
|
201
|
+
dev.detach_kernel_driver(1)
|
|
201
202
|
except usb.core.USBError:
|
|
202
203
|
# If it fails, we continue anyway. It's normal on macOS.
|
|
203
204
|
pass
|
|
@@ -205,7 +206,7 @@ class PicoBoot:
|
|
|
205
206
|
# Also fine on backends that don't implement the function
|
|
206
207
|
pass
|
|
207
208
|
|
|
208
|
-
dev.set_configuration()
|
|
209
|
+
#dev.set_configuration()
|
|
209
210
|
cfg = dev.get_active_configuration()
|
|
210
211
|
|
|
211
212
|
intf = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|