projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Document how to add a new product
[fw/altos]
/
micropeak
/
MicroDownload.java
diff --git
a/micropeak/MicroDownload.java
b/micropeak/MicroDownload.java
index be5a8568c0b23947d6aa6f4f28c80a6d160482ac..4dcb7a360e928e2457b084bc0bc5d3d6d545c3cd 100644
(file)
--- a/
micropeak/MicroDownload.java
+++ b/
micropeak/MicroDownload.java
@@
-158,6
+158,7
@@
public class MicroDownload extends AltosUIDialog implements Runnable, ActionList
} catch (MicroData.NonHexcharException nhe) {
}
}
} catch (MicroData.NonHexcharException nhe) {
}
}
+ write_thread.join();
} catch (FileNotFoundException fe) {
} catch (IOException ioe) {
} catch (InterruptedException ie) {
} catch (FileNotFoundException fe) {
} catch (IOException ioe) {
} catch (InterruptedException ie) {
@@
-168,16
+169,34
@@
public class MicroDownload extends AltosUIDialog implements Runnable, ActionList
}
Thread serial_thread;
}
Thread serial_thread;
+ Thread write_thread;
+
+ public class SerialWriter implements Runnable {
+ MicroSerial serial;
+
+ public void run () {
+ try {
+ Thread.sleep(100);
+ serial.write('l');
+ serial.write('\n');
+ serial.flush();
+ } catch (InterruptedException ie) {
+ }
+ }
- public void start() {
- try {
- serial = new MicroSerial(device);
- serial.set_log(this);
- } catch (FileNotFoundException fe) {
- return;
+ public SerialWriter(MicroSerial serial) {
+ this.serial = serial;
}
}
+ }
+
+ public void start() {
+ serial.set_log(this);
serial_thread = new Thread(this);
serial_thread.start();
serial_thread = new Thread(this);
serial_thread.start();
+
+ SerialWriter writer = new SerialWriter(serial);
+ write_thread = new Thread(writer);
+ write_thread.start();
}
public void actionPerformed(ActionEvent ae) {
}
public void actionPerformed(ActionEvent ae) {
@@
-188,7
+207,7
@@
public class MicroDownload extends AltosUIDialog implements Runnable, ActionList
setVisible(false);
}
setVisible(false);
}
- public MicroDownload(MicroPeak owner, AltosDevice device) {
+ public MicroDownload(MicroPeak owner, AltosDevice device
, MicroSerial serial
) {
super (owner, "Download MicroPeak Data", false);
int y = 0;
super (owner, "Download MicroPeak Data", false);
int y = 0;
@@
-199,8
+218,9
@@
public class MicroDownload extends AltosUIDialog implements Runnable, ActionList
this.owner = owner;
this.device = device;
this.owner = owner;
this.device = device;
+ this.serial = serial;
- pane = get
Content
Pane();
+ pane = get
Scrollable
Pane();
pane.setLayout(new GridBagLayout());
c = new GridBagConstraints();
pane.setLayout(new GridBagLayout());
c = new GridBagConstraints();