projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: check for closed serial device before reading
[fw/altos]
/
ao-tools
/
altosui
/
AltosSerial.java
diff --git
a/ao-tools/altosui/AltosSerial.java
b/ao-tools/altosui/AltosSerial.java
index f12b31b3187e9b253b4a3560080db9d8e2966d7e..96e8b61f599d2329678dbe547b3edc3eb3389f11 100644
(file)
--- a/
ao-tools/altosui/AltosSerial.java
+++ b/
ao-tools/altosui/AltosSerial.java
@@
-51,6
+51,8
@@
public class AltosSerial implements Runnable {
try {
for (;;) {
try {
for (;;) {
+ if (altos == null)
+ break;
c = libaltos.altos_getchar(altos, 0);
if (Thread.interrupted())
break;
c = libaltos.altos_getchar(altos, 0);
if (Thread.interrupted())
break;
@@
-139,7
+141,7
@@
public class AltosSerial implements Runnable {
throw new FileNotFoundException(device.getPath());
input_thread = new Thread(this);
input_thread.start();
throw new FileNotFoundException(device.getPath());
input_thread = new Thread(this);
input_thread.start();
- print("\nE 0\n
m 1\n
");
+ print("\nE 0\n");
try {
Thread.sleep(200);
} catch (InterruptedException e) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {