reducing code duplication & reboot to rusEfi console

This commit is contained in:
rusEfi 2019-06-28 23:33:48 -04:00
parent f67689911d
commit ed32a9c7b2
5 changed files with 15 additions and 5 deletions

View File

@ -37,6 +37,9 @@
#include "idle_thread.h" #include "idle_thread.h"
#include "periodic_controller.h" #include "periodic_controller.h"
#include "tps.h" #include "tps.h"
#if EFI_PROD_CODE
#include "rusefi.h"
#endif /* EFI_PROD_CODE */
EXTERN_ENGINE EXTERN_ENGINE
; ;
@ -299,8 +302,8 @@ void executeTSCommand(uint16_t subsystem, uint16_t index) {
scheduleStopEngine(); scheduleStopEngine();
} else if (subsystem == 0xbb) { } else if (subsystem == 0xbb) {
#if EFI_PROD_CODE #if EFI_PROD_CODE
NVIC_SystemReset(); rebootNow();
#endif #endif /* EFI_PROD_CODE */
} }
} }

View File

@ -145,7 +145,7 @@ EXTERN_ENGINE
; ;
// todo: move this into a hw-specific file // todo: move this into a hw-specific file
static void rebootNow(void) { void rebootNow(void) {
NVIC_SystemReset(); NVIC_SystemReset();
} }

View File

@ -9,5 +9,6 @@
#define RUSEFI_H_ #define RUSEFI_H_
void runRusEfi(void); void runRusEfi(void);
void rebootNow(void);
#endif /* RUSEFI_H_ */ #endif /* RUSEFI_H_ */

View File

@ -9,7 +9,7 @@ import java.awt.*;
import static com.rusefi.CommandControl.TEST; import static com.rusefi.CommandControl.TEST;
public class BenchTestPane { public class BenchTestPane {
private final JPanel content = new JPanel(new GridLayout(2, 4)); private final JPanel content = new JPanel(new GridLayout(2, 5));
public BenchTestPane() { public BenchTestPane() {
content.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); content.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
@ -21,6 +21,12 @@ public class BenchTestPane {
content.add(createMILTest()); content.add(createMILTest());
content.add(createIdleTest()); content.add(createIdleTest());
content.add(createDizzyTest()); content.add(createDizzyTest());
content.add(new CommandControl("Reboot", "", "Reboot") {
@Override
protected String getCommand() {
return "reboot";
}
}.getContent());
content.add(new MessagesView().messagesScroll); content.add(new MessagesView().messagesScroll);
} }

View File

@ -46,7 +46,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 = 20190625; public static final int CONSOLE_VERSION = 20190628;
public static final boolean SHOW_STIMULATOR = false; public static final boolean SHOW_STIMULATOR = false;
public static final String INPUT_FILES_PATH = ".."; public static final String INPUT_FILES_PATH = "..";
private static final String TAB_INDEX = "main_tab"; private static final String TAB_INDEX = "main_tab";