Merge pull request #71 from Ho-Ro/scanraw_unbuf

additional "unbuffered" option for scanraw
pull/78/head
erikkaashoek 2 years ago committed by GitHub
commit 2939d1bfbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1226,8 +1226,9 @@ VNA_SHELL_FUNCTION(cmd_scanraw)
{
freq_t start, stop;
uint32_t points = sweep_points;
if (argc < 2 || argc > 3) {
usage_printf("scanraw {start(Hz)} {stop(Hz)} [points]\r\n");
uint8_t unbuffered = 0;
if (argc < 2 || argc > 4) {
usage_printf("scanraw {start(Hz)} {stop(Hz)} [points] [unbuffered]\r\n");
return;
}
@ -1237,10 +1238,14 @@ VNA_SHELL_FUNCTION(cmd_scanraw)
shell_printf("frequency range is invalid\r\n");
return;
}
if (argc == 3) {
if (argc > 2) {
points = my_atoi(argv[2]);
}
if (argc > 3) {
unbuffered = my_atoi(argv[3]); // arg != 0 -> ubuffered
}
if (setting.waterfall)
disable_waterfall(); // display dma hangs when waterfall is enabled
@ -1266,7 +1271,7 @@ VNA_SHELL_FUNCTION(cmd_scanraw)
buf[idx++] = 'x';
buf[idx++] = (uint8_t)(val & 0xFF);
buf[idx++] = (uint8_t)((val>>8) & 0xFF);
if (idx >= BUFFER_SIZE - 4) {
if (unbuffered || idx >= BUFFER_SIZE - 4) {
streamWrite(shell_stream, buf, idx);
idx = 0;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.