Skip to content

Example SD files by URL, a stale solver window fix, PCM5102A ad - #395

Merged
davidmonterocrespo24 merged 3 commits into
masterfrom
feat/example-sd-media-url
Oct 15, 2026
Merged

davidmonterocrespo24 merged 3 commits into
masterfrom
feat/example-sd-media-url

Conversation

@davidmonterocrespo24

Copy link
Copy Markdown
Owner

Three small changes behind the XIAO Pod example (MP3 player on XIAO ESP32S3 Sense + Round Display + PCM5102A I2S DAC) on velxio.dev:

  • feat(examples): an example board's sdFiles entry may name a url instead of contentB64. loadExample fetches it before touching the canvas and stores the bytes like an inline file, so large media stays out of the main bundle. A file that cannot be fetched is skipped and logged.
  • fix(spice): closeWindow() queued a window publish that could run after a queued rebuild, pairing the old deck pad levels with the new deck sources (alter V_x dc undefined, shown as "Circuit solver problem: no such vector undefined"). The publish now runs only while its timeline is current. Regression test included.
  • feat(catalog): online-only ad for the new pro-pcm5102a part.

Tests: full vitest suite green in both shards (5369 + 6041).

…e bytes

A gallery example can pre-load a board's built-in microSD (board.sdFiles).
Inline base64 is fine for a text file, but a music player's MP3s would ride
in the main bundle every visitor downloads. An entry may now name a `url`
(same origin, e.g. /examples-media/...): loadExample fetches it before the
canvas changes and stores the bytes on the board exactly like an inline file
or an SD Card panel upload. A file that cannot be fetched is left off the
card and logged, so one missing asset costs that file, not the example.
"Circuit solver problem: no such vector undefined" on Run, intermittently,
on a circuit with SPI-driven pads. closeWindow() closes the pad timeline's
window and queues its publish on the solver chain; when a rebuild was
already queued there, the publish ran after it, and the window's levels,
indexed by the OLD deck's pads, were paired with the NEW deck's sources. The
new deck had one pad more, so ngspice got `alter V_<board>_D10 dc undefined`.

The publish now runs only while its timeline is still the current one. The
rebuild already published the state the pads hold, and edges recorded during
it went onto the new timeline, so a stale window has nothing left to say.
Regression test reproduces the race with a fake solver (fails before: one
alter with an undefined level).
@davidmonterocrespo24
davidmonterocrespo24 merged commit ae60dd6 into master Oct 15, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant