Add meaningful colour struct, double buffering

This commit is contained in:
fruchti 2019-12-22 22:52:01 +01:00
parent bc062dac9b
commit fff3b133c1
4 changed files with 93 additions and 15 deletions

View file

@ -10,8 +10,25 @@ int main(void)
LED_Init();
int ct = 0;
uint8_t *data = (uint8_t*)LED_PixelData;
while(1)
{
if(LED_FrameFlag)
{
LED_FrameFlag = false;
data[ct]++;
LED_Commit();
if(data[ct] == 255)
{
ct += 3;
if(ct >= LED_COLUMNS * LED_ROWS)
{
ct -= LED_COLUMNS * LED_ROWS;
ct += 1;
}
}
}
}
return 0;