summaryrefslogtreecommitdiff
path: root/Libraries/LED_Driver/led_driver_process.c
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LED_Driver/led_driver_process.c')
-rw-r--r--Libraries/LED_Driver/led_driver_process.c23
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");
+}