mirror of https://github.com/rusefi/rusefi-1.git
parent
ad3d9ea559
commit
3fda7305f1
|
@ -80,7 +80,10 @@ public class DfuFlasher {
|
||||||
wnd.appendMsg("rusEFI console can only program on Windows");
|
wnd.appendMsg("rusEFI console can only program on Windows");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ExecHelper.submitAction(() -> executeDFU(wnd), DfuFlasher.class + " thread");
|
ExecHelper.submitAction(() -> {
|
||||||
|
timeForDfuSwitch(wnd);
|
||||||
|
executeDFU(wnd);
|
||||||
|
}, DfuFlasher.class + " thread");
|
||||||
} else {
|
} else {
|
||||||
wnd.appendMsg("Please use manual DFU to change bundle type.");
|
wnd.appendMsg("Please use manual DFU to change bundle type.");
|
||||||
}
|
}
|
||||||
|
@ -93,12 +96,6 @@ public class DfuFlasher {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void executeDFU(StatusWindow wnd) {
|
private static void executeDFU(StatusWindow wnd) {
|
||||||
wnd.appendMsg("Giving time for USB enumeration...");
|
|
||||||
try {
|
|
||||||
Thread.sleep(3 * Timeouts.SECOND);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new IllegalStateException(e);
|
|
||||||
}
|
|
||||||
AtomicBoolean errorReported = new AtomicBoolean();
|
AtomicBoolean errorReported = new AtomicBoolean();
|
||||||
StringBuffer stdout = new StringBuffer();
|
StringBuffer stdout = new StringBuffer();
|
||||||
String errorResponse = ExecHelper.executeCommand(FirmwareFlasher.BINARY_LOCATION,
|
String errorResponse = ExecHelper.executeCommand(FirmwareFlasher.BINARY_LOCATION,
|
||||||
|
@ -140,6 +137,15 @@ public class DfuFlasher {
|
||||||
wnd.appendMsg("Please power cycle device to exit DFU mode");
|
wnd.appendMsg("Please power cycle device to exit DFU mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void timeForDfuSwitch(StatusWindow wnd) {
|
||||||
|
wnd.appendMsg("Giving time for USB enumeration...");
|
||||||
|
try {
|
||||||
|
Thread.sleep(2 * Timeouts.SECOND);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new IllegalStateException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static String getDfuCommand() {
|
private static String getDfuCommand() {
|
||||||
String fileName = IniFileModel.findFile(Launcher.INPUT_FILES_PATH, "rusefi", ".dfu");
|
String fileName = IniFileModel.findFile(Launcher.INPUT_FILES_PATH, "rusefi", ".dfu");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue