diff options
author | Oxore <oxore@protonmail.com> | 2022-10-09 22:19:24 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2022-10-09 22:19:24 +0300 |
commit | 2a5b767d52fe47ae83dda6f3303af312b72b3acf (patch) | |
tree | 094beadf3b36331a1cc58d1da55314d9bac60230 /Libraries/LED_Driver/led_driver_process.c | |
parent | b1c8bb5df090d65cdd37a7acafb5dee8e3c530c6 (diff) |
WIP: blocking SPI write experimentsaddressable-leds-control
Diffstat (limited to 'Libraries/LED_Driver/led_driver_process.c')
-rw-r--r-- | Libraries/LED_Driver/led_driver_process.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Libraries/LED_Driver/led_driver_process.c b/Libraries/LED_Driver/led_driver_process.c index 2389212..f809688 100644 --- a/Libraries/LED_Driver/led_driver_process.c +++ b/Libraries/LED_Driver/led_driver_process.c @@ -8,6 +8,23 @@ // ---------------------------------------------------------------------------- void LEDDriverProcessFromISR ( void ) { - LED_ST_PIN_RESET; - SPI_I2S_SendData16 ( LED_SPIx, (uint16_t)0 ); -}
\ No newline at end of file + asm volatile("cpsid i"); + LED_ST_PIN_RESET; + for (int j = 0; j < 4; j++) { + LED_SPIx->DR = 0; + while (SPI_I2S_FLAG_BSY & LED_SPIx->SR); + for (int i = 0; i < 4; i++) { + LED_SPIx->DR = 0xf8f8; + while (SPI_I2S_FLAG_BSY & LED_SPIx->SR); + } + for (int i = 0; i < 4; i++) { + LED_SPIx->DR = 0xe0e0; + while (SPI_I2S_FLAG_BSY & LED_SPIx->SR); + } + for (int i = 0; i < 4; i++) { + LED_SPIx->DR = 0xe0e0; + while (SPI_I2S_FLAG_BSY & LED_SPIx->SR); + } + } + asm volatile("cpsie i"); +} |