auto-sync

This commit is contained in:
rusEfi 2017-01-04 19:01:27 -05:00
parent bd4c734fd1
commit 36b57ce9b9
3 changed files with 11 additions and 1 deletions

View File

@ -292,6 +292,9 @@
#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

View File

@ -131,8 +131,10 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size)
CommandHandler console_line_callback;
static bool is_serial_over_uart;
bool isSerialOverUart(void) {
return false;
return is_serial_over_uart;
}
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) || defined(__DOXYGEN__)
@ -246,6 +248,10 @@ 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)

View File

@ -17,6 +17,7 @@ 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);