auto-sync
This commit is contained in:
parent
9047787196
commit
31c9a97620
|
@ -292,9 +292,6 @@
|
|||
#define GPS_SERIAL_DEVICE &SD1
|
||||
#define GPS_SERIAL_SPEED 38400
|
||||
|
||||
#define CONSOLE_MODE_SWITCH_PORT GPIOB
|
||||
#define CONSOLE_MODE_SWITCH_PIN 1
|
||||
|
||||
#define CONFIG_RESET_SWITCH_PORT GPIOD
|
||||
#define CONFIG_RESET_SWITCH_PIN 6
|
||||
|
||||
|
|
|
@ -129,15 +129,10 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size)
|
|||
}
|
||||
}
|
||||
|
||||
// todo: this is ugly as hell!
|
||||
static char consoleInput[] = " ";
|
||||
|
||||
CommandHandler console_line_callback;
|
||||
|
||||
static bool is_serial_over_uart;
|
||||
|
||||
bool isSerialOverUart(void) {
|
||||
return is_serial_over_uart;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) || defined(__DOXYGEN__)
|
||||
|
@ -146,6 +141,37 @@ static SerialConfig serialConfig = { SERIAL_SPEED, 0, USART_CR2_STOP1_BITS | USA
|
|||
|
||||
#if EFI_PROD_CODE || EFI_EGT || defined(__DOXYGEN__)
|
||||
|
||||
bool consoleInBinaryMode = false;
|
||||
|
||||
void runConsoleLoop(ts_channel_s *console) {
|
||||
if (boardConfiguration->startConsoleInBinaryMode) {
|
||||
// switch to binary protocol
|
||||
consoleInBinaryMode = true;
|
||||
runBinaryProtocolLoop(console, true);
|
||||
}
|
||||
|
||||
while (true) {
|
||||
efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "lowstck#9e");
|
||||
bool end = getConsoleLine((BaseSequentialStream*) console->channel, console->crcReadBuffer, sizeof(console->crcReadBuffer) - 3);
|
||||
if (end) {
|
||||
// firmware simulator is the only case when this happens
|
||||
continue;
|
||||
}
|
||||
|
||||
char *trimmed = efiTrim(console->crcReadBuffer);
|
||||
|
||||
(console_line_callback)(trimmed);
|
||||
|
||||
if (consoleInBinaryMode) {
|
||||
#if EFI_SIMULATOR || defined(__DOXYGEN__)
|
||||
logMsg("Switching to binary mode\r\n");
|
||||
#endif
|
||||
// switch to binary protocol
|
||||
runBinaryProtocolLoop(console, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SerialDriver * getConsoleChannel(void) {
|
||||
#if defined(EFI_CONSOLE_UART_DEVICE) || defined(__DOXYGEN__)
|
||||
if (isSerialOverUart()) {
|
||||
|
@ -169,8 +195,6 @@ bool isConsoleReady(void) {
|
|||
}
|
||||
#endif /* EFI_PROD_CODE || EFI_EGT */
|
||||
|
||||
bool consoleInBinaryMode = false;
|
||||
|
||||
ts_channel_s binaryConsole;
|
||||
|
||||
static THD_WORKING_AREA(consoleThreadStack, 3 * UTILITY_THREAD_STACK_SIZE);
|
||||
|
@ -187,34 +211,10 @@ static THD_FUNCTION(consoleThreadThreadEntryPoint, arg) {
|
|||
}
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
|
||||
binaryConsole.channel = (BaseChannel *) getConsoleChannel();
|
||||
runConsoleLoop(&binaryConsole);
|
||||
|
||||
if (boardConfiguration->startConsoleInBinaryMode) {
|
||||
// switch to binary protocol
|
||||
consoleInBinaryMode = true;
|
||||
runBinaryProtocolLoop(&binaryConsole, true);
|
||||
}
|
||||
|
||||
while (true) {
|
||||
efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "lowstck#9e");
|
||||
bool end = getConsoleLine((BaseSequentialStream*) getConsoleChannel(), consoleInput, sizeof(consoleInput));
|
||||
if (end) {
|
||||
// firmware simulator is the only case when this happens
|
||||
continue;
|
||||
}
|
||||
|
||||
char *trimmed = efiTrim(consoleInput);
|
||||
|
||||
(console_line_callback)(trimmed);
|
||||
|
||||
if (consoleInBinaryMode) {
|
||||
#if EFI_SIMULATOR || defined(__DOXYGEN__)
|
||||
logMsg("Switching to binary mode\r\n");
|
||||
#endif
|
||||
// switch to binary protocol
|
||||
runBinaryProtocolLoop(&binaryConsole, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 10 seconds
|
||||
|
@ -246,10 +246,6 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p)
|
|||
|
||||
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR) || defined(__DOXYGEN__)
|
||||
|
||||
palSetPadMode(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN, PAL_MODE_INPUT_PULLUP);
|
||||
|
||||
is_serial_over_uart = GET_CONSOLE_MODE_VALUE() == EFI_USE_UART_FOR_CONSOLE;
|
||||
|
||||
if (isSerialOverUart()) {
|
||||
/*
|
||||
* Activates the serial using the driver default configuration (that's 38400)
|
||||
|
|
|
@ -17,7 +17,6 @@ typedef void (*CommandHandler)(char *);
|
|||
#include "datalogging.h"
|
||||
|
||||
// todo: make this pin configurable
|
||||
#define GET_CONSOLE_MODE_VALUE() palReadPad(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN)
|
||||
#define SHOULD_INGORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
|
||||
|
||||
SerialDriver * getConsoleChannel(void);
|
||||
|
|
|
@ -931,9 +931,6 @@ static void printAllInfo(void) {
|
|||
#if EFI_ENGINE_SNIFFER
|
||||
scheduleMsg(&logger, "waveChartUsedSize=%d", waveChartUsedSize);
|
||||
#endif
|
||||
#if EFI_PROD_CODE
|
||||
scheduleMsg(&logger, "console mode jumper: %s", boolToString(!GET_CONSOLE_MODE_VALUE()));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void getValue(const char *paramStr) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import static com.rusefi.AutoTest.*;
|
|||
|
||||
/**
|
||||
* this test connects to real hardware via serial port
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/22/2015
|
||||
*/
|
||||
public class RealHwTest {
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.rusefi.autotune;
|
|||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/18/2016.
|
||||
*/
|
||||
public interface FuelAutoLogic {
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.Collection;
|
|||
|
||||
/**
|
||||
* 1/5/2016
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public enum FuelAutoTune implements FuelAutoLogic {
|
||||
INSTANCE;
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.rusefi.config.Fields;
|
|||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/18/2016.
|
||||
*/
|
||||
public enum FuelAutoTune2 implements FuelAutoLogic {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.rusefi.autotune;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/18/2016.
|
||||
*/
|
||||
public class MathUtil {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.rusefi.autotune;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/23/2016.
|
||||
*/
|
||||
public class Result {
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.rusefi.autotune;
|
|||
import com.rusefi.config.Fields;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/23/2016.
|
||||
*/
|
||||
public class stDataOnline {
|
||||
|
|
|
@ -13,7 +13,7 @@ import static com.rusefi.autotune.test.FuelAutoTuneTest.createVeTable;
|
|||
|
||||
/**
|
||||
* 2/23/2016
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class FuelAutoTune2Test {
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 1/5/2016
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class FuelAutoTuneTest {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.rusefi;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/22/2015
|
||||
*/
|
||||
public class CmdLine {
|
||||
|
|
|
@ -32,7 +32,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
|||
* <p/>
|
||||
* <p/>
|
||||
* 12/25/12
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*
|
||||
* @see StartupFrame
|
||||
* @see EngineSnifferPanel
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.io.File;
|
|||
import static com.romraider.editor.ecu.ECUEditorManager.getECUEditor;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 3/6/2015
|
||||
*/
|
||||
public class RomRaiderWrapper {
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.io.IOException;
|
|||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 4/15/2016.
|
||||
*/
|
||||
public class SensorLogger {
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* Date: 12/21/13
|
||||
* Andrey Belomutskiy (c) 2012-2013
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class SensorSnifferPane {
|
||||
private static final String HELP_URL = "http://rusefi.com/wiki/index.php?title=Manual:DevConsole#Analog_Chart";
|
||||
|
|
|
@ -38,7 +38,7 @@ public class StartupFrame {
|
|||
// todo: figure out a better way to work with absolute path
|
||||
private static final String APPICON = "appicon.png";
|
||||
private static final String LOGO = "logo.gif";
|
||||
private static final String LINK_TEXT = "rusEfi (c) 2012-2016";
|
||||
private static final String LINK_TEXT = "rusEfi (c) 2012-2017";
|
||||
private static final String URI = "http://rusefi.com/?java_console";
|
||||
private static final String VCP_DRIVER_TEXT = "vcp driver";
|
||||
private static final String VCP_DRIVER_URI = "http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/driver/stsw-stm32102.zip";
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.List;
|
|||
* This utility produces images of trigger signals supported by rusEfi
|
||||
*
|
||||
* 06/23/15
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class TriggerImage {
|
||||
private static final String TRIGGERTYPE = "TRIGGERTYPE";
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 3/7/2015
|
||||
*/
|
||||
public class UploadChanges {
|
||||
|
|
|
@ -4,7 +4,7 @@ import javax.swing.*;
|
|||
import java.awt.event.ActionEvent;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class EraseChip extends ProcessStatusWindow {
|
||||
private final JButton button = new JButton("Erase Chip");
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.awt.event.ActionListener;
|
|||
import java.io.*;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 2/4/15
|
||||
*/
|
||||
public class FirmwareFlasher extends ProcessStatusWindow {
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class ProcessStatusWindow {
|
||||
public static boolean isWindows() {
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.awt.event.ActionListener;
|
|||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class FormulasPane {
|
||||
private final JPanel content = new JPanel(new BorderLayout());
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 1/9/2016
|
||||
*
|
||||
* @see FuelAutoTune
|
||||
|
|
|
@ -9,7 +9,7 @@ import javax.swing.*;
|
|||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* (c) Andrey Belomutskiy 2013-2016
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
* 3/7/2015
|
||||
*/
|
||||
public class StatusWindow {
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||
* <p/>
|
||||
* <p/>
|
||||
* Date: 6/23/13
|
||||
* Andrey Belomutskiy (c) 2012-2013
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*
|
||||
* @see EngineSnifferStatusPanel status bar
|
||||
* @see com.rusefi.ui.test.WavePanelSandbox
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.Map;
|
|||
* <p/>
|
||||
* <p/>
|
||||
* Date: 12/26/13
|
||||
* Andrey Belomutskiy (c) 2012-2013
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
public class EngineSnifferStatusPanel {
|
||||
public final JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.awt.event.KeyEvent;
|
|||
|
||||
/**
|
||||
* 7/7/13
|
||||
* (c) Andrey Belomutskiy
|
||||
* (c) Andrey Belomutskiy 2013-2017
|
||||
*/
|
||||
class ZoomControl extends JPanel {
|
||||
// private final JLabel currentValue = new JLabel();
|
||||
|
|
Loading…
Reference in New Issue