Skip to content

Feat/parameters#19

Open
Bridiro wants to merge 10 commits intodevfrom
feat/parameters
Open

Feat/parameters#19
Bridiro wants to merge 10 commits intodevfrom
feat/parameters

Conversation

@Bridiro
Copy link
Copy Markdown
Contributor

@Bridiro Bridiro commented Apr 28, 2026

Purpose

This pull request introduces several API and structural improvements to the steering wheel firmware, focusing on modularity, clarity, and future extensibility. The main themes are a refactor of the inputs handling API, the introduction of a new parameters management module, and enhancements to the LED control interface. These changes clarify callback responsibilities, make the codebase more hardware-agnostic, and improve documentation for easier integration and maintenance.

Overview

  1. The inputs-api interface is redesigned to use explicit callbacks for button press, long-press, release, and knob rotation events, replacing the previous generic notify/action callbacks.
  2. A new hardware-agnostic parameters API is introduced (parameters-api.h and parameters.h), providing a single source of truth for user-facing tunable parameters (e.g., power, regen, PTT). It supports both input-driven and external updates, and broadcasts changes via a registered callback.
  3. New API functions leds_api_save_pattern and leds_api_restore_pattern are added, allowing the current LED state to be snapshotted and restored (useful for temporary overlays like PTT). The handler structure is updated with a backup buffer.

Guidance

Mainly check the parameters module as it's the focus of the PR, but also check events, leds and inputs (both on CM4 and CM7) as most of the code changed to accommodate the new module.

@Bridiro Bridiro requested a review from Tonidotpy April 28, 2026 13:52
@Bridiro Bridiro linked an issue Apr 28, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Member

@Tonidotpy Tonidotpy left a comment

Choose a reason for hiding this comment

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

  • In general avoid shortening names if it is not a convention of some sort (i.e. use button instead of btn, callback instead of cb, etc...). This way there is no ambiguity of what the identifier represent
  • Remember to add a prefix with the filename before any identifier in the module
  • There is no test for the popup module

Comment thread CM7/Core/Src/main.c Outdated
Comment thread CM4/Core/Src/steering/inputs-api.c Outdated
Comment thread test/cm4/test_leds/test-leds.c Outdated
Comment thread CM7/Core/Src/steering/screen-api.c Outdated
Comment thread CM4/Core/Src/steering/parameters-api.c Outdated
Comment thread test/cm4/test_parameters/test-parameters.c Outdated
Comment thread test/cm4/test_parameters/test-parameters.c Outdated
Comment thread test/cm4/test_parameters/test-parameters.c
Comment thread test/cm4/test_parameters/test-parameters.c Outdated
Comment thread test/cm4/test_parameters/test-parameters.c Outdated
@Bridiro Bridiro requested a review from Tonidotpy May 4, 2026 09:03
Copy link
Copy Markdown
Member

@Tonidotpy Tonidotpy left a comment

Choose a reason for hiding this comment

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

Not much to change

Comment thread CM7/Core/Src/steering/popup-api.c
@Bridiro Bridiro requested a review from Tonidotpy May 5, 2026 17:31
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.

feat: parameters module

2 participants