From fed186a49fc8f27a8a31fd40f8c8b26d32a4b932 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 15 Mar 2020 14:47:25 +0100 Subject: Add end-to-end simulation --- controller/fw/src/adc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'controller/fw/src/adc.c') diff --git a/controller/fw/src/adc.c b/controller/fw/src/adc.c index 07431be..74f0aa9 100644 --- a/controller/fw/src/adc.c +++ b/controller/fw/src/adc.c @@ -51,8 +51,9 @@ void adc_init() { ADC1->CR1 = (0<CR2 = (1<SQR3 = (adc_channel<SQR3 = (adc_channel<SQR1 = (0<SMPR2 = (7<CR2 = (2<CCMR1 = (6<LISR >> DMA_LISR_FEIF0_Pos) & 0x3f; GPIOA->ODR ^= 1<<7; + GPIOA->BSRR = 1<<10; if (isr & DMA_LISR_TCIF0) { /* Transfer complete */ /* Check we're done processing the old buffer */ - if (adc_fft_buf_ready_idx != -1) + if (adc_fft_buf_ready_idx != -1) { /* FIXME DEBUG */ + GPIOA->BSRR = 1<<10<<16; + /* clear all flags */ + adc_dma->LIFCR = isr<CR & DMA_SxCR_CT); @@ -103,6 +110,7 @@ void DMA2_Stream0_IRQHandler(void) { if (isr & DMA_LISR_TEIF0) /* Transfer error */ panic(); + GPIOA->BSRR = 1<<10<<16; /* clear all flags */ adc_dma->LIFCR = isr<