From 36cc3e1c0a864e50ff01f7c1334b62fcd5b31ec7 Mon Sep 17 00:00:00 2001 From: giomba Date: Sat, 3 Dec 2022 20:54:51 +0100 Subject: [PATCH] Remove legacy pointer to vga_pixel machine from VGA module. --- src/vga.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vga.c b/src/vga.c index 09d56cf..0bade65 100644 --- a/src/vga.c +++ b/src/vga.c @@ -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);