diff options
Diffstat (limited to 'platforms/chibios/drivers/ws2812.c')
| -rw-r--r-- | platforms/chibios/drivers/ws2812.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platforms/chibios/drivers/ws2812.c b/platforms/chibios/drivers/ws2812.c index 0d12e2fb7..b46c46ae5 100644 --- a/platforms/chibios/drivers/ws2812.c +++ b/platforms/chibios/drivers/ws2812.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | /* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */ | 6 | /* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */ |
| 7 | 7 | ||
| 8 | #ifndef NOP_FUDGE | 8 | #ifndef NOP_FUDGE |
| 9 | # if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) | 9 | # if defined(STM32F0XX) || defined(STM32F1XX) || defined(GD32VF103) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX) |
| 10 | # define NOP_FUDGE 0.4 | 10 | # define NOP_FUDGE 0.4 |
| 11 | # else | 11 | # else |
| 12 | # error("NOP_FUDGE configuration required") | 12 | # error("NOP_FUDGE configuration required") |
| @@ -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) |
