Browse Source

Update platforms/chibios/drivers/ws2812_pwm.c

Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
pull/17046/head
yiancar 1 year ago
committed by GitHub
parent
commit
e06a6bb190
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      platforms/chibios/drivers/ws2812_pwm.c

+ 9
- 3
platforms/chibios/drivers/ws2812_pwm.c View File

@ -33,9 +33,15 @@
* figure out if we are using a 32bit timer. This is needed to setup the DMA controller correctly.
* Ignore STM32H7XX and STM32U5XX as they are not supported by ChibiOS.
*/
#if (WS2812_PWM_DRIVER == PWMD2) && (!defined(STM32F1XX) || !defined(STM32L0XX) || !defined(STM32L1XX))
# define WS2812_PWM_TIMER_32BIT
#elif (WS2812_PWM_DRIVER == PWMD5) && (!defined(STM32F1XX))
#if !defined(STM32F1XX) && !defined(STM32L0XX) && !defined(STM32L1XX)
# define WS2812_PWM_TIMER_32BIT_PWMD2 1
#endif
#if !defined(STM32F1XX)
# define WS2812_PWM_TIMER_32BIT_PWMD5 1
#endif
#define WS2812_CONCAT1(a, b) a##b
#define WS2812_CONCAT(a, b) WS2812_CONCAT1(a, b)
#if WS2812_CONCAT(WS2812_PWM_TIMER_32BIT_, WS2812_PWM_DRIVER)
# define WS2812_PWM_TIMER_32BIT
#endif


Loading…
Cancel
Save