projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: Add progress bar for eeprom downloading status
[fw/altos]
/
ao-tools
/
altosui
/
AltosSerial.java
diff --git
a/ao-tools/altosui/AltosSerial.java
b/ao-tools/altosui/AltosSerial.java
index e84f5b63e4e21c7ca5cdd0cbb0cb90c863383ced..a5566ab898d4f3eb096f2d131e925e585bf8a499 100644
(file)
--- a/
ao-tools/altosui/AltosSerial.java
+++ b/
ao-tools/altosui/AltosSerial.java
@@
-119,7
+119,8
@@
public class AltosSerial implements Runnable {
}
public void putc(char c) {
}
public void putc(char c) {
- libaltos.altos_putchar(altos, c);
+ if (altos != null)
+ libaltos.altos_putchar(altos, c);
}
public void print(String data) {
}
public void print(String data) {
@@
-134,8
+135,21
@@
public class AltosSerial implements Runnable {
public void open(altos_device device) throws FileNotFoundException {
close();
altos = libaltos.altos_open(device);
public void open(altos_device device) throws FileNotFoundException {
close();
altos = libaltos.altos_open(device);
+ if (altos == null)
+ throw new FileNotFoundException(device.getPath());
input_thread = new Thread(this);
input_thread.start();
input_thread = new Thread(this);
input_thread.start();
+ print("\nE 0\n");
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) {
+ }
+ flush();
+ }
+
+ public void set_channel(int channel) {
+ if (altos != null)
+ printf("m 0\nc r %d\nm 1\n", channel);
}
public AltosSerial() {
}
public AltosSerial() {