fix initial ringbuffer head value

As the first two DMA transfers have already been
submitted during init, the correct start value
is 2.
This commit is contained in:
Steve Markgraf 2025-01-05 01:11:47 +01:00
parent 07d3f58650
commit 708ead241c
4 changed files with 4 additions and 4 deletions

View file

@ -50,7 +50,7 @@
static bool pio_dma_pong = false; static bool pio_dma_pong = false;
uint16_t ringbuffer[RBUF_TOTAL_LEN]; uint16_t ringbuffer[RBUF_TOTAL_LEN];
int ringbuf_head = 0; int ringbuf_head = 2;
void __scratch_y("") pio_dma_irq_handler() void __scratch_y("") pio_dma_irq_handler()
{ {

View file

@ -58,7 +58,7 @@
static bool pio_dma_pong = false; static bool pio_dma_pong = false;
uint16_t ringbuffer[RBUF_TOTAL_LEN]; uint16_t ringbuffer[RBUF_TOTAL_LEN];
int ringbuf_head = 0; int ringbuf_head = 2;
void __scratch_y("") pio_dma_irq_handler() void __scratch_y("") pio_dma_irq_handler()
{ {

View file

@ -55,7 +55,7 @@
static bool dma_adc_pong = false; static bool dma_adc_pong = false;
uint16_t ringbuffer[RBUF_TOTAL_LEN]; uint16_t ringbuffer[RBUF_TOTAL_LEN];
int ringbuf_head = 0; int ringbuf_head = 2;
void __scratch_y("") adc_dma_irq_handler() void __scratch_y("") adc_dma_irq_handler()
{ {

View file

@ -54,7 +54,7 @@
static bool pio_dma_pong = false; static bool pio_dma_pong = false;
uint16_t ringbuffer[RBUF_TOTAL_LEN]; uint16_t ringbuffer[RBUF_TOTAL_LEN];
int ringbuf_head = 0; int ringbuf_head = 2;
void __scratch_y("") pio_dma_irq_handler() void __scratch_y("") pio_dma_irq_handler()
{ {