Skip to content

Commit

Permalink
pico: reserve scanvideo DMA channels to avoid conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak committed Feb 26, 2023
1 parent 6d8f7c5 commit dd36885
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 32blit-pico/display_scanvideo.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "display.hpp"

#include "hardware/clocks.h"
#include "hardware/dma.h"
#include "pico/time.h"
#include "pico/scanvideo.h"
#include "pico/scanvideo/composable_scanline.h"
Expand Down Expand Up @@ -43,7 +44,9 @@ static void fill_scanline_buffer(struct scanvideo_scanline_buffer *buffer) {
}

void init_display() {

// channel 0 get claimed later, channel 3 doesn't get claimed, but does get used
// reserve them so out claims don't conflict
dma_claim_mask(1 << 0 | 1 << 3);
}

void update_display(uint32_t time) {
Expand All @@ -56,6 +59,8 @@ void update_display(uint32_t time) {
}

void init_display_core1() {
dma_unclaim_mask(1 << 0 | 1 << 3);

// no mode switching yet
#if ALLOW_HIRES
#if DISPLAY_HEIGHT == 160 // extra middle mode
Expand Down

0 comments on commit dd36885

Please sign in to comment.