Skip to content

Feat/hs02 ok button - #1

Open
bugparty wants to merge 2 commits into
ok2cm:fnirsi_hs02_ok2cmfrom
bugparty:feat/hs02-ok-button
Open

Feat/hs02 ok button#1
bugparty wants to merge 2 commits into
ok2cm:fnirsi_hs02_ok2cmfrom
bugparty:feat/hs02-ok-button

Conversation

@bugparty

Copy link
Copy Markdown

  • 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.

  • What is the current behavior?

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.

  • What is the new behavior (if this is a feature change)?

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.


bugparty added 2 commits July 22, 2026 18:28
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
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.

1 participant