OpenStickCommunity / OpenStickCommunity/GP2040-CE
GPIO-based Turbo SHMUP mode toggles
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 666
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 7
Description
Problem
I would like to have the possibility of toggling turbo mode for predefined button(s) using a hardware-based toggle (such as a latching SPST rocker switch).
The Turbo add-on SHMUP feature provides always-on turbo mode for (up to 4) predefined button(s), but I would like to be able to quickly disable/enable without having to also press the button on which to enable it (since in my case it would always be the same primary fire button). I am planning a joystick build with only 3 buttons but with 1-2 rocker switches to enable certain features.
Solution
I am proposing to add this feature as optional functionality to the existing Turbo add-on SHMUP MODE.
For each of the up to 4 buttons, I propose to add the option Hold to Enable Pin X (for each of 1, 2, 3 and 4).
The default value of Hold to Enable Pin will be -1. In this case the add-on will work exactly as it does today. The specified buttons without Hold to Enable will be added to alwaysEnabled in TurboInput::setup() as today.
If Hold to Enable Pin X is specified as a valid GPIO pin, the button will not be added to alwaysEnabled. Turbo mode for that button will instead be determined in TurboInput::process() based on the current state of the specified Hold to Enable pin.
[!NOTE]
A related PR #1572 has previously been proposed by someone else. This PR also contains implementation of a specific expander and more, for that and other reasons it has not been merged into the codebase. What I am proposing is a more basic solution of some added functionality limited to the Turbo add-on itself.
Do you plan to work on this feature yourself?
I am willing and should be able to implement the feature myself.
I am asking for comments/suggestions and confirmation that this is something that you would be interested in merging into the main branch.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing Turbo add-on SHMUP implementation, especially TurboInput::setup() and TurboInput::process(), and compare the scope with related PR #1572. Trace how the four button options are configured and verify the default -1 behavior. Done means valid GPIO pins control each button's turbo mode while unspecified buttons retain the current always-enabled behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100