Skip to content

GPIO-based Turbo SHMUP mode toggles #1626

@mortencombat

Description

@mortencombat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request - This may be considered for addition to the firmware in a later release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions