diff --git a/vendor/micropython/micropython.mjs b/vendor/micropython/micropython.mjs index fb63b43..2631899 100755 --- a/vendor/micropython/micropython.mjs +++ b/vendor/micropython/micropython.mjs @@ -4381,7 +4381,9 @@ var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => { var _mp_js_random_u32 = () => globalThis.crypto.getRandomValues(new Uint32Array(1))[0]; - var _mp_js_ticks_ms = () => Date.now() - MP_JS_EPOCH; + var _mp_js_ticks_ms = () => (performance.now() - MP_JS_EPOCH) | 0; + + var _mp_js_ticks_us = () => ((performance.now() - MP_JS_EPOCH) * 1000) | 0; var _mp_js_time_ms = () => Date.now(); @@ -5210,13 +5212,28 @@ var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => { var _omnipython_sleep_ms = (ms) => Asyncify.handleSleep((wakeUp) => setTimeout(wakeUp, Math.max(0, ms))); - var _omnipython_timer_cancel = (id) => { const t=omnipython_state.timers.get(id); if (t) { t.periodic ? clearInterval(t.handle) : clearTimeout(t.handle); omnipython_state.timers.delete(id); } }; + + var omnipython_drop_fired = (id) => { + const fired = omnipython_state.firedTimers; + for (let i = fired.length - 1; i >= 0; i--) if (fired[i] === id) fired.splice(i, 1); + }; + var _omnipython_timer_cancel = (id) => { const t=omnipython_state.timers.get(id); if (t) { t.periodic ? clearInterval(t.handle) : clearTimeout(t.handle); omnipython_state.timers.delete(id); } omnipython_drop_fired(id); }; - var _omnipython_timer_poll = () => omnipython_state.firedTimers.length ? omnipython_state.firedTimers.shift() : -1; + var _omnipython_timer_poll = () => { + const state = omnipython_state; + if (!state.firedTimers.length) return -1; + const id = state.firedTimers.shift(); + state.timerDeliveries.push({id, at:performance.now()}); + if (state.timerDeliveries.length > 512) state.timerDeliveries.shift(); + return id; + }; + var _omnipython_timer_start = (id, delay, periodic) => { const state = omnipython_state; - const old = state.timers.get(id); if (old) clearTimeout(old.handle); + const old = state.timers.get(id); if (old) old.periodic ? clearInterval(old.handle) : clearTimeout(old.handle); + // A restart drops the old timer's firings that are still queued. + omnipython_drop_fired(id); const fire = () => { state.timerFirings.push({id, at:performance.now()}); if (state.timerFirings.length > 512) state.timerFirings.shift(); @@ -5379,7 +5396,7 @@ var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => { FS.preloadFile = FS_preloadFile; FS.staticInit();; if (globalThis.crypto === undefined) { globalThis.crypto = require('crypto'); }; -var MP_JS_EPOCH = Date.now(); +var MP_JS_EPOCH = performance.now(); // End JS library code // include: postlibrary.js @@ -5839,6 +5856,7 @@ missingLibrarySymbols.forEach(missingLibrarySymbol) 'omnipython_rgba', 'omnipython_paint', 'omnipython_export_host', + 'omnipython_drop_fired', 'omnipython_enable_audio', 'omnipython_disarm_audio_unlock', 'omnipython_arm_audio_unlock', @@ -6238,6 +6256,8 @@ var wasmImports = { /** @export */ mp_js_ticks_ms: _mp_js_ticks_ms, /** @export */ + mp_js_ticks_us: _mp_js_ticks_us, + /** @export */ mp_js_time_ms: _mp_js_time_ms, /** @export */ omnipython_audio_clear: _omnipython_audio_clear, diff --git a/vendor/micropython/micropython.wasm b/vendor/micropython/micropython.wasm index 3979366..1940a32 100755 Binary files a/vendor/micropython/micropython.wasm and b/vendor/micropython/micropython.wasm differ diff --git a/vendor/micropython/micropython.wasm.provenance b/vendor/micropython/micropython.wasm.provenance index f097c62..720f191 100644 --- a/vendor/micropython/micropython.wasm.provenance +++ b/vendor/micropython/micropython.wasm.provenance @@ -1,10 +1,10 @@ { "binary": { "name": "micropython.wasm", - "sha256": "50312eda3b1b0ae139e31b9b6703c5ecd598554a8b152694193a0693cf5dcc21", - "size": 9868644 + "sha256": "3f9b113a58b168b500c3739d973d3a42b8653f07135fe8ffcdd369df6c12ea00", + "size": 9868418 }, - "built_by": "https://github.com/PyDevices/omnipython-builds/actions/runs/44156093615", + "built_by": "https://github.com/PyDevices/omnipython-builds/actions/runs/44248982018", "format": 1, "install_only": false, "modules": "all,pdwidgets", @@ -81,14 +81,16 @@ "0070-micropython-esp32-a-task-lent-a-priority-is-scheduled-at-once.patch", "0071-micropython-esp32-a-collection-on-a-p4-no-longer-overflows-its-mark-stack.patch", "0072-micropython-extmod-modjson-a-long-parse-lets-other-threads-in.patch", - "0073-micropython-nrf-a-softdevice-build-has-real-atomic-sections.patch" + "0073-micropython-nrf-a-softdevice-build-has-real-atomic-sections.patch", + "0074-micropython-webassembly-ticks-from-a-monotonic-clock.patch", + "0075-micropython-usb-networking-leases-name-no-dns-server.patch" ], "port": "webassembly", "sources": { "audiocomponents": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "audiodsp": { "describe": "80e3388a53ac", @@ -96,77 +98,77 @@ "head": "80e3388a53ace5c3afb2a765030f9969817668f7" }, "audioeffects": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "audioif": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "audioinstruments": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "cameraif": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "castif": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "displayif": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "h264enc": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "iconkit": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "jpegio": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "mdns": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "micropython": { - "describe": "31b4a981b319" + "describe": "c73eb3be16fc" }, "micropython-lib": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "omnipython": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "omnipython-builds": { - "describe": "c8c12c9", + "describe": "58d238a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "omnipython-lib": { - "describe": "ba56bb6813b7", + "describe": "727cc5241b5f", "dirty": false, - "head": "ba56bb6813b74b343f6284966c7183e47613b4de" + "head": "727cc5241b5f4acc4ee8745557f0efd704136066" }, "omnipython-lvgl": { "describe": "3e4381e7addd", @@ -174,24 +176,24 @@ "head": "3e4381e7addded2ac48358a1bbd6c74224711cf0" }, "palettes": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "pdwidgets": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "pngio": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "ppa": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "pygraphics": { "describe": "5631a56cd55e", @@ -199,14 +201,14 @@ "head": "5631a56cd55eb8ac1e82a14396bd876ad97c889d" }, "svgio": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "tsmux": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" }, "ulab": { "describe": "15e999747079", @@ -214,11 +216,11 @@ "head": "15e999747079205b2415e71a6aa2840b8f85f9dc" }, "usbhost": { - "describe": "c8c12c9284ec", + "describe": "58d238ae807a", "dirty": false, - "head": "c8c12c9284ec09837af8de59966b169f9e9612ca" + "head": "58d238ae807a81024473e5c3dfb326a97de9d054" } }, - "stamped": "2026-11-17T19:15:54+00:00", + "stamped": "2026-11-18T06:09:41+00:00", "target": "mp-wasm" }