README: add separate module repo guide
This commit is contained in:
parent
e800222842
commit
e7b543c501
1 changed files with 47 additions and 0 deletions
47
README.md
47
README.md
|
|
@ -107,6 +107,53 @@ target_sources(app PRIVATE src/effects/my_effect.c)
|
||||||
|
|
||||||
The effect auto-registers via linker section. Accessible by cycling with `RGB_EFF`.
|
The effect auto-registers via linker section. Accessible by cycling with `RGB_EFF`.
|
||||||
|
|
||||||
|
### As a separate module repo
|
||||||
|
|
||||||
|
You can also create effects in their own repo without modifying this module:
|
||||||
|
|
||||||
|
```
|
||||||
|
my-zmk-rgb-rainbow/
|
||||||
|
├── zephyr/
|
||||||
|
│ └── module.yml
|
||||||
|
├── CMakeLists.txt
|
||||||
|
├── Kconfig
|
||||||
|
└── src/
|
||||||
|
└── rainbow.c
|
||||||
|
```
|
||||||
|
|
||||||
|
`zephyr/module.yml`:
|
||||||
|
```yaml
|
||||||
|
build:
|
||||||
|
cmake: .
|
||||||
|
kconfig: Kconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
`Kconfig`:
|
||||||
|
```
|
||||||
|
config ZMK_RGB_EFFECT_RAINBOW
|
||||||
|
bool "Rainbow RGB effect"
|
||||||
|
depends on ZMK_RGB_UNDERGLOW
|
||||||
|
default y
|
||||||
|
```
|
||||||
|
|
||||||
|
`CMakeLists.txt`:
|
||||||
|
```cmake
|
||||||
|
if(CONFIG_ZMK_RGB_EFFECT_RAINBOW)
|
||||||
|
target_sources(app PRIVATE src/rainbow.c)
|
||||||
|
endif()
|
||||||
|
```
|
||||||
|
|
||||||
|
`src/rainbow.c` uses `ZMK_RGB_EFFECT_DEFINE` exactly as above.
|
||||||
|
|
||||||
|
Add to your `west.yml`:
|
||||||
|
```yaml
|
||||||
|
- name: my-zmk-rgb-rainbow
|
||||||
|
remote: your-github-remote
|
||||||
|
revision: main
|
||||||
|
```
|
||||||
|
|
||||||
|
Requires the ZMK fork with the modular effect API (`rgb-modular-v1.1` or later). No dependency on this module — the linker section collects effect registrations across all modules.
|
||||||
|
|
||||||
### Effect flags
|
### Effect flags
|
||||||
|
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue