Skip to content

Commit a490307

Browse files
committed
Merge branch 'cdc' into moat
2 parents c2fa512 + 7ad8be4 commit a490307

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

.github/workflows/build_packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
if: vars.MICROPY_PUBLISH_MIP_INDEX && github.event_name == 'push' && ! github.event.deleted
2424
run: source tools/ci.sh && ci_push_package_index
2525
- name: Upload packages as artifact
26-
uses: actions/upload-artifact@v3
26+
uses: actions/upload-artifact@v4
2727
with:
2828
name: packages-${{ github.sha }}
2929
path: ${{ env.PACKAGE_INDEX_PATH }}

micropython/mip/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
metadata(version="0.4.0", description="On-device package installer for network-capable boards")
1+
metadata(version="0.4.1", description="On-device package installer for network-capable boards")
22

33
require("requests")
44

micropython/mip/mip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _install_package(package, index, target, version, mpy):
171171
def install(package, index=None, target=None, version=None, mpy=True):
172172
if not target:
173173
for p in sys.path:
174-
if p.endswith("/lib"):
174+
if not p.startswith("/rom") and p.endswith("/lib"):
175175
target = p
176176
break
177177
else:

micropython/usb/usb-device-cdc/usb/device/cdc.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,9 @@ def _rd_cb(self, ep, res, num_bytes):
350350
###
351351

352352
def write(self, buf):
353-
# use a memoryview to track how much of 'buf' we've written so far
354-
# (unfortunately, this means a 1 block allocation for each write, but it's otherwise allocation free.)
355353
start = time.ticks_ms()
356-
mv = memoryview(buf)
354+
# use a memoryview to track partial writes
355+
mv = buf
357356
while True:
358357
# Keep pushing buf into _wb into it's all gone
359358
nbytes = self._wb.write(mv)
@@ -362,6 +361,8 @@ def write(self, buf):
362361
if nbytes == len(mv):
363362
return len(buf) # Success
364363

364+
if mv is buf:
365+
mv = memoryview(buf)
365366
mv = mv[nbytes:]
366367

367368
# check for timeout

0 commit comments

Comments
 (0)