Fix sweep if points < maximum (mot sweep if frequency[i] == 0)

Fix my tupo in extended scan command (not correctly parse point count)
This commit is contained in:
DiSlord 2020-03-14 16:48:36 +03:00
parent 8a11eaa764
commit 45dfd7d970

8
main.c
View file

@ -803,6 +803,7 @@ bool sweep(bool break_on_operation)
palClearPad(GPIOC, GPIOC_LED); palClearPad(GPIOC, GPIOC_LED);
// Power stabilization after LED off, also align timings on i == 0 // Power stabilization after LED off, also align timings on i == 0
for (i = 0; i < sweep_points; i++) { // 5300 for (i = 0; i < sweep_points; i++) { // 5300
if (frequencies[i] == 0) break;
delay = set_frequency(frequencies[i]); // 700 delay = set_frequency(frequencies[i]); // 700
tlv320aic3204_select(0); // 60 CH0:REFLECT, reset and begin measure tlv320aic3204_select(0); // 60 CH0:REFLECT, reset and begin measure
DSP_START(delay+((i==0)?2:0)); // 1900 DSP_START(delay+((i==0)?2:0)); // 1900
@ -853,10 +854,10 @@ VNA_SHELL_FUNCTION(cmd_scan)
shell_printf("frequency range is invalid\r\n"); shell_printf("frequency range is invalid\r\n");
return; return;
} }
if (argc == 3) { if (argc >= 3) {
points = my_atoi(argv[2]); points = my_atoi(argv[2]);
if (points <= 0 || points > sweep_points) { if (points <= 0 || points > sweep_points) {
shell_printf("sweep points exceeds range\r\n"); shell_printf("sweep points exceeds range "define_to_STR(POINTS_COUNT)"\r\n");
return; return;
} }
} }
@ -2148,9 +2149,6 @@ static int VNAShell_readLine(char *line, int max_size){
return 0; return 0;
} }
// Macros for convert define value to string
#define STR1(x) #x
#define define_to_STR(x) STR1(x)
// //
// Parse and run command line // Parse and run command line
// //