Remove legacy pointer to vga_pixel machine from VGA module.

This commit is contained in:
giomba 2022-12-03 20:54:51 +01:00
parent ac055b6673
commit 36cc3e1c0a
1 changed files with 2 additions and 3 deletions

View File

@ -21,7 +21,6 @@ typedef struct PIORun
} PIORun;
static PIORun vga_hsync, vga_vsync, vga_pixel;
static PIORun *vga_pixel_ptr = &vga_pixel;
static bool dma_ready = false;
static int dma_channel;
@ -91,7 +90,7 @@ void dma_handler(void)
void new_frame_handler(void)
{
if (vga_pixel_ptr && dma_ready)
if (dma_ready)
{
// Explicitly put the first uint32_t word in the FIFO,
// because, when PIO pulls data for the first time,
@ -103,7 +102,7 @@ void new_frame_handler(void)
// Also note: despite the "blocking put", when this interrupt
// is serviced, PIO FIFO is always empty, so in practice
// this will never block.
pio_sm_put_blocking(vga_pixel_ptr->pio, vga_pixel_ptr->sm, 0);
pio_sm_put_blocking(vga_pixel.pio, vga_pixel.sm, 0);
// Start DMA (but skip the initial word, which has been put manually)
dma_channel_set_read_addr(dma_channel, &frame[4], true);