projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: Add 1.0 release notes.
[fw/altos]
/
altosui
/
AltosEepromDelete.java
diff --git
a/altosui/AltosEepromDelete.java
b/altosui/AltosEepromDelete.java
index c95eda153d5c5edc07eee944b0cd0324a7266d8d..94951ced3758c66be524b980643d394accb98fe8 100644
(file)
--- a/
altosui/AltosEepromDelete.java
+++ b/
altosui/AltosEepromDelete.java
@@
-49,11
+49,9
@@
public class AltosEepromDelete implements Runnable {
*/
serial_line.flush_input();
serial_line.printf("d %d\n", log.flight);
*/
serial_line.flush_input();
serial_line.printf("d %d\n", log.flight);
- System.out.printf("Attempt to delete flight %d\n", log.flight);
for (;;) {
/* It can take a while to erase the flash... */
String line = serial_line.get_reply(20000);
for (;;) {
/* It can take a while to erase the flash... */
String line = serial_line.get_reply(20000);
- System.out.printf("got back line %s\n", line);
if (line == null)
throw new TimeoutException();
if (line.equals("Erased"))
if (line == null)
throw new TimeoutException();
if (line.equals("Erased"))
@@
-86,17
+84,16
@@
public class AltosEepromDelete implements Runnable {
}
public void run () {
}
public void run () {
- if (remote)
- serial_line.start_remote();
-
success = false;
try {
success = false;
try {
+ if (remote)
+ serial_line.start_remote();
+
for (AltosEepromLog log : flights) {
if (log.delete) {
DeleteLog(log);
}
}
for (AltosEepromLog log : flights) {
if (log.delete) {
DeleteLog(log);
}
}
- System.out.printf("All flights successfully deleted\n");
success = true;
} catch (IOException ee) {
show_error (ee.getLocalizedMessage(),
success = true;
} catch (IOException ee) {
show_error (ee.getLocalizedMessage(),
@@
-106,11
+103,12
@@
public class AltosEepromDelete implements Runnable {
show_error (String.format("Connection to \"%s\" failed",
serial_line.device.toShortString()),
"Connection Failed");
show_error (String.format("Connection to \"%s\" failed",
serial_line.device.toShortString()),
"Connection Failed");
+ } finally {
+ if (remote)
+ serial_line.stop_remote();
+ serial_line.flush_output();
+ serial_line.close();
}
}
- if (remote)
- serial_line.stop_remote();
- serial_line.flush_output();
- serial_line.close();
if (listener != null) {
Runnable r = new Runnable() {
public void run() {
if (listener != null) {
Runnable r = new Runnable() {
public void run() {