summaryrefslogtreecommitdiff
path: root/controller/fw/src/main.c
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-17 17:20:43 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-17 17:20:43 +0100
commit80de5c2e24056d38e49c4aeff4f84a299165d933 (patch)
treedafe4bb88ca5e40ab87a88aab1335dcd52989be1 /controller/fw/src/main.c
parent9d72724ca5fc130448ba0e93b5e46ed83f419d85 (diff)
downloadmaster-thesis-80de5c2e24056d38e49c4aeff4f84a299165d933.tar.gz
master-thesis-80de5c2e24056d38e49c4aeff4f84a299165d933.tar.bz2
master-thesis-80de5c2e24056d38e49c4aeff4f84a299165d933.zip
Debugging signal capture subsystem
Diffstat (limited to 'controller/fw/src/main.c')
-rw-r--r--controller/fw/src/main.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/controller/fw/src/main.c b/controller/fw/src/main.c
index b100b16..6589297 100644
--- a/controller/fw/src/main.c
+++ b/controller/fw/src/main.c
@@ -197,7 +197,7 @@ int main(void)
clock_setup();
con_usart_init();
- con_printf("\033[2J\033[HBooting...\r\n");
+ con_printf("\033[0m\033[2J\033[HBooting...\r\n");
led_setup();
spi_flash_setup();
@@ -217,9 +217,22 @@ int main(void)
while (23) {
if (adc_fft_buf_ready_idx != -1) {
GPIOA->BSRR = 1<<11;
- adc_fft_buf_ready_idx = !adc_fft_buf_ready_idx; /* 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);
+ //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);
+
+ 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;