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 driver into proper Zephyr module, driver tweaks #1919

Merged

Conversation

petejohanson
Copy link
Contributor

This is a core refactor to bring our driver structure in line with the current Zephyr conventions for out-of-tree (OOT) drivers.

  • Use zephyr_library_amend() to actually amend the existing library for each driver type, instead of creating a new separate library for each of our driver types, duplicating things.
  • Properly nest the added Zephyr module as the module directory, not drivers, so our structure matches that of Zephyr, needed so that zephyr_library_amend() uses the correct library name.
  • Update our Kconfig to match the conventions.
  • Leverage the correct init priority for the kscan drivers now that that level is properly created by Zephyr's kscan Kconfig bits.

@petejohanson petejohanson added core Core functionality/behavior of ZMK sensors displays refactor encoders labels Sep 3, 2023
@petejohanson petejohanson self-assigned this Sep 3, 2023
@petejohanson petejohanson force-pushed the core/module-intergration-clean-up branch 2 times, most recently from 7bbb6d5 to 3334e49 Compare September 3, 2023 03:57
@petejohanson petejohanson marked this pull request as ready for review September 3, 2023 05:57
@petejohanson petejohanson requested a review from a team as a code owner September 3, 2023 05:57
* Align our driver module layout to properly match Zephyr conventions,
  allowing proper CMake setup to amend the library for each type of driver.
@petejohanson petejohanson force-pushed the core/module-intergration-clean-up branch from 7e3f98c to f02dd1b Compare September 14, 2023 06:42
* Avoid APPLICATION stage and use the proper earlier stage for
  kscan drivers.
@petejohanson petejohanson force-pushed the core/module-intergration-clean-up branch from f02dd1b to b63621a Compare September 14, 2023 08:27
* Promote previously local debounce code from kscan drivers to exposed
  module lib, for use with other drivers as needed.
* Refactor existing kscan driver to new "public" API.
@petejohanson petejohanson force-pushed the core/module-intergration-clean-up branch from b63621a to 6185741 Compare September 15, 2023 06:43
@petejohanson petejohanson merged commit 28ce23d into zmkfirmware:main Sep 16, 2023
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionality/behavior of ZMK displays encoders refactor sensors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants