From 902f87b6351a59ddbff2f54baebf55bd32931829 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 5 Jan 2017 05:01:46 -0500 Subject: [PATCH] auto-sync --- firmware/console/binary/tunerstudio.cpp | 4 ++-- firmware/console/binary/tunerstudio_io.cpp | 4 ++-- firmware/console/console_io.cpp | 20 ++++++++++---------- firmware/console/console_io.h | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 2095d5a0e5..157b38d744 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -118,7 +118,7 @@ ts_channel_s tsChannel; static int ts_serial_ready(bool isConsoleRedirect) { #if EFI_PROD_CODE || defined(__DOXYGEN__) - if (isSerialOverUart() ^ isConsoleRedirect) { + if (isCommandLineConsoleOverTTL() ^ isConsoleRedirect) { // TS uses USB when console uses serial return is_usb_serial_ready(); } else { @@ -154,7 +154,7 @@ static void printErrorCounters(void) { void printTsStats(void) { #if EFI_PROD_CODE || defined(__DOXYGEN__) - if (!isSerialOverUart()) { + if (!isCommandLineConsoleOverTTL()) { scheduleMsg(&tsLogger, "TS RX on %s", hwPortname(engineConfiguration->binarySerialRxPin)); scheduleMsg(&tsLogger, "TS TX on %s @%d", hwPortname(engineConfiguration->binarySerialTxPin), diff --git a/firmware/console/binary/tunerstudio_io.cpp b/firmware/console/binary/tunerstudio_io.cpp index 82f78ca32a..29b0aff381 100644 --- a/firmware/console/binary/tunerstudio_io.cpp +++ b/firmware/console/binary/tunerstudio_io.cpp @@ -30,7 +30,7 @@ static SerialConfig tsSerialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LI void startTsPort(void) { #if EFI_USB_SERIAL || defined(__DOXYGEN__) - if (isSerialOverUart()) { + if (isCommandLineConsoleOverTTL()) { print("TunerStudio over USB serial"); /** * This method contains a long delay, that's the reason why this is not done on the main thread @@ -56,7 +56,7 @@ void startTsPort(void) { BaseChannel * getTsSerialDevice(void) { #if EFI_PROD_CODE || defined(__DOXYGEN__) - if (isSerialOverUart()) { + if (isCommandLineConsoleOverTTL()) { // if console uses UART then TS uses USB return (BaseChannel *) &SDU1; } else { diff --git a/firmware/console/console_io.cpp b/firmware/console/console_io.cpp index 2d11ae5580..3cecc37ecf 100644 --- a/firmware/console/console_io.cpp +++ b/firmware/console/console_io.cpp @@ -72,7 +72,7 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size) short c = (short) chSequentialStreamGet(chp); onDataArrived(); - if (isSerialOverUart()) { + if (isCommandLineConsoleOverTTL()) { uint32_t flags; chSysLock() ; @@ -131,10 +131,10 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size) CommandHandler console_line_callback; -static bool isCommandLineConsoleOverTTL; +static bool b_isCommandLineConsoleOverTTL; -bool isSerialOverUart(void) { - return isCommandLineConsoleOverTTL; +bool isCommandLineConsoleOverTTL(void) { + return b_isCommandLineConsoleOverTTL; } #if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) || defined(__DOXYGEN__) @@ -178,7 +178,7 @@ void runConsoleLoop(ts_channel_s *console) { SerialDriver * getConsoleChannel(void) { #if defined(EFI_CONSOLE_UART_DEVICE) || defined(__DOXYGEN__) - if (isSerialOverUart()) { + if (isCommandLineConsoleOverTTL()) { return (SerialDriver *) EFI_CONSOLE_UART_DEVICE; } #endif /* EFI_CONSOLE_UART_DEVICE */ @@ -191,7 +191,7 @@ SerialDriver * getConsoleChannel(void) { } bool isCommandLineConsoleReady(void) { - if (isSerialOverUart()) { + if (isCommandLineConsoleOverTTL()) { return isSerialConsoleStarted; } else { return is_usb_serial_ready(); @@ -207,7 +207,7 @@ static THD_FUNCTION(consoleThreadThreadEntryPoint, arg) { chRegSetThreadName("console thread"); #if (EFI_PROD_CODE && EFI_USB_SERIAL) || defined(__DOXYGEN__) - if (!isSerialOverUart()) { + if (!isCommandLineConsoleOverTTL()) { /** * This method contains a long delay, that's the reason why this is not done on the main thread */ @@ -252,9 +252,9 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p) palSetPadMode(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN, PAL_MODE_INPUT_PULLUP); - isCommandLineConsoleOverTTL = GET_CONSOLE_MODE_VALUE() == EFI_USE_UART_FOR_CONSOLE; + b_isCommandLineConsoleOverTTL = GET_CONSOLE_MODE_VALUE() == EFI_USE_UART_FOR_CONSOLE; - if (isSerialOverUart()) { + if (isCommandLineConsoleOverTTL()) { /* * Activates the serial using the driver default configuration (that's 38400) * it is important to set 'NONE' as flow control! in terminal application on the PC @@ -270,7 +270,7 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p) chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1); } #else - isCommandLineConsoleOverTTL = false; + b_isCommandLineConsoleOverTTL = false; #endif /* EFI_PROD_CODE */ chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, (tfunc_t)consoleThreadThreadEntryPoint, NULL); diff --git a/firmware/console/console_io.h b/firmware/console/console_io.h index f01c341d68..87796c1df9 100644 --- a/firmware/console/console_io.h +++ b/firmware/console/console_io.h @@ -25,7 +25,7 @@ SerialDriver * getConsoleChannel(void); void consolePutChar(int x); void consoleOutputBuffer(const uint8_t *buf, int size); void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p); -bool isSerialOverUart(void); +bool isCommandLineConsoleOverTTL(void); void onDataArrived(void); #if EFI_PROD_CODE || EFI_SIMULATOR || EFI_EGT