From b17c8afdf20c7c01c483ccd455a7b744d18a3d7c Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Tue, 16 Jun 2020 14:26:40 +0200 Subject: [PATCH] Updated scan command --- main.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index a58f256..ddbd41c 100644 --- a/main.c +++ b/main.c @@ -964,7 +964,7 @@ bool sweep(bool break_on_operation) VNA_SHELL_FUNCTION(cmd_scan) { uint32_t start, stop; - int16_t points = sweep_points; + uint32_t points = sweep_points; int i; if (argc < 2 || argc > 4) { shell_printf("usage: scan {start(Hz)} {stop(Hz)} [points] [outmask]\r\n"); @@ -979,10 +979,31 @@ VNA_SHELL_FUNCTION(cmd_scan) } if (argc >= 3) { points = my_atoi(argv[2]); - if (points <= 0 || points > POINTS_COUNT) { - shell_printf("sweep points exceeds range "define_to_STR(POINTS_COUNT)"\r\n"); - return; + // if (points <= 0 || points > POINTS_COUNT) { + // shell_printf("sweep points exceeds range "define_to_STR(POINTS_COUNT)"\r\n"); + // return; + // } + } + + if (argc==4 && my_atoui(argv[3]) == 16) { + int old_step = setting.frequency_step; + float f_step = (stop-start)/ points; + setting.frequency_step = (int32_t)f_step; + streamPut(shell_stream, '{'); + dirty = true; + for (int i = 0; i>8) & 0xFF)); + // enable led } + streamPut(shell_stream, '}'); + setting.frequency_step = old_step; + return; } set_frequencies(start, stop, points);