diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-03-18 12:59:22 +0100 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-03-18 12:59:22 +0100 |
commit | 13bd8d0f2dc6195b73e1c15a82fbc172b4cda310 (patch) | |
tree | 30562d3265894b8e745b61c0d49b0abee27f69cf /controller/fw/src/main.c | |
parent | 4c7c927f3c1d24aa7ced382a5a417e5314e104c2 (diff) | |
download | master-thesis-13bd8d0f2dc6195b73e1c15a82fbc172b4cda310.tar.gz master-thesis-13bd8d0f2dc6195b73e1c15a82fbc172b4cda310.tar.bz2 master-thesis-13bd8d0f2dc6195b73e1c15a82fbc172b4cda310.zip |
Improve detector
Diffstat (limited to 'controller/fw/src/main.c')
-rw-r--r-- | controller/fw/src/main.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/controller/fw/src/main.c b/controller/fw/src/main.c index 6589297..814c723 100644 --- a/controller/fw/src/main.c +++ b/controller/fw/src/main.c @@ -216,23 +216,14 @@ int main(void) con_printf("Booted.\r\n"); while (23) { if (adc_fft_buf_ready_idx != -1) { + for (int i=0; i<168*1000*2; i++) + asm volatile ("nop"); GPIOA->BSRR = 1<<11; - //adc_fft_buf_ready_idx = !adc_fft_buf_ready_idx; /* DEBUG */ - //DEBUG: - //memcpy(adc_fft_buf[!adc_fft_buf_ready_idx], adc_fft_buf[adc_fft_buf_ready_idx] + FMEAS_FFT_LEN/2, sizeof(adc_fft_buf[0][0]) * FMEAS_FFT_LEN/2); + memcpy(adc_fft_buf[!adc_fft_buf_ready_idx], adc_fft_buf[adc_fft_buf_ready_idx] + FMEAS_FFT_LEN/2, sizeof(adc_fft_buf[0][0]) * FMEAS_FFT_LEN/2); + GPIOA->BSRR = 1<<11<<16; for (int i=0; i<168*1000*2; i++) asm volatile ("nop"); - /* BEGIN DEBUG */ - con_printf_blocking("\r\n%06d: ", freq_sample_ts); - int old_idx = adc_fft_buf_ready_idx; - for (int i=0; i<FMEAS_FFT_LEN/2; i++) - con_printf_blocking("%03x ", adc_fft_buf[old_idx][FMEAS_FFT_LEN/2 + i]); - adc_fft_buf_ready_idx = -1; - freq_sample_ts++; /* TODO: also increase in case of freq measurement error? */ - GPIOA->BSRR = 1<<11<<16; - continue; - /* END DEBUG */ GPIOA->BSRR = 1<<11; float out; |