fix: guard ext_power usage behind CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER

The battery low-power code referenced ext_power unconditionally, causing
build failure when CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n.
This commit is contained in:
afiqzudinhadi 2026-06-24 20:03:22 +08:00
parent a904f76092
commit aa79502d5a

View file

@ -254,6 +254,7 @@ static void zmk_led_write_pixels(void) {
// battery below minimum charge
if (bat0 < 10) {
memset(pixels, 0, sizeof(struct led_rgb) * STRIP_NUM_PIXELS);
#if IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER)
if (state.on) {
int c_power = ext_power_get(ext_power);
if (c_power && !state.status_active) {
@ -262,6 +263,7 @@ static void zmk_led_write_pixels(void) {
reset_ext_power = true;
}
}
#endif
}
if (blend == 0) {