Skip to content

Refactor AVR console logic with error feedback - #29

Merged
JanPetterMG merged 3 commits into
mainfrom
chore/avr-console-refactor-iteration
Sep 5, 2026
Merged

Refactor AVR console logic with error feedback#29
JanPetterMG merged 3 commits into
mainfrom
chore/avr-console-refactor-iteration

Conversation

@JanPetterMG

Copy link
Copy Markdown
Contributor

Enhance the AVR console logic by adding error feedback and value validations while maintaining existing functionality. This refactor improves the handling of commands and responses, as well as significantly reducing the memory requirement.

…itional error feedback and a few value validations added.
@JanPetterMG JanPetterMG added this to the v1.0.0 milestone Sep 5, 2026
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 16d626fb-3197-4296-99ed-ff9e41a46c54

📥 Commits

Reviewing files that changed from the base of the PR and between a19eadd and d645151.

📒 Files selected for processing (1)
  • src/avr/DeskService.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/avr/DeskService.cpp

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Summary by CodeRabbit

  • New Features

    • Added standardized command reporting with uppercase identifiers, values, and line endings.
    • Added serial reporting for firmware information, preset values, encoder updates, and target-position changes.
    • Added support for preset and tone command handling.
  • Bug Fixes

    • Invalid commands and out-of-range values are now reported instead of being applied.
    • Preset values are saved only when valid and changed.
    • Target-position updates now report whether requested positions are accepted or rejected.
    • Button transition messages now use consistent serial output formatting.

Walkthrough

Changes

AVR console event protocol

Layer / File(s) Summary
Console dispatch and event serialization
include/avr/ConsoleHandler.h, src/avr/ConsoleHandler.cpp, src/avr/ButtonHandler.cpp
ConsoleHandler adds a shared send method. Command handling validates numeric values, dispatches recognized commands, and reports invalid commands. Button transitions write event characters, states, and newlines through separate serial writes.
Desk service state reporting
src/avr/DeskService.cpp
Initialization, encoder updates, preset updates, and target updates now use console events. Preset and target values are validated and report success or failure.

Sequence Diagram(s)

sequenceDiagram
  participant Serial1
  participant ConsoleHandler
  participant DeskService
  Serial1->>ConsoleHandler: Receive command
  ConsoleHandler->>ConsoleHandler: Parse and validate value
  ConsoleHandler->>DeskService: Dispatch recognized command
  DeskService->>ConsoleHandler: Send event and value
  ConsoleHandler->>Serial1: Write command, value, newline
Loading

Merge Risk: ⚪ Minimal · up to d6451

The AVR console refactor adds validated command handling and structured state reporting without any identified current merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description accurately covers the AVR console refactor, error feedback, value validation, response handling, and memory reduction described in the changeset.
Title check ✅ Passed The title clearly identifies the main change: refactoring AVR console logic and adding error feedback.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/avr-console-refactor-iteration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 464dc4f9-8293-491b-bff2-0ccf989539d2

📥 Commits

Reviewing files that changed from the base of the PR and between fb086c6 and a19eadd.

📒 Files selected for processing (4)
  • include/avr/ConsoleHandler.h
  • src/avr/ButtonHandler.cpp
  • src/avr/ConsoleHandler.cpp
  • src/avr/DeskService.cpp

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread src/avr/DeskService.cpp Outdated
@JanPetterMG
JanPetterMG marked this pull request as ready for review September 5, 2026 15:55
Copilot AI lite review requested due to automatic review settings September 5, 2026 15:55
@chatgpt-codex-connector

This comment was marked as off-topic.

This comment was marked as off-topic.

@JanPetterMG
JanPetterMG added this pull request to the merge queue Sep 5, 2026
Merged via the queue into main with commit 8dff308 Sep 5, 2026
15 checks passed
@JanPetterMG
JanPetterMG deleted the chore/avr-console-refactor-iteration branch September 5, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants