diff options
author | Nick Brassel <[email protected]> | 2022-03-07 21:04:22 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-03-07 21:04:22 +1100 |
commit | 44f1bd9b3a9185951c283ceb5eeb2ecc2be72418 (patch) | |
tree | 6f1439e605c94af81c5bb9be62cec6aaad55f923 /platforms/chibios/drivers/ws2812_spi.c | |
parent | 5de515526d46787100dcab1588aab51178c6cb8d (diff) | |
download | qmk_firmware-44f1bd9b3a9185951c283ceb5eeb2ecc2be72418.tar.gz qmk_firmware-44f1bd9b3a9185951c283ceb5eeb2ecc2be72418.zip |
ChibiOS 21.11.1 update. (#16251)
* ChibiOS 21.11.1 update.
* `uf2-tinyuf2` => `tinyuf2`
* Updated chibios-contrib, fixup preprocessor for tinyuf2 bootloader.
* Fixup keychron L433 boards.
* Makefile cleanup.
* RISC-V build fixes.
* Fixup RISC-V build.
Diffstat (limited to 'platforms/chibios/drivers/ws2812_spi.c')
-rw-r--r-- | platforms/chibios/drivers/ws2812_spi.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/platforms/chibios/drivers/ws2812_spi.c b/platforms/chibios/drivers/ws2812_spi.c index 76191db165..01d8148875 100644 --- a/platforms/chibios/drivers/ws2812_spi.c +++ b/platforms/chibios/drivers/ws2812_spi.c @@ -139,7 +139,33 @@ void ws2812_init(void) { #endif // WS2812_SPI_SCK_PIN // TODO: more dynamic baudrate - static const SPIConfig spicfg = {WS2812_SPI_BUFFER_MODE, NULL, PAL_PORT(RGB_DI_PIN), PAL_PAD(RGB_DI_PIN), WS2812_SPI_DIVISOR_CR1_BR_X}; + static const SPIConfig spicfg = { +#ifndef HAL_LLD_SELECT_SPI_V2 +// HAL_SPI_V1 +# if SPI_SUPPORTS_CIRCULAR == TRUE + WS2812_SPI_BUFFER_MODE, +# endif + NULL, // end_cb + PAL_PORT(RGB_DI_PIN), + PAL_PAD(RGB_DI_PIN), + WS2812_SPI_DIVISOR_CR1_BR_X, + 0 +#else + // HAL_SPI_V2 +# if SPI_SUPPORTS_CIRCULAR == TRUE + WS2812_SPI_BUFFER_MODE, +# endif +# if SPI_SUPPORTS_SLAVE_MODE == TRUE + false, +# endif + NULL, // data_cb + NULL, // error_cb + PAL_PORT(RGB_DI_PIN), + PAL_PAD(RGB_DI_PIN), + WS2812_SPI_DIVISOR_CR1_BR_X, + 0 +#endif + }; spiAcquireBus(&WS2812_SPI); /* Acquire ownership of the bus. */ spiStart(&WS2812_SPI, &spicfg); /* Setup transfer parameters. */ |