reducing code duplication & reboot to rusEfi console

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ import java.awt.*;
import static com.rusefi.CommandControl.TEST;
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() {
content.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
@ -21,6 +21,12 @@ public class BenchTestPane {
content.add(createMILTest());
content.add(createIdleTest());
content.add(createDizzyTest());
content.add(new CommandControl("Reboot", "", "Reboot") {
@Override
protected String getCommand() {
return "reboot";
}
}.getContent());
content.add(new MessagesView().messagesScroll);
}

View File

@ -46,7 +46,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
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 String INPUT_FILES_PATH = "..";
private static final String TAB_INDEX = "main_tab";