This commit is contained in:
Dylan Smith
2026-01-12 14:40:36 -05:00
parent 2624b59564
commit 73005fc56b
16 changed files with 1685 additions and 28 deletions

View File

@@ -1,15 +1,7 @@
#include "display.h"
#include "stm32f4xx_hal_ltdc.h"
#include "graphics.h"
__attribute__((section(".sdram")))
volatile rgb565_pixel_t framebuffer[DISPLAY_HEIGHT * DISPLAY_WIDTH];
__attribute__((section(".sdram")))
volatile uint32_t times_changed;
void DisplayTest(uint16_t color)
void DisplayTest(pixel_t color)
{
times_changed++;
for (uint16_t h = 0; h < DISPLAY_HEIGHT; h++)
{
for (uint16_t w = 0; w < DISPLAY_WIDTH; w++)
@@ -18,4 +10,18 @@ void DisplayTest(uint16_t color)
}
}
}
void DrawBox(uint32_t topleft_x_loc, uint32_t topleft_y_loc, uint32_t height, uint32_t width, pixel_t color)
{
for (uint32_t y = topleft_y_loc; y < (topleft_y_loc + height); y++)
{
for (uint32_t x = topleft_x_loc; x < (topleft_x_loc + width); x++)
{
if (x < DISPLAY_WIDTH && y < DISPLAY_HEIGHT)
{
framebuffer[(y * DISPLAY_WIDTH) + x] = color;
}
}
}
}