mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-06-03 14:13:46 -03:00
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:
@@ -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. */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user