From b6527780cb6c27614bd5985629562e7af5892e5e Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Mon, 12 Aug 2024 15:23:07 +0200 Subject: [PATCH] Continuous scanraw --- sa_cmd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sa_cmd.c b/sa_cmd.c index 2dfd857..283097c 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -1256,7 +1256,7 @@ VNA_SHELL_FUNCTION(cmd_scanraw) uint32_t points = sweep_points; uint8_t unbuffered = 0; if (argc < 2 || argc > 4) { - usage_printf("scanraw {start(Hz)} {stop(Hz)} [points] [unbuffered]\r\n"); + usage_printf("scanraw {start(Hz)} {stop(Hz)} [points] [options]\r\n"); return; } @@ -1280,7 +1280,7 @@ VNA_SHELL_FUNCTION(cmd_scanraw) freq_t old_step = setting.frequency_step; float f_step = (stop-start)/ points; setting.frequency_step = (freq_t)f_step; - +again: operation_requested = false; dirty = true; // adc_stop_analog_watchdog(); @@ -1299,7 +1299,7 @@ VNA_SHELL_FUNCTION(cmd_scanraw) buf[idx++] = 'x'; buf[idx++] = (uint8_t)(val & 0xFF); buf[idx++] = (uint8_t)((val>>8) & 0xFF); - if (unbuffered || idx >= BUFFER_SIZE - 4) { + if ((unbuffered & 1) || idx >= BUFFER_SIZE - 4) { streamWrite(shell_stream, buf, idx); idx = 0; } @@ -1312,6 +1312,8 @@ VNA_SHELL_FUNCTION(cmd_scanraw) buf[idx++] = '}'; streamWrite(shell_stream, buf, idx); // adc_start_analog_watchdog(); + if ((unbuffered & 2) && !operation_requested) + goto again; ili9341_set_background(LCD_BG_COLOR); ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1); setting.frequency_step = old_step;