Add bandwidth command

This commit is contained in:
DiSlord 2020-03-21 18:25:36 +03:00
parent 4c8a476265
commit 7b17e9cfa6

15
main.c
View file

@ -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