diff options
author | Joel Challis <git@zvecr.com> | 2021-09-14 03:18:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 12:18:36 +1000 |
commit | 0ca4a56a0449d17a497ba610d4cee41c914ff50e (patch) | |
tree | 5e10d1ced8cf84e673f5e3ae88457de32d4943dd /platforms | |
parent | 232bc23a89874d1a2e028a1414dd34cf0339f8d2 (diff) | |
download | qmk_firmware-0ca4a56a0449d17a497ba610d4cee41c914ff50e.tar.gz qmk_firmware-0ca4a56a0449d17a497ba610d4cee41c914ff50e.zip |
Refactor use of STM32_SYSCLK (#14430)
* Refactor use of STM32_SYSCLK
* clang
Diffstat (limited to 'platforms')
-rw-r--r-- | platforms/chibios/drivers/serial.c | 2 | ||||
-rw-r--r-- | platforms/chibios/drivers/ws2812.c | 2 | ||||
-rw-r--r-- | platforms/chibios/drivers/ws2812_pwm.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/platforms/chibios/drivers/serial.c b/platforms/chibios/drivers/serial.c index f54fbcee4..ef6f0aa8d 100644 --- a/platforms/chibios/drivers/serial.c +++ b/platforms/chibios/drivers/serial.c | |||
@@ -19,7 +19,7 @@ | |||
19 | # error "chSysPolledDelayX method not supported on this platform" | 19 | # error "chSysPolledDelayX method not supported on this platform" |
20 | #else | 20 | #else |
21 | # undef wait_us | 21 | # undef wait_us |
22 | # define wait_us(x) chSysPolledDelayX(US2RTC(STM32_SYSCLK, x)) | 22 | # define wait_us(x) chSysPolledDelayX(US2RTC(CPU_CLOCK, x)) |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #ifndef SELECT_SOFT_SERIAL_SPEED | 25 | #ifndef SELECT_SOFT_SERIAL_SPEED |
diff --git a/platforms/chibios/drivers/ws2812.c b/platforms/chibios/drivers/ws2812.c index 0d12e2fb7..ffcdcff24 100644 --- a/platforms/chibios/drivers/ws2812.c +++ b/platforms/chibios/drivers/ws2812.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #define NUMBER_NOPS 6 | 25 | #define NUMBER_NOPS 6 |
26 | #define CYCLES_PER_SEC (STM32_SYSCLK / NUMBER_NOPS * NOP_FUDGE) | 26 | #define CYCLES_PER_SEC (CPU_CLOCK / NUMBER_NOPS * NOP_FUDGE) |
27 | #define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives | 27 | #define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives |
28 | #define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) | 28 | #define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) |
29 | #define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) | 29 | #define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) |
diff --git a/platforms/chibios/drivers/ws2812_pwm.c b/platforms/chibios/drivers/ws2812_pwm.c index e6af55b6b..e7080b036 100644 --- a/platforms/chibios/drivers/ws2812_pwm.c +++ b/platforms/chibios/drivers/ws2812_pwm.c | |||
@@ -59,7 +59,7 @@ | |||
59 | 59 | ||
60 | /* --- PRIVATE CONSTANTS ---------------------------------------------------- */ | 60 | /* --- PRIVATE CONSTANTS ---------------------------------------------------- */ |
61 | 61 | ||
62 | #define WS2812_PWM_FREQUENCY (STM32_SYSCLK / 2) /**< Clock frequency of PWM, must be valid with respect to system clock! */ | 62 | #define WS2812_PWM_FREQUENCY (CPU_CLOCK / 2) /**< Clock frequency of PWM, must be valid with respect to system clock! */ |
63 | #define WS2812_PWM_PERIOD (WS2812_PWM_FREQUENCY / WS2812_PWM_TARGET_PERIOD) /**< Clock period in ticks. 1 / 800kHz = 1.25 uS (as per datasheet) */ | 63 | #define WS2812_PWM_PERIOD (WS2812_PWM_FREQUENCY / WS2812_PWM_TARGET_PERIOD) /**< Clock period in ticks. 1 / 800kHz = 1.25 uS (as per datasheet) */ |
64 | 64 | ||
65 | /** | 65 | /** |