Where to put drivers?
kaievns opened this issue · 4 comments
Hi folks, I need a bit of an advise on where to put drivers in my config.
This is not my first zmk project and I'm trying something more ambitious this time with a new custom PCB keyboard build that has a trackball integrated.
I have set up a new shield and MCU overlay for the new PCB, transformations, keybindings, etc, and it compiles and works. Now I'm trying to add the trackball driver to the thing.
Basically what I want to accomplish is to copy and integrate this project https://github.com/inorichi/zmk-pmw3610-driver into my configs so I could tinker with the code locally without dealing with the full blown github actions, west, etc.
I see @ufan dropped his work into the app/drivers
folder in the zmk
repo itself over here https://github.com/ufan/zmk/tree/ptdevice-refactor/app/drivers/sensor/pixart/pmw3610. But I'm not sure how that would translate into a user config
I have stashed my work over here, it's pretty vanilla, I just don't know where all the C and Kconfig files from the driver should go in here https://github.com/kaievns/little-wing/tree/main/zmk-config
Thank you!
I think I found a way to use the extra modules ref for that.
I have basically dumped that repo into an arbitrary folder ${my-config}/drivers/pmw3610
and then referred to that as an external zephyr module in the CLI args like so
west build -d build/right -p -b nice_nano_v2 -- \
-DSHIELD="little_wing_right" \
-DZMK_CONFIG="/workspaces/zmk-config/config" \
-DZMK_EXTRA_MODULES="/workspaces/zmk-config;/workspaces/zmk-config/drivers/pmw3610"
the /workspaces/zmk-config
is my docker mount for my user config.
it works, but it sort of feels hacky. is there a more officially blessed way to do this?
thank you