The Big Refactoring of 2019: console vs TS vs CONSOLE_MODE_SWITCH_PIN vs text protocol #725

This commit is contained in:
rusefi 2019-04-01 11:16:19 -04:00
parent 5d26b6fdae
commit 1db1b7a277
6 changed files with 2 additions and 27 deletions

View File

@ -16,8 +16,6 @@
#define hal_lld_get_counter_value() DWT_CYCCNT #define hal_lld_get_counter_value() DWT_CYCCNT
#define EFI_USE_UART_FOR_CONSOLE FALSE
#define EFI_CONSOLE_TX_PORT GPIOC #define EFI_CONSOLE_TX_PORT GPIOC
#define EFI_CONSOLE_TX_PIN 10 #define EFI_CONSOLE_TX_PIN 10
#define EFI_CONSOLE_RX_PORT GPIOC #define EFI_CONSOLE_RX_PORT GPIOC
@ -44,9 +42,6 @@
#define EFI_UNIT_TEST FALSE #define EFI_UNIT_TEST FALSE
#define CONSOLE_MODE_SWITCH_PORT GPIOB
#define CONSOLE_MODE_SWITCH_PIN 1
#define EFI_MAX_31855 TRUE #define EFI_MAX_31855 TRUE
#define CONSOLE_MAX_ACTIONS 32 #define CONSOLE_MAX_ACTIONS 32

View File

@ -49,8 +49,6 @@
//#define EFI_UART_ECHO_TEST_MODE TRUE //#define EFI_UART_ECHO_TEST_MODE TRUE
#define EFI_USE_UART_FOR_CONSOLE FALSE
/** /**
* Build-in logic analyzer support. Logic analyzer viewer is one of the java console panes. * Build-in logic analyzer support. Logic analyzer viewer is one of the java console panes.
*/ */
@ -364,9 +362,6 @@
#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

View File

@ -21,10 +21,6 @@
#undef EFI_USE_CCM #undef EFI_USE_CCM
#define EFI_USE_CCM FALSE #define EFI_USE_CCM FALSE
// todo: no actual selection pin configured for Nucleo
#undef EFI_USE_UART_FOR_CONSOLE
#define EFI_USE_UART_FOR_CONSOLE FALSE
#undef EFI_POTENTIOMETER #undef EFI_POTENTIOMETER
#define EFI_POTENTIOMETER FALSE #define EFI_POTENTIOMETER FALSE

View File

@ -132,11 +132,7 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size)
CommandHandler console_line_callback; CommandHandler console_line_callback;
/** static const bool b_isCommandLineConsoleOverTTL = true;
* todo: what does this variable currently mean? is it still needed?
* looks like things are a bit confusing here
*/
static bool b_isCommandLineConsoleOverTTL;
bool isCommandLineConsoleOverTTL(void) { bool isCommandLineConsoleOverTTL(void) {
return b_isCommandLineConsoleOverTTL; return b_isCommandLineConsoleOverTTL;
@ -270,10 +266,6 @@ 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);
b_isCommandLineConsoleOverTTL = GET_CONSOLE_MODE_VALUE() == EFI_USE_UART_FOR_CONSOLE;
if (isCommandLineConsoleOverTTL()) { if (isCommandLineConsoleOverTTL()) {
/* /*
* Activates the serial * Activates the serial
@ -290,8 +282,6 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p)
chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1); chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1);
} }
#else
b_isCommandLineConsoleOverTTL = false;
#endif /* EFI_PROD_CODE */ #endif /* EFI_PROD_CODE */
#if !defined(EFI_CONSOLE_NO_THREAD) || defined(__DOXYGEN__) #if !defined(EFI_CONSOLE_NO_THREAD) || defined(__DOXYGEN__)

View File

@ -25,7 +25,6 @@ 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)
BaseChannel * getConsoleChannel(void); BaseChannel * getConsoleChannel(void);

View File

@ -779,5 +779,5 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0) if (initBootloader() != 0)
return 123; return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */ #endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20190324; return 20190401;
} }