diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2021-03-19 16:24:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-19 16:24:36 +0000 |
commit | 32f0567ca5e0d7db78ce316df6b5a18546c525b7 (patch) | |
tree | 3e97f3df8221782d9c38ba9d492323c96b0e1462 /drivers/chibios | |
parent | 6f7466b6dd72e161b61683e26b7720421d8cc9bd (diff) | |
download | qmk_firmware-32f0567ca5e0d7db78ce316df6b5a18546c525b7.tar.gz qmk_firmware-32f0567ca5e0d7db78ce316df6b5a18546c525b7.zip |
Format code according to conventions (#12292)
Co-authored-by: QMK Bot <hello@qmk.fm>
Diffstat (limited to 'drivers/chibios')
-rw-r--r-- | drivers/chibios/ws2812_spi.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/chibios/ws2812_spi.c b/drivers/chibios/ws2812_spi.c index bc0a54acce..e02cbabc02 100644 --- a/drivers/chibios/ws2812_spi.c +++ b/drivers/chibios/ws2812_spi.c @@ -34,7 +34,7 @@ // Define SPI config speed // baudrate should target 3.2MHz -// F072 fpclk = 48MHz +// F072 fpclk = 48MHz // 48/16 = 3Mhz #if WS2812_SPI_DIVISOR == 2 # define WS2812_SPI_DIVISOR (0) @@ -42,7 +42,7 @@ # define WS2812_SPI_DIVISOR (SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 8 # define WS2812_SPI_DIVISOR (SPI_CR1_BR_1) -#elif WS2812_SPI_DIVISOR == 16 //same as default +#elif WS2812_SPI_DIVISOR == 16 // same as default # define WS2812_SPI_DIVISOR (SPI_CR1_BR_1 | SPI_CR1_BR_0) #elif WS2812_SPI_DIVISOR == 32 # define WS2812_SPI_DIVISOR (SPI_CR1_BR_2) @@ -53,14 +53,14 @@ #elif WS2812_SPI_DIVISOR == 256 # define WS2812_SPI_DIVISOR (SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0) #else -# define WS2812_SPI_DIVISOR (SPI_CR1_BR_1 | SPI_CR1_BR_0) //default +# define WS2812_SPI_DIVISOR (SPI_CR1_BR_1 | SPI_CR1_BR_0) // default #endif // Use SPI circular buffer #ifdef WS2812_SPI_USE_CIRCULAR_BUFFER -# define WS2812_SPI_BUFFER_MODE 1 //circular buffer +# define WS2812_SPI_BUFFER_MODE 1 // circular buffer #else -# define WS2812_SPI_BUFFER_MODE 0 //normal buffer +# define WS2812_SPI_BUFFER_MODE 0 // normal buffer #endif #define BYTES_FOR_LED_BYTE 4 @@ -112,10 +112,7 @@ void ws2812_init(void) { palSetLineMode(RGB_DI_PIN, WS2812_OUTPUT_MODE); // 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 - }; + static const SPIConfig spicfg = {WS2812_SPI_BUFFER_MODE, NULL, PAL_PORT(RGB_DI_PIN), PAL_PAD(RGB_DI_PIN), WS2812_SPI_DIVISOR}; spiAcquireBus(&WS2812_SPI); /* Acquire ownership of the bus. */ spiStart(&WS2812_SPI, &spicfg); /* Setup transfer parameters. */ |