From 463fb72d29e6638f9a28f751e6a1f2a7f9e0bcf8 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 14 Aug 2022 20:48:44 +0100 Subject: Partially revert some WB32 specific changes (#18038) --- platforms/chibios/drivers/ws2812_spi.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'platforms/chibios/drivers/ws2812_spi.c') diff --git a/platforms/chibios/drivers/ws2812_spi.c b/platforms/chibios/drivers/ws2812_spi.c index 9ee552b187..a73eb69720 100644 --- a/platforms/chibios/drivers/ws2812_spi.c +++ b/platforms/chibios/drivers/ws2812_spi.c @@ -5,11 +5,7 @@ // Define the spi your LEDs are plugged to here #ifndef WS2812_SPI -# if defined(WB32F3G71xx) || defined(WB32FQ95xx) -# define WS2812_SPI SPIDQ -# else -# define WS2812_SPI SPID1 -# endif +# define WS2812_SPI SPID1 #endif #ifndef WS2812_SPI_MOSI_PAL_MODE @@ -20,6 +16,10 @@ # define WS2812_SPI_SCK_PAL_MODE 5 #endif +#ifndef WS2812_SPI_DIVISOR +# define WS2812_SPI_DIVISOR 16 +#endif + // Push Pull or Open Drain Configuration // Default Push Pull #ifndef WS2812_EXTERNAL_PULLUP @@ -46,7 +46,7 @@ # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 8 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1) -#elif WS2812_SPI_DIVISOR == 16 // same as default +#elif WS2812_SPI_DIVISOR == 16 // default # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 32 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2) @@ -57,8 +57,7 @@ #elif WS2812_SPI_DIVISOR == 256 # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0) #else -# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) // default -# define WS2812_SPI_DIVISOR 16 +# error "Configured WS2812_SPI_DIVISOR value is not supported at this time." #endif // Use SPI circular buffer -- cgit v1.2.3