Feat/hs02 ok button - #1
Open
bugparty wants to merge 2 commits into
Open
Conversation
merge lastest progress
The HS-02 has three physical buttons (UP/DOWN/OK) but IronOS is a
two-button firmware, so the OK button (PB3) was previously unused.
Wire it up as a real independent third button.
- Add ButtonState BUTTON_OK_SHORT / BUTTON_OK_LONG.
- getButtonState() reads OK as a third bit; OK long-press is one-shot
so a "back" action steps up a single level instead of cascading.
- getButtonOK() is weakly defined (returns 0 on two-button devices);
the Fnirsi BSP overrides it to read PB3. UP/DOWN keep the two logical
buttons, so other devices are unaffected.
- Per-screen actions (short = enter/confirm/select, long = back):
Home : OK enters soldering
Soldering : OK opens temp adjust; long returns to home
TempAdjust : OK confirms & exits
SettingsMenu: OK selects/enters; long goes back one level
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
The changes have been tested locally
There are no breaking changes
What kind of change does this PR introduce?
Feature.
The FNIRSI HS-02 has three physical buttons (UP / DOWN / OK), but IronOS is a two-button firmware. The port only reads UP/DOWN, so the dedicated OK button (PB3) does nothing.
OK is wired up as a real, independent third button with context-appropriate actions on each screen:
┌────────────────────┬─────────────────────────┬────────────────┐
│ Screen │ OK short press │ OK long press │
├────────────────────┼─────────────────────────┼────────────────┤
│ Home │ Enter soldering │ — (top level) │
├────────────────────┼─────────────────────────┼────────────────┤
│ Soldering │ Open temperature adjust │ Back to home │
├────────────────────┼─────────────────────────┼────────────────┤
│ Temperature adjust │ Confirm & exit │ Exit │
├────────────────────┼─────────────────────────┼────────────────┤
│ Settings menu │ Select / enter │ Back one level │
└────────────────────┴─────────────────────────┴────────────────┘
So OK short = enter/confirm/select, OK long = back.
Other information:
Adds BUTTON_OK_SHORT / BUTTON_OK_LONG to ButtonState; getButtonState() reads OK as a third bit.
OK long-press is one-shot (latched until release) so a "back" action steps up a single level instead of cascading through several.
getButtonOK() is weakly defined to return 0, so all existing two-button devices are unaffected (they never emit the new states). Only the Fnirsi BSP overrides it to read PB3; UP/DOWN remain the two logical buttons.
Screens that don't handle the OK states simply ignore them (default case), so there are no side effects elsewhere.