projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: Reset eeprom download instance variables before reading flight
[fw/altos]
/
altosui
/
AltosSerial.java
diff --git
a/altosui/AltosSerial.java
b/altosui/AltosSerial.java
index b19143e58b7080070457d606a93e8798deaf9a71..3ad16b2b955e0d0d7deccb4573d40ff980883d14 100644
(file)
--- a/
altosui/AltosSerial.java
+++ b/
altosui/AltosSerial.java
@@
-47,6
+47,11
@@
public class AltosSerial implements Runnable {
byte[] line_bytes;
int line_count;
boolean monitor_mode;
byte[] line_bytes;
int line_count;
boolean monitor_mode;
+ static boolean debug;
+
+ static void set_debug(boolean new_debug) {
+ debug = new_debug;
+ }
public void run () {
int c;
public void run () {
int c;
@@
-84,7
+89,8
@@
public class AltosSerial implements Runnable {
q.put(new AltosLine (line));
}
} else {
q.put(new AltosLine (line));
}
} else {
-// System.out.printf("GOT: %s\n", line);
+ if (debug)
+ System.out.printf("\t\t\t\t\t%s\n", line);
reply_queue.put(new AltosLine (line));
}
line_count = 0;
reply_queue.put(new AltosLine (line));
}
line_count = 0;
@@
-176,13
+182,14
@@
public class AltosSerial implements Runnable {
}
}
}
}
- p
ublic
void putc(char c) {
+ p
rivate
void putc(char c) {
if (altos != null)
libaltos.altos_putchar(altos, c);
}
public void print(String data) {
if (altos != null)
libaltos.altos_putchar(altos, c);
}
public void print(String data) {
-// System.out.printf("\"%s\" ", data);
+ if (debug)
+ System.out.printf("%s", data);
for (int i = 0; i < data.length(); i++)
putc(data.charAt(i));
}
for (int i = 0; i < data.length(); i++)
putc(data.charAt(i));
}
@@
-242,6
+249,17
@@
public class AltosSerial implements Runnable {
}
}
}
}
+ public void start_remote() {
+ set_radio();
+ printf("p\nE 0\n");
+ flush_input();
+ }
+
+ public void stop_remote() {
+ printf ("~");
+ flush_output();
+ }
+
public AltosSerial(AltosDevice in_device) throws FileNotFoundException, AltosSerialInUseException {
device = in_device;
line = "";
public AltosSerial(AltosDevice in_device) throws FileNotFoundException, AltosSerialInUseException {
device = in_device;
line = "";