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);