Port the Keychron RGB EEPROM persistence work from the Q5 Max (PR #18) to the K17 Max ANSI Encoder RGB variant.
Enable KEYCHRON_RGB_ENABLE for the K17 Max, wiring up PER_KEY_RGB and MIXED_RGB effects with board-specific defaults
Pin VIA_EEPROM_MAGIC_ADDR to a fixed offset so Keychron EEPROM growth can't silently corrupt the stored keymap
Add boot-time and transport-change RGB persistence hooks matching the Q5 Max pattern
Changes by file
rules.mk
Add KEYCHRON_RGB_ENABLE = yes
ansi_encoder/rgb/rgb.c
Define default_per_key_led[] for 103 LEDs: red Esc and CapsLock, yellow modifiers/function row/numpad, blue alpha keys (Q–P, A–L, Z–M, Space)
Define default_region[] with all 103 keys in region 0
ansi_encoder/rgb/config.h
Define VIA_EEPROM_MAGIC_ADDR 552 — K17 Max Keychron EEPROM data ends at byte 540 (103 LEDs × layout); 552 gives 12 bytes of headroom matching the Q5 Max convention
k17_max.c
Add wireless_enter_connected_kb() hook: reloads Keychron RGB state and re-applies the saved QMK RGB mode after BT/2.4G reconnect if it drifted during the transport change sequence
Add eeconfig_init_custom_rgb() call in keyboard_post_init_kb() so Keychron RGB arrays are loaded from EEPROM on boot
Add missing keychron_wireless_common.h and battery.h includes needed by the wireless hook
Notes
RGB_MATRIX_DEFAULT_MODE is intentionally not set — the K17 Max uses QMK's stock default effect on a fresh flash rather than heatmap
The DIP switch on the K17 Max switches MAC/WIN base layers (not RGB), so no overlay handling is needed here
The common EEPROM bug fixes (keychron_rgb.c, mixed_rgb.c, rgb_matrix_kb.inc, eeconfig_kb.h) were already landed in PR #18 and are inherited by this branch
Test plan
Compile succeeds with no errors
Launcher-configured Mixed RGB mode survives power cycle
Launcher-configured Mixed RGB mode survives BT ↔ 2.4G ↔ USB transport change
Layer 0 keymap is preserved correctly across power cycles (no keys reverting to KC_TRNS)
DIP switch correctly switches between MAC and WIN base layers as before
## Summary
Port the Keychron RGB EEPROM persistence work from the Q5 Max (PR #18) to the K17 Max ANSI Encoder RGB variant.
- Enable `KEYCHRON_RGB_ENABLE` for the K17 Max, wiring up `PER_KEY_RGB` and `MIXED_RGB` effects with board-specific defaults
- Pin `VIA_EEPROM_MAGIC_ADDR` to a fixed offset so Keychron EEPROM growth can't silently corrupt the stored keymap
- Add boot-time and transport-change RGB persistence hooks matching the Q5 Max pattern
## Changes by file
### `rules.mk`
- Add `KEYCHRON_RGB_ENABLE = yes`
### `ansi_encoder/rgb/rgb.c`
- Define `default_per_key_led[]` for 103 LEDs: red Esc and CapsLock, yellow modifiers/function row/numpad, blue alpha keys (Q–P, A–L, Z–M, Space)
- Define `default_region[]` with all 103 keys in region 0
### `ansi_encoder/rgb/config.h`
- Define `VIA_EEPROM_MAGIC_ADDR 552` — K17 Max Keychron EEPROM data ends at byte 540 (103 LEDs × layout); 552 gives 12 bytes of headroom matching the Q5 Max convention
### `k17_max.c`
- Add `wireless_enter_connected_kb()` hook: reloads Keychron RGB state and re-applies the saved QMK RGB mode after BT/2.4G reconnect if it drifted during the transport change sequence
- Add `eeconfig_init_custom_rgb()` call in `keyboard_post_init_kb()` so Keychron RGB arrays are loaded from EEPROM on boot
- Add missing `keychron_wireless_common.h` and `battery.h` includes needed by the wireless hook
## Notes
- `RGB_MATRIX_DEFAULT_MODE` is intentionally **not** set — the K17 Max uses QMK's stock default effect on a fresh flash rather than heatmap
- The DIP switch on the K17 Max switches MAC/WIN base layers (not RGB), so no overlay handling is needed here
- The common EEPROM bug fixes (`keychron_rgb.c`, `mixed_rgb.c`, `rgb_matrix_kb.inc`, `eeconfig_kb.h`) were already landed in PR #18 and are inherited by this branch
## Test plan
- [ ] Compile succeeds with no errors
- [ ] Launcher-configured Mixed RGB mode survives power cycle
- [ ] Launcher-configured Mixed RGB mode survives BT ↔ 2.4G ↔ USB transport change
- [ ] Layer 0 keymap is preserved correctly across power cycles (no keys reverting to KC_TRNS)
- [ ] DIP switch correctly switches between MAC and WIN base layers as before
Port the Keychron RGB EEPROM persistence work from the Q5 Max (PR #18)
to the K17 Max ANSI Encoder RGB variant.
- Add KEYCHRON_RGB_ENABLE = yes to rules.mk
- Define default_per_key_led[] (red Esc/CapsLock, yellow modifiers and
numpad, blue alpha keys) and default_region[] for the 103-LED layout
in ansi_encoder/rgb/rgb.c; both are extern'd by keychron_rgb.c
- Add wireless_enter_connected_kb() hook and eeconfig_init_custom_rgb()
call in keyboard_post_init_kb() in k17_max.c, matching the Q5 Max
pattern for boot-time and transport-change RGB persistence
- Define VIA_EEPROM_MAGIC_ADDR 552 in ansi_encoder/rgb/config.h to pin
VIA keymap storage past the Keychron EEPROM data region end (540 for
K17 with 103 LEDs); prevents keymap corruption if the KB data block
grows in future
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Port the Keychron RGB EEPROM persistence work from the Q5 Max (PR #18) to the K17 Max ANSI Encoder RGB variant.
KEYCHRON_RGB_ENABLEfor the K17 Max, wiring upPER_KEY_RGBandMIXED_RGBeffects with board-specific defaultsVIA_EEPROM_MAGIC_ADDRto a fixed offset so Keychron EEPROM growth can't silently corrupt the stored keymapChanges by file
rules.mkKEYCHRON_RGB_ENABLE = yesansi_encoder/rgb/rgb.cdefault_per_key_led[]for 103 LEDs: red Esc and CapsLock, yellow modifiers/function row/numpad, blue alpha keys (Q–P, A–L, Z–M, Space)default_region[]with all 103 keys in region 0ansi_encoder/rgb/config.hVIA_EEPROM_MAGIC_ADDR 552— K17 Max Keychron EEPROM data ends at byte 540 (103 LEDs × layout); 552 gives 12 bytes of headroom matching the Q5 Max conventionk17_max.cwireless_enter_connected_kb()hook: reloads Keychron RGB state and re-applies the saved QMK RGB mode after BT/2.4G reconnect if it drifted during the transport change sequenceeeconfig_init_custom_rgb()call inkeyboard_post_init_kb()so Keychron RGB arrays are loaded from EEPROM on bootkeychron_wireless_common.handbattery.hincludes needed by the wireless hookNotes
RGB_MATRIX_DEFAULT_MODEis intentionally not set — the K17 Max uses QMK's stock default effect on a fresh flash rather than heatmapkeychron_rgb.c,mixed_rgb.c,rgb_matrix_kb.inc,eeconfig_kb.h) were already landed in PR #18 and are inherited by this branchTest plan