mirror of https://github.com/FOME-Tech/fome-fw.git
auto-sync
This commit is contained in:
parent
84e9e7fde3
commit
7c5b5ce5b2
|
@ -44,7 +44,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||||
* @see EngineSnifferPanel
|
* @see EngineSnifferPanel
|
||||||
*/
|
*/
|
||||||
public class Launcher {
|
public class Launcher {
|
||||||
public static final int CONSOLE_VERSION = 20170129;
|
public static final int CONSOLE_VERSION = 20170205;
|
||||||
public static final boolean SHOW_STIMULATOR = false;
|
public static final boolean SHOW_STIMULATOR = false;
|
||||||
private static final String TAB_INDEX = "main_tab";
|
private static final String TAB_INDEX = "main_tab";
|
||||||
protected static final String PORT_KEY = "port";
|
protected static final String PORT_KEY = "port";
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.awt.event.ActionEvent;
|
||||||
public class EraseChip extends ProcessStatusWindow {
|
public class EraseChip extends ProcessStatusWindow {
|
||||||
private final JButton button = new JButton("Erase Chip");
|
private final JButton button = new JButton("Erase Chip");
|
||||||
|
|
||||||
private static final String OPEN_OCD_COMMAND = FirmwareFlasher.OPENOCD_BIN +
|
private static final String OPEN_OCD_COMMAND = FirmwareFlasher.OPENOCD_CMD +
|
||||||
" -c init -c targets -c \"halt\" -c \"flash erase_address 0x08000000 0x080000\" -c shutdown";
|
" -c init -c targets -c \"halt\" -c \"flash erase_address 0x08000000 0x080000\" -c shutdown";
|
||||||
|
|
||||||
public EraseChip() {
|
public EraseChip() {
|
||||||
|
|
|
@ -12,7 +12,9 @@ import java.io.*;
|
||||||
public class FirmwareFlasher extends ProcessStatusWindow {
|
public class FirmwareFlasher extends ProcessStatusWindow {
|
||||||
public static final String IMAGE_DEBUG_FILE = "rusefi_debug.bin";
|
public static final String IMAGE_DEBUG_FILE = "rusefi_debug.bin";
|
||||||
public static final String IMAGE_RELEASE_FILE = "rusefi_release.bin";
|
public static final String IMAGE_RELEASE_FILE = "rusefi_release.bin";
|
||||||
static final String OPENOCD_BIN = "openocd.exe -f stm32f429disc1.cfg";
|
static final String OPENOCD_EXE = "openocd.exe";
|
||||||
|
static final String BINARY_LOCATION = "openocd";
|
||||||
|
static final String OPENOCD_CMD = BINARY_LOCATION + File.separator + OPENOCD_EXE + " -f stm32f429disc1.cfg";
|
||||||
private static final String SUCCESS_MESSAGE_TAG = "shutdown command invoked";
|
private static final String SUCCESS_MESSAGE_TAG = "shutdown command invoked";
|
||||||
private static final String FAILED_MESSAGE_TAG = "failed";
|
private static final String FAILED_MESSAGE_TAG = "failed";
|
||||||
private static final String NO_DRIVER_MESSAGE_TAG = "failed with LIBUSB_ERROR_NOT_SUPPORTED";
|
private static final String NO_DRIVER_MESSAGE_TAG = "failed with LIBUSB_ERROR_NOT_SUPPORTED";
|
||||||
|
@ -50,7 +52,7 @@ public class FirmwareFlasher extends ProcessStatusWindow {
|
||||||
wnd.appendMsg(fileName + " not found, cannot proceed !!!");
|
wnd.appendMsg(fileName + " not found, cannot proceed !!!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
StringBuffer error = executeCommand(OPENOCD_BIN + " -c \"program ../" +
|
StringBuffer error = executeCommand(OPENOCD_CMD + " -c \"program ../" +
|
||||||
fileName +
|
fileName +
|
||||||
" verify reset exit 0x08000000\"");
|
" verify reset exit 0x08000000\"");
|
||||||
if (error.toString().contains(NO_DRIVER_MESSAGE_TAG)) {
|
if (error.toString().contains(NO_DRIVER_MESSAGE_TAG)) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.io.*;
|
||||||
* (c) Andrey Belomutskiy 2013-2017
|
* (c) Andrey Belomutskiy 2013-2017
|
||||||
*/
|
*/
|
||||||
public class ProcessStatusWindow {
|
public class ProcessStatusWindow {
|
||||||
|
|
||||||
public static boolean isWindows() {
|
public static boolean isWindows() {
|
||||||
return System.getProperty("os.name").toLowerCase().contains("win");
|
return System.getProperty("os.name").toLowerCase().contains("win");
|
||||||
}
|
}
|
||||||
|
@ -50,11 +51,17 @@ public class ProcessStatusWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected StringBuffer executeCommand(String command) {
|
protected StringBuffer executeCommand(String command) {
|
||||||
|
StringBuffer error = new StringBuffer();
|
||||||
|
String binaryFullName = FirmwareFlasher.BINARY_LOCATION + File.separator + FirmwareFlasher.OPENOCD_EXE;
|
||||||
|
if (!new File(binaryFullName).exists()) {
|
||||||
|
wnd.appendMsg(binaryFullName + " not found :(");
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
wnd.appendMsg("Executing " + command);
|
wnd.appendMsg("Executing " + command);
|
||||||
StringBuffer output = new StringBuffer();
|
StringBuffer output = new StringBuffer();
|
||||||
StringBuffer error = new StringBuffer();
|
|
||||||
try {
|
try {
|
||||||
File workingDir = new File("openocd");
|
File workingDir = new File(FirmwareFlasher.BINARY_LOCATION);
|
||||||
Process p = Runtime.getRuntime().exec(command, null, workingDir);
|
Process p = Runtime.getRuntime().exec(command, null, workingDir);
|
||||||
startStreamThread(p, p.getInputStream(), output);
|
startStreamThread(p, p.getInputStream(), output);
|
||||||
startStreamThread(p, p.getErrorStream(), error);
|
startStreamThread(p, p.getErrorStream(), error);
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class IniFileModel {
|
||||||
if (fields.isEmpty())
|
if (fields.isEmpty())
|
||||||
return;
|
return;
|
||||||
if (dialogUiName == null)
|
if (dialogUiName == null)
|
||||||
throw new NullPointerException("dialogUiName for" + fields);
|
dialogUiName = dialogId;
|
||||||
dialogs.put(dialogUiName, new DialogModel(dialogId, dialogUiName, fields));
|
dialogs.put(dialogUiName, new DialogModel(dialogId, dialogUiName, fields));
|
||||||
|
|
||||||
dialogId = null;
|
dialogId = null;
|
||||||
|
|
Loading…
Reference in New Issue