auto-sync
This commit is contained in:
parent
bd4c734fd1
commit
36b57ce9b9
|
@ -292,6 +292,9 @@
|
||||||
#define GPS_SERIAL_DEVICE &SD1
|
#define GPS_SERIAL_DEVICE &SD1
|
||||||
#define GPS_SERIAL_SPEED 38400
|
#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_PORT GPIOD
|
||||||
#define CONFIG_RESET_SWITCH_PIN 6
|
#define CONFIG_RESET_SWITCH_PIN 6
|
||||||
|
|
||||||
|
|
|
@ -131,8 +131,10 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size)
|
||||||
|
|
||||||
CommandHandler console_line_callback;
|
CommandHandler console_line_callback;
|
||||||
|
|
||||||
|
static bool is_serial_over_uart;
|
||||||
|
|
||||||
bool isSerialOverUart(void) {
|
bool isSerialOverUart(void) {
|
||||||
return false;
|
return is_serial_over_uart;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) || defined(__DOXYGEN__)
|
#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__)
|
#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()) {
|
if (isSerialOverUart()) {
|
||||||
/*
|
/*
|
||||||
* Activates the serial using the driver default configuration (that's 38400)
|
* Activates the serial using the driver default configuration (that's 38400)
|
||||||
|
|
|
@ -17,6 +17,7 @@ typedef void (*CommandHandler)(char *);
|
||||||
#include "datalogging.h"
|
#include "datalogging.h"
|
||||||
|
|
||||||
// todo: make this pin configurable
|
// 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)
|
#define SHOULD_INGORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
|
||||||
|
|
||||||
SerialDriver * getConsoleChannel(void);
|
SerialDriver * getConsoleChannel(void);
|
||||||
|
|
Loading…
Reference in New Issue