ISP indicator hardening, host-side unit tests, PR/push CI#27
Merged
Conversation
Review fixes on the LAB-44 visual indicator (stacked on #26): - Retire the boot-indicator flag AFTER arming the CIPO confirmation: the one-shot LittleFS erase (tens of ms, core 1 parked) no longer delays the triggering command's reply. It can still stall the NEXT transaction; after an ISP flash, send a throwaway display command before starting a stream. - Exclude ERROR_DISPLAY (0xC2) from retiring the flag; only content commands count (retires_boot_indicator). - kNominalPages 512 -> 576: real images (up to ~140 KB / ~550 pages) now fill the bar near-linearly without wrapping. - Failed ISP_COMMIT (status 8) shows a sad smiley instead of leaving the misleading full progress bar. - WRITE_PAGE: bounds-check the 24-bit page index itself so a huge index cannot wrap the 32-bit offset math past the staging limit. Testability: - Extract the pure logic (staging constants, bar math, retire filter, glyphs) into Arduino-free src/isp_logic.h, shared by isp.cpp, messenger.cpp, and the tests. - protocol.h no longer includes Arduino.h (stdint/stddef suffice) so the tests can compile it host-side. - New Unity tests (panel/test/test_isp_logic, 14 cases) on the native platform via `pixi run test`, using the system C++ compiler (conda's cxx-compiler breaks on the space in this repo's path). - New ci.yml runs the tests + the release catalog build on every PR and push to main. All 10 firmware envs rebuild clean; 14/14 native tests pass.
There was a problem hiding this comment.
Pull request overview
Hardens the panel’s visual ISP programming indicator behavior (progress bar + post-flash smiley), extracts Arduino-free ISP logic for host-side testing, and adds PR/push CI to continuously run those tests and build the firmware catalog.
Changes:
- Moves boot-indicator “retire” work out of the reply-critical path; adds sad-smiley on failed commit; clamps WRITE_PAGE indices to prevent offset wrap.
- Adds
panel/src/isp_logic.h(pure logic shared by firmware + native unit tests) and introduces host-side Unity tests via PlatformIO native env. - Introduces GitHub Actions CI running
pixi run testandpixi run releaseon PRs/pushes.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pixi.toml |
Adds a pixi run test task to run native PlatformIO unit tests. |
pixi.lock |
Updates lockfile metadata (virtual packages) consistent with new pixi usage. |
panel/test/test_isp_logic/test_main.cpp |
Adds host-side Unity tests covering ISP indicator math, bounds checks, retire filter, and glyph validity. |
panel/src/protocol.h |
Removes Arduino dependency to allow host compilation (tests) while keeping protocol constants available. |
panel/src/messenger.cpp |
Retires the post-flash indicator only after arming the SPI confirmation to avoid delaying the current transaction. |
panel/src/main.cpp |
Calls Isp::boot_indicator_check() once at runtime (loop) so LittleFS ops happen after both cores are active. |
panel/src/isp.h |
Exposes boot-indicator APIs and includes shared isp_logic.h. |
panel/src/isp.cpp |
Implements progress bar + smiley/sad-smiley behavior; adds safe WRITE_PAGE bounds check and host-command retirement logic. |
panel/src/isp_logic.h |
New Arduino-free shared logic/constants for indicator behavior and bounds checking. |
panel/platformio.ini |
Adds a native env for host-side unit tests (Unity). |
.github/workflows/ci.yml |
Adds PR/push CI job running unit tests and catalog build via pixi. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #26 (base:
mreiser/isp-progress-indicator): review fixes for the visual ISP indicator, plus the repo's first host-side unit tests and PR CI.Behavior fixes
Isp::notify_host_command()is now called afterpanel_spi_arm_confirmation(), so the one-time LittleFS flash erase (tens of ms, core 1 parked viaidleOtherCore()) cannot delay the CIPO confirmation of the command that triggered it. Residual quirk, documented in the code: the erase can still stall the next transaction, so bring-up tooling should send a throwaway display command after an ISP flash before starting a stream.ERROR_DISPLAY(0xC2) no longer retires the smiley flag. Only content commands count; the filter is the sharedretires_boot_indicator()predicate.kNominalPages512 -> 576. A 140 KB image (~547 pages) previously wrapped the bar back to 1 column right before COMMIT; the largest real images now reach 19/20 columns with no wrap.ISP_COMMITshows a sad smiley (status 8, no reboot follows) instead of leaving the full progress bar, which read as success at a glance.WRITE_PAGEindex clamp. Bounds are checked on the 24-bit page index itself;idx * 256can no longer wrap uint32 and slip past the staging limit.Tests + CI
src/isp_logic.h(new): Arduino-free pure logic (staging constants, bar fill math, retire filter, both face glyphs), shared byisp.cpp,messenger.cpp, and the tests.protocol.hdrops its unnecessary<Arduino.h>include so it compiles host-side.test/test_isp_logic/(new): 14 Unity test cases covering bar monotonicity, full-at-nominal, no-wrap for real image sizes, wrap behavior past nominal, the bounds check (including the wrap-index regression), the retire filter over every opcode, and glyph well-formedness/symmetry. Run withpixi run test(=platformio test -d panel -e native)..github/workflows/ci.yml(new): runs the unit tests and thepixi run releasecatalog build on every PR and push to main, using the same pixi-locked toolchain as release.yml.cxx-compilerbakes the env prefix into its link inputs and breaks on the space in this repo's checkout path ("Generation 6"); documented inpixi.toml.Validation
pixi run test: 14/14 pass.pixi run release,pixi run diag, plus explicit builds of the four bcmtest/spidiag envs (the diag catalog does not include them).