summaryrefslogtreecommitdiff
path: root/Libraries/LED_Driver/led_driver_process.c
blob: f809688c748911e3bfdf9f2b601e768cc3da9619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "led_driver_process.h"
#include "led_driver_config.h"
#include <stdint.h>


// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
void LEDDriverProcessFromISR ( void )
{ 
    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");
}