From: Keith Packard Date: Sun, 8 Feb 2015 01:09:40 +0000 (-0800) Subject: altosuilib: Reset telemetry state after processing it X-Git-Tag: 1.6~8 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=cbc9ecd960d0dd27a2275b4550c30c5c88ccf5bb altosuilib: Reset telemetry state after processing it This avoids re-using stale state after switching telemetry reception parameters around, which otherwise generates spurious entries for the wrong frequencies in the scan results list. Signed-off-by: Keith Packard --- diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java index 1b30f99d..a20a7e14 100644 --- a/altosuilib/AltosScanUI.java +++ b/altosuilib/AltosScanUI.java @@ -210,6 +210,8 @@ public class AltosScanUI frequencies[frequency_index], telemetry, rate); + /* Reset the state so we don't get this data for another channel */ + state.init(); Runnable r = new Runnable() { public void run() { results.add(result); @@ -254,9 +256,6 @@ public class AltosScanUI void next() throws InterruptedException, TimeoutException { reader.set_monitor(false); - /* Let any pending input from the last configuration drain out */ - Thread.sleep(100); - if (select_rate) { boolean wrapped = false; do {