Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor steno and add STENO_PROTOCOL = [all|txbolt|geminipr] #17065

Merged
merged 15 commits into from
Jun 23, 2022

Conversation

precondition
Copy link
Contributor

@precondition precondition commented May 11, 2022

Description

Refactor quantum/process_keycode/process_steno.* so that it's easier to read and more firmware space efficient (cut the compile size by ~15% if compiling all protocols and by ~50% if compiling only a single protocol) and give the possibility to users to compile only a single protocol because it's wasteful to compile all available steno protocols even if you plan to use only one — after discussing with some folks on the Plover discord, I came to the conclusion that there are little to no use cases to the ability of switching serial protocols on the fly so using only a single serial protocol is by far the most common use case.

I also fixed a bug wherein the n_pressed_keys value given to the postprocess_steno_user hook was off by 1. Speaking of postprocess_steno_user, shouldn't we rename this to post_process_steno_user? I avoided doing it here as that would be a breaking change but that'd be more consistent with all the other available post_process_* hooks.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@fauxpark
Copy link
Member

fauxpark commented May 12, 2022

This breaks some conventions and assumptions the CLI makes about rules.mk entries - it would be better to do something like RGB Matrix, ie.

STENO_ENABLE = yes|no
STENO_DRIVER = gemini|bolt|etc

@precondition
Copy link
Contributor Author

precondition commented May 12, 2022

Is STENO_PROTOCOL = gemini|bolt|all ok? Because "steno driver" doesn't make much sense or does the CLI expect the _DRIVER suffix?

PS: just to be clear, the rules.mk entries of the current state of the PR are not:

STENO_ENABLE = GEMINI|BOLT|ALL 

Each protocol is a separate yes|no rules.mk entry

@precondition precondition force-pushed the steno_refactor branch 3 times, most recently from 3c9c694 to 7956242 Compare May 12, 2022 00:59
@drashna
Copy link
Member

drashna commented May 12, 2022

STENO_PROTOCOL should be okay. The main thing is that STENO_ENABLE should only be yes/no.

@precondition precondition changed the title Refactor steno into STENO_ENABLE_[ALL|GEMINI|BOLT] Refactor steno and add STENO_PROTOCOL = [all|txbolt|geminipr] May 12, 2022
@precondition
Copy link
Contributor Author

precondition commented May 12, 2022

The STENO_PROTOCOL approach is indeed cleaner than the STENO_ENABLE_* approach 👍

@precondition precondition mentioned this pull request May 15, 2022
@drashna drashna requested a review from a team May 17, 2022 04:14
@precondition
Copy link
Contributor Author

(Last force push was to simply rebase the PR on top of latest develop)

@drashna drashna requested a review from a team June 22, 2022 14:32
Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

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

Thanks for the refactor and LGTM!

A additional request, it would be great if this PR could add the data driver equivalents for STENO_ENABLE and STENO_PROTOCOL to info_rules.json along with the json schema validations in keyboard.jsonschema. Would you mind adding these?

@KarlK90 KarlK90 merged commit 7060cb7 into qmk:develop Jun 23, 2022
@precondition precondition deleted the steno_refactor branch June 23, 2022 18:44
0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
…17065)

* Refactor steno into STENO_ENABLE_[ALL|GEMINI|BOLT]

* Update stenography documentation

* STENO_ENABLE_TXBOLT → STENO_ENABLE_BOLT

TXBOLT is a better name but BOLT is more consistent with the
pre-existing TX Bolt related constants, which all drop the "TX " prefix

* Comments

* STENO_ENABLE_[GEMINI|BOLT|ALL] → STENO_PROTOCOL = [geminipr|txbolt|all]

* Add note on lacking V-USB support

* Clear chord at the end of the switch(mode){send_steno_chord} block

* Return true if NOEVENT

* update_chord_xxx → add_xxx_key_to_chord

* Enable the defines for all the protocols if STENO_PROTOCOL = all

* Mention how to use `steno_set_mode`

* Set the default steno protocol to "all"

This is done so that existing keymaps invoking `steno_set_mode` don't
all suddenly break

* Add data driver equivalents for stenography feature

* Document format of serial steno packets

(Thanks dnaq)

* Add missing comma
nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
…17065)

* Refactor steno into STENO_ENABLE_[ALL|GEMINI|BOLT]

* Update stenography documentation

* STENO_ENABLE_TXBOLT → STENO_ENABLE_BOLT

TXBOLT is a better name but BOLT is more consistent with the
pre-existing TX Bolt related constants, which all drop the "TX " prefix

* Comments

* STENO_ENABLE_[GEMINI|BOLT|ALL] → STENO_PROTOCOL = [geminipr|txbolt|all]

* Add note on lacking V-USB support

* Clear chord at the end of the switch(mode){send_steno_chord} block

* Return true if NOEVENT

* update_chord_xxx → add_xxx_key_to_chord

* Enable the defines for all the protocols if STENO_PROTOCOL = all

* Mention how to use `steno_set_mode`

* Set the default steno protocol to "all"

This is done so that existing keymaps invoking `steno_set_mode` don't
all suddenly break

* Add data driver equivalents for stenography feature

* Document format of serial steno packets

(Thanks dnaq)

* Add missing comma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants