Use LED_COUNT define

This commit is contained in:
fruchti 2020-07-16 18:17:54 +02:00
parent 19a78f2527
commit ddc5c5f1f1
2 changed files with 3 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#include "led.h"
#include "stm32f030x6.h"
LED_Colour_t LED_PixelData[LED_ROWS * LED_COLUMNS / 3] = {{0}};
LED_Colour_t LED_PixelData[LED_COUNT] = {{0}};
volatile bool LED_FrameFlag = false;
#define LED_ODR_MASK ((1 << PIN_LED_R_0) | (1 << PIN_LED_G_0) \

View file

@ -8,6 +8,7 @@
#define LED_BITS 12
#define LED_ROWS 8 // Rows are driven by a shift register
#define LED_COLUMNS 12 // Columns are driven by the MCU directly
#define LED_COUNT (LED_ROWS * LED_COLUMNS / 3)
typedef struct
{
@ -17,7 +18,7 @@ typedef struct
} __attribute__((packed)) LED_Colour_t;
// Pixel data, not displayed until LED_Commit() is called
extern LED_Colour_t LED_PixelData[LED_ROWS * LED_COLUMNS / 3];
extern LED_Colour_t LED_PixelData[LED_COUNT];
// Is set to true for every frame, can be used for timing or synchronisation
// externally. Will not be set to false within led.c.