fix(button): stop phantom NORVI operation-mode switches - #181
Conversation
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Max errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 8 | 0 | 0 | 0.54s | ||
| ✅ BASH | bash-exec | 1 | 0 | 0 | 0.43s | ||
| ✅ BASH | shellcheck | 1 | 0 | 0 | 0.43s | ||
| ✅ BASH | shfmt | 1 | 0 | 0 | 0.01s | ||
| ✅ C | clang-format | 1 | 0 | 0 | 0.04s | ||
| ✅ C | cppcheck | 1 | 0 | 0 | 0.02s | ||
| ✅ C | cpplint | 1 | 0 | 0 | 0.21s | ||
| ✅ CPP | clang-format | 79 | 0 | 0 | 0.38s | ||
| ✅ CPP | cppcheck | 79 | 0 | 0 | 4.15s | ||
| ✅ CPP | cpplint | 79 | 0 | 0 | 5.0s | ||
| ✅ EDITORCONFIG | editorconfig-checker | 256 | 0 | 0 | 0.48s | ||
| ✅ JSON | jsonlint | 6 | 0 | 0 | 0.11s | ||
| ✅ JSON | v8r | 6 | 0 | 0 | 3.27s | ||
| markdownlint | 101 | 2 | 0 | 2.77s | |||
| ✅ YAML | yamllint | 25 | 0 | 0 | 0.63s |
Detailed Issues
⚠️ MARKDOWN / markdownlint - 2 errors
.opencode/skills/web-ui/SKILL.md:34 error MD028/no-blanks-blockquote Blank line inside blockquote
docs/superpowers/plans/2026-08-10-olimex-c6-local-ui-implementation.md:106:401 error MD013/line-length Line length [Expected: 400; Actual: 452]
Notices
MAKEFILE, MAKEFILE_CHECKMAKE, MARKDOWN_MARKDOWN_LINK_CHECK. See Removed linters to find their replacements.
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@10.0.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,BASH_EXEC,BASH_SHELLCHECK,BASH_SHFMT,C_CPPCHECK,C_CPPLINT,C_CLANG_FORMAT,CPP_CPPCHECK,CPP_CPPLINT,CPP_CLANG_FORMAT,EDITORCONFIG_EDITORCONFIG_CHECKER,JSON_JSONLINT,JSON_V8R,MARKDOWN_MARKDOWNLINT,YAML_YAMLLINT

Show us your support by starring ⭐ the repository
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5dbdfabc7d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Measured ADC levels on the NORVI AE01-R: no press ~2610-2990 (oscillates), S1 ~3275-3456, S2 ~3579-3765, S3 ~4095 (full scale). The old 2700/3800 boundaries sat inside the resting oscillation, so phantom S3 presses repeatedly switched the operation mode. - Calibrate thresholds to measured levels (B1 3100-3520, B2 3520-3880, B3 3880-4095, no-press 4096 as no-op since S3 reads full scale) - Make thresholds configurable via NVS (ConfigManager) with the calibrated values as defaults, editable in the web UI Pool settings tab
The settings handler updated ConfigManager but NorviButtonHandler only copied the thresholds in begin(), so changes required a reboot. Add NorviButtonHandler::applySettings() and call it after saving settings. Addresses PR #181 review comment.
Empty or out-of-range threshold fields were stored as 0 by toInt(), reintroducing phantom presses. Validate presence, 0-4095 range, and coherent non-overlapping min/max ranges before saving. Addresses PR #181 review comment.
The native test build defines NORVI_AE01_R but did not compile NorviButtonHandler.cpp, so the new applySettings() call failed to link. Add it to SERVICE_SOURCES and extend the mock Settings struct with the button threshold fields. Align ConfigManager field comments per clang-format (MegaLinter).
5dbdfab to
b45aebe
Compare
Native Test Coverage
Report from native unit tests (ASan + gcov). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b45aebe1a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ff9b93a to
3a137e0
Compare
Native Test Coverage
Report from native unit tests (ASan + gcov). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff9b93ad9c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Native Test Coverage
Report from native unit tests (ASan + gcov). |
Problem
The NORVI AE01-R front panel repeatedly switched the operation mode without any button being pressed. Log analysis showed
[MODE_CHANGED] ... source=button:S3/menuevents firing spontaneously.Root cause
The front-panel buttons are read via a resistor ladder on ADC GPIO32 that pulls the signal UP toward VCC on press. Live measurements (via
/api/logsdebug capture):The old thresholds (
B3_MIN=2700,NO_PRESS=3800) sat inside the resting oscillation, so the resting level itself crossed the Button-3 boundary and each S3 press/release pair (open menu + confirm, menu defaults to MODE) cycled the operation mode.Changes
fix(logging)— trace operation mode command sources (b41fc17), enabling diagnosisConfigManager(defaults = calibrated values) and editable in the web UI Pool settings tab, so future ADC drift (resting level rose ~2445 → ~2700 over weeks) can be corrected without a firmware reflashVerification
pio run -e norvi_ae01_rSUCCESS (Flash 97.1%)/api/config(btn1_min…btn_no_press)