diff options
| author | Keith Packard <keithp@keithp.com> | 2011-08-13 21:09:19 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-08-13 21:09:19 -0700 |
| commit | dcd15032eec45f3fdd003050710ebd5b85052662 (patch) | |
| tree | 774e50fc8fc1e5205adbf2fbba22dda808693ee6 /altosui/AltosEepromChunk.java | |
| parent | 3ba7b6196f68078f4ed4538c4e7fe30699dfe908 (diff) | |
altosui: Eliminate inter-chunk flush_input calls
Once the serial line is nicely synchronized, we don't need to flush
input between chunks. This speeds up eeprom downloading quite a bit.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosEepromChunk.java')
| -rw-r--r-- | altosui/AltosEepromChunk.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/altosui/AltosEepromChunk.java b/altosui/AltosEepromChunk.java index fb632a3f..59767c2a 100644 --- a/altosui/AltosEepromChunk.java +++ b/altosui/AltosEepromChunk.java @@ -59,14 +59,15 @@ public class AltosEepromChunk { return true; } - public AltosEepromChunk(AltosSerial serial_line, int block) + public AltosEepromChunk(AltosSerial serial_line, int block, boolean flush) throws TimeoutException, InterruptedException { int offset; data = new int[chunk_size]; address = block * chunk_size; - serial_line.flush_input(); + if (flush) + serial_line.flush_input(); serial_line.printf("e %x\n", block); for (offset = 0; offset < chunk_size; offset += per_line) { |
