From 7b17e9cfa6f7d737b598d3aa9b869935c11ea569 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Sat, 21 Mar 2020 18:25:36 +0300 Subject: [PATCH] Add bandwidth command --- main.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index df78417..67e630a 100644 --- a/main.c +++ b/main.c @@ -844,7 +844,7 @@ bool sweep(bool break_on_operation) accumerate_count = bandwidth_accumerate_count[bandwidth]; // blink LED while scanning palClearPad(GPIOC, GPIOC_LED); - // Power stabilization after LED off, also align timings on i == 0 + // Power stabilization after LED off, also align timings on delay == 0 for (; p_sweep < sweep_points; p_sweep++) { // 5300 if (frequencies[p_sweep] == 0) break; delay+= set_frequency(frequencies[p_sweep]); @@ -878,6 +878,18 @@ bool sweep(bool break_on_operation) return true; } +VNA_SHELL_FUNCTION(cmd_bandwidth) +{ + if (argc != 1) { + shell_printf("bandwidth %d\r\n", bandwidth); + return; + } + uint8_t v = my_atoui(argv[0]); + if (v>=sizeof(bandwidth_accumerate_count)) + return; + bandwidth = v; +} + VNA_SHELL_FUNCTION(cmd_scan) { uint32_t start, stop; @@ -2154,6 +2166,7 @@ static const VNAShellCommand commands[] = {"reset" , cmd_reset , 0}, {"freq" , cmd_freq , CMD_WAIT_MUTEX}, {"offset" , cmd_offset , CMD_WAIT_MUTEX}, + {"bandwidth" , cmd_bandwidth , CMD_WAIT_MUTEX}, #ifdef ENABLE_TIME_COMMAND {"time" , cmd_time , 0}, #endif