fix(ws2812-pwm): allow WS2812_PWM_TICK_FREQUENCY override (#26186)

Wrap the define in #ifndef so a keyboard's config.h can set it. The
default (CPU_CLOCK / 2) works for a fixed SYSCLK, but boards that
change SYSCLK at runtime (meletrix/zoom_tkl drops to 16 MHz on
battery) need a tick frequency that divides into both the high and
low TMRCLKs. Every other knob in the file is already #ifndef-guarded;
this one was the only flat #define.
This commit is contained in:
Serge Baranov
2026-05-16 16:14:52 -07:00
committed by GitHub
parent ce4f342ceb
commit 0efd817f42
+3 -1
View File
@@ -89,7 +89,9 @@
/* --- PRIVATE CONSTANTS ---------------------------------------------------- */
#define WS2812_PWM_TICK_FREQUENCY (CPU_CLOCK / 2) /**< Clock frequency of PWM ticks, must be valid with respect to system clock! */
#ifndef WS2812_PWM_TICK_FREQUENCY
# define WS2812_PWM_TICK_FREQUENCY (CPU_CLOCK / 2) /**< Clock frequency of PWM ticks, must be valid with respect to system clock! */
#endif
#define WS2812_PWM_PERIOD (WS2812_PWM_TICK_FREQUENCY / WS2812_PWM_FREQUENCY) /**< Clock period in PWM ticks. */
/**