pypicoboot 1.3.1__py3-none-any.whl → 1.4__py3-none-any.whl
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.
- picoboot/__init__.py +1 -1
- picoboot/_version.py +1 -1
- picoboot/picoboot.py +12 -2
- {pypicoboot-1.3.1.dist-info → pypicoboot-1.4.dist-info}/METADATA +1 -1
- {pypicoboot-1.3.1.dist-info → pypicoboot-1.4.dist-info}/RECORD +7 -7
- {pypicoboot-1.3.1.dist-info → pypicoboot-1.4.dist-info}/WHEEL +1 -1
- {pypicoboot-1.3.1.dist-info → pypicoboot-1.4.dist-info}/top_level.txt +0 -0
picoboot/__init__.py
CHANGED
picoboot/_version.py
CHANGED
picoboot/picoboot.py
CHANGED
|
@@ -174,7 +174,7 @@ class PicoBoot:
|
|
|
174
174
|
logger.debug("PicoBoot device initialized.")
|
|
175
175
|
|
|
176
176
|
@classmethod
|
|
177
|
-
def open(cls, vid: int = DEFAULT_VID, pid: list[int] = [DEFAULT_PID_RP2040, DEFAULT_PID_RP2350], serial: Optional[str] = None) -> "PicoBoot":
|
|
177
|
+
def open(cls, vid: int = DEFAULT_VID, pid: list[int] = [DEFAULT_PID_RP2040, DEFAULT_PID_RP2350], serial: Optional[str] = None, slot = -1) -> "PicoBoot":
|
|
178
178
|
logger.info(f"Opening PicoBoot device with VID={vid:04x} and PIDs={[f'{p:04x}' for p in pid]}...")
|
|
179
179
|
class find_vidpids(object):
|
|
180
180
|
|
|
@@ -193,6 +193,13 @@ class PicoBoot:
|
|
|
193
193
|
logger.error("No device found in PICOBOOT mode")
|
|
194
194
|
raise PicoBootNotFoundError("No device found in PICOBOOT mode")
|
|
195
195
|
|
|
196
|
+
if slot >= 0:
|
|
197
|
+
logger.info(f"Looking for device in slot {slot}...")
|
|
198
|
+
if (slot >= len(devices)):
|
|
199
|
+
logger.error("No device found in the specified slot")
|
|
200
|
+
raise PicoBootNotFoundError("No device found in the specified slot")
|
|
201
|
+
devices = [devices[slot]] if slot < len(devices) else []
|
|
202
|
+
|
|
196
203
|
dev = None
|
|
197
204
|
if serial is None:
|
|
198
205
|
logger.info("No serial number provided, using the first device found.")
|
|
@@ -277,7 +284,10 @@ class PicoBoot:
|
|
|
277
284
|
|
|
278
285
|
@property
|
|
279
286
|
def serial_number_str(self) -> str:
|
|
280
|
-
|
|
287
|
+
try:
|
|
288
|
+
s = usb.util.get_string(self.dev, self.dev.iSerialNumber)
|
|
289
|
+
except Exception:
|
|
290
|
+
s = "unknown"
|
|
281
291
|
return s
|
|
282
292
|
|
|
283
293
|
def interface_reset(self) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
picoboot/__init__.py,sha256=
|
|
2
|
-
picoboot/_version.py,sha256=
|
|
3
|
-
picoboot/picoboot.py,sha256=
|
|
1
|
+
picoboot/__init__.py,sha256=c49mZU1EUgBbiMUKo7sLsZE4u1RKmBXjXHmCSgeM5vw,168
|
|
2
|
+
picoboot/_version.py,sha256=tWPsQhFrjT59dLP64luJ8y6WZADnjkMctyD_4fue4Uk,776
|
|
3
|
+
picoboot/picoboot.py,sha256=_4p7rWr8ck-laYc1Jh-HHsqtoNFRVqzHDP46HRcnN4c,26358
|
|
4
4
|
picoboot/picobootmonitor.py,sha256=3msEP2S8ZS7P8QVgKpq9Z9Rcud78XygmG1_0L_OZOvs,2443
|
|
5
5
|
picoboot/utils.py,sha256=SjpAoPZrgyD9Ws7NIFVBHt0zPOb8Lpu2_lsmfeT2rXE,1083
|
|
6
6
|
picoboot/core/__init__.py,sha256=c1kJprnljn0eP1NR3wEw-wJSCSxSRF3DA2jF5MowHXk,57
|
|
@@ -8,7 +8,7 @@ picoboot/core/enums.py,sha256=ugXS-dbdnusLib_ge0vT1OugHVG9ZjJfpUR073MhwdQ,1353
|
|
|
8
8
|
picoboot/core/exceptions.py,sha256=AXilq0ViaXyA6Ls9aGx6DHE9TQyPacQbwnHBXgFD3EQ,909
|
|
9
9
|
picoboot/core/log.py,sha256=XWtN_hgmOtvpDMGDg-9f2BDLUe8elqUAbWti5yCJAA0,1768
|
|
10
10
|
picoboot/tools/picotool.py,sha256=e2xjIxP5UZn9yfjxUWkJXq6KQHyw4YsGbuQbTauo0-Q,94
|
|
11
|
-
pypicoboot-1.
|
|
12
|
-
pypicoboot-1.
|
|
13
|
-
pypicoboot-1.
|
|
14
|
-
pypicoboot-1.
|
|
11
|
+
pypicoboot-1.4.dist-info/METADATA,sha256=R9YQ9fgWbr5z2ITgJtM-BsRqgRQ8uSuyiyBLVcOY5Gs,41109
|
|
12
|
+
pypicoboot-1.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
13
|
+
pypicoboot-1.4.dist-info/top_level.txt,sha256=sjegZQO5-kQdFOXXJHm0P7Hg1Nw4Ri0WKHnRYDTsa4I,9
|
|
14
|
+
pypicoboot-1.4.dist-info/RECORD,,
|
|
File without changes
|