diff --git a/firmware/config/boards/prometheus/efifeatures.h b/firmware/config/boards/prometheus/efifeatures.h index e427df622c..d0afdd6445 100644 --- a/firmware/config/boards/prometheus/efifeatures.h +++ b/firmware/config/boards/prometheus/efifeatures.h @@ -35,8 +35,8 @@ #define ADC_CHANNEL_VREF ADC_CHANNEL_IN14 +#undef EFI_CONSOLE_SERIAL_DEVICE #undef EFI_CONSOLE_UART_DEVICE -//#define EFI_CONSOLE_UART_DEVICE (&SD4) #undef EFI_UART_GPS #define EFI_UART_GPS FALSE @@ -94,8 +94,6 @@ #define LED_ERROR_PIN 13 #undef CONSOLE_MODE_SWITCH_PORT -#define CONSOLE_MODE_SWITCH_PORT GPIOE // ??? - #undef CONFIG_RESET_SWITCH_PORT //!!!!!!!!!!!!!!! diff --git a/firmware/config/boards/subaru-ej20gn/efifeatures.h b/firmware/config/boards/subaru-ej20gn/efifeatures.h index 595f536573..5794dbaf64 100644 --- a/firmware/config/boards/subaru-ej20gn/efifeatures.h +++ b/firmware/config/boards/subaru-ej20gn/efifeatures.h @@ -15,8 +15,8 @@ /* debug console */ #undef EFI_USE_UART_FOR_CONSOLE #define EFI_USE_UART_FOR_CONSOLE TRUE -#undef EFI_CONSOLE_UART_DEVICE -#define EFI_CONSOLE_UART_DEVICE (&SD1) +#undef EFI_CONSOLE_SERIAL_DEVICE +#define EFI_CONSOLE_SERIAL_DEVICE (&SD1) /* TunerStudio binary protocol */ /* do not use UART device for console */ @@ -61,7 +61,7 @@ #undef SERIAL_SPEED #define SERIAL_SPEED 115200 -#ifdef EFI_CONSOLE_UART_DEVICE +#ifdef EFI_CONSOLE_SERIAL_DEVICE #undef EFI_CONSOLE_TX_PORT #define EFI_CONSOLE_TX_PORT GPIOA #undef EFI_CONSOLE_TX_PIN diff --git a/firmware/config/stm32f0egt/efifeatures.h b/firmware/config/stm32f0egt/efifeatures.h index 050bb19c90..bac6a32f93 100644 --- a/firmware/config/stm32f0egt/efifeatures.h +++ b/firmware/config/stm32f0egt/efifeatures.h @@ -16,7 +16,7 @@ #define EFI_USE_UART_FOR_CONSOLE TRUE -#define EFI_CONSOLE_UART_DEVICE (&SD1) +#define EFI_CONSOLE_SERIAL_DEVICE (&SD1) #define TS_SERIAL_DEVICE (&SD3) diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index ecd4830f1a..8b4aa66b6d 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -324,8 +324,8 @@ // todo: start using consoleUartDevice? Not sure -#ifndef EFI_CONSOLE_UART_DEVICE -#define EFI_CONSOLE_UART_DEVICE (&SD3) +#ifndef EFI_CONSOLE_SERIAL_DEVICE +#define EFI_CONSOLE_SERIAL_DEVICE (&SD3) #endif /** @@ -343,7 +343,7 @@ // todo: add DMA-mode for Console? #if (TS_UART_DMA_MODE || TS_UART_MODE) -#undef EFI_CONSOLE_UART_DEVICE +#undef EFI_CONSOLE_SERIAL_DEVICE #endif // todo: start using consoleSerialTxPin? Not sure diff --git a/firmware/config/stm32f7ems/efifeatures.h b/firmware/config/stm32f7ems/efifeatures.h index da3c1656bc..b034664db3 100644 --- a/firmware/config/stm32f7ems/efifeatures.h +++ b/firmware/config/stm32f7ems/efifeatures.h @@ -80,8 +80,8 @@ #define EFI_UART_GPS FALSE // todo: start using consoleUartDevice? Not sure -#undef EFI_CONSOLE_UART_DEVICE -#define EFI_CONSOLE_UART_DEVICE (&SD3) +#undef EFI_CONSOLE_SERIAL_DEVICE +#define EFI_CONSOLE_SERIAL_DEVICE (&SD3) // todo: our "DMA-half" ChibiOS patch not implemented for USARTv2/STM32F7 #undef TS_UART_DMA_MODE @@ -94,7 +94,7 @@ // todo: add DMA-mode for Console? #if (TS_UART_DMA_MODE || TS_UART_MODE) -#undef EFI_CONSOLE_UART_DEVICE +#undef EFI_CONSOLE_SERIAL_DEVICE #endif // todo: start using consoleSerialTxPin? Not sure diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 9c2fbb8dde..0bd38ad441 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -110,8 +110,6 @@ persistent_config_s configWorkingCopy; #endif /* EFI_NO_CONFIG_WORKING_COPY */ -extern persistent_config_container_s persistentState; - static efitimems_t previousWriteReportMs = 0; static ts_channel_s tsChannel; @@ -199,7 +197,7 @@ char *getWorkingPageAddr(int pageIndex) { #if !defined(EFI_NO_CONFIG_WORKING_COPY) return (char*) &configWorkingCopy.engineConfiguration; #else - return (char*) &engineConfiguration; + return (char*) engineConfiguration; #endif /* EFI_NO_CONFIG_WORKING_COPY */ // case 1: // return (char*) &configWorkingCopy.ve2Table; diff --git a/firmware/console/console_io.cpp b/firmware/console/console_io.cpp index 278c09985b..4f19e27384 100644 --- a/firmware/console/console_io.cpp +++ b/firmware/console/console_io.cpp @@ -36,6 +36,9 @@ EXTERN_ENGINE; extern SerialUSBDriver SDU1; #endif /* HAL_USE_SERIAL_USB */ +// 10 seconds +#define CONSOLE_WRITE_TIMEOUT 10000 + int lastWriteSize; int lastWriteActual; @@ -74,7 +77,7 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size) short c = (short) streamGet(chp); onDataArrived(); -#if defined(EFI_CONSOLE_UART_DEVICE) +#if defined(EFI_CONSOLE_SERIAL_DEVICE) uint32_t flags; chSysLock() @@ -131,10 +134,70 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size) */ CommandHandler console_line_callback; -#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) +#if (defined(EFI_CONSOLE_SERIAL_DEVICE) && ! EFI_SIMULATOR ) static SerialConfig serialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 }; #endif +#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) +/* Note: This structure is modified from the default ChibiOS layout! */ +static UARTConfig uartConfig = { + .txend1_cb = NULL, .txend2_cb = NULL, .rxend_cb = NULL, .rxchar_cb = NULL, .rxerr_cb = NULL, + .speed = 0, .cr1 = 0, .cr2 = 0/*USART_CR2_STOP1_BITS*/ | USART_CR2_LINEN, .cr3 = 0, + .timeout_cb = NULL, .rxhalf_cb = NULL +}; + +// To use UART driver instead of Serial, we need to imitate "BaseChannel" streaming functionality +static msg_t _putt(void *, uint8_t b, sysinterval_t timeout) { + int n = 1; + uartSendTimeout(EFI_CONSOLE_UART_DEVICE, (size_t *)&n, &b, timeout); + return MSG_OK; +} +static size_t _writet(void *, const uint8_t *bp, size_t n, sysinterval_t timeout) { + uartSendTimeout(EFI_CONSOLE_UART_DEVICE, (size_t *)&n, bp, timeout); + return n; +} +static msg_t _put(void *ip, uint8_t b) { +#ifdef UART_USE_BLOCKING_SEND + // this version can be called from the locked state (no interrupts) + uart_lld_blocking_send(EFI_CONSOLE_UART_DEVICE, 1, (void *)&b); +#else + // uartSendTimeout() needs interrupts to wait for the end of transfer, so we have to unlock them temporary + bool wasLocked = isLocked(); + if (wasLocked) + unlockAnyContext(); + _putt(ip, b, CONSOLE_WRITE_TIMEOUT); + if (wasLocked) + lockAnyContext(); +#endif /* UART_USE_BLOCKING_WRITE */ + return MSG_OK; +} +static size_t _write(void *ip, const uint8_t *bp, size_t n) { + return _writet(ip, bp, n, CONSOLE_WRITE_TIMEOUT); +} +static msg_t _gett(void *, sysinterval_t /*timeout*/) { + return 0; +} +static size_t _readt(void *, uint8_t */*bp*/, size_t /*n*/, sysinterval_t /*timeout*/) { + return 0; +} +static msg_t _get(void *) { + return 0; +} +static size_t _read(void *, uint8_t */*bp*/, size_t /*n*/) { + return 0; +} +static msg_t _ctl(void *, unsigned int /*operation*/, void */*arg*/) { + return MSG_OK; +} + +// This is a "fake" channel for getConsoleChannel() filled with our handlers +static const struct BaseChannelVMT uartChannelVmt = { + .instance_offset = (size_t)0, .write = _write, .read = _read, .put = _put, .get = _get, + .putt = _putt, .gett = _gett, .writet = _writet, .readt = _readt, .ctl = _ctl +}; +static const BaseChannel uartChannel = { .vmt = &uartChannelVmt }; +#endif /* EFI_CONSOLE_UART_DEVICE */ + #if EFI_PROD_CODE || EFI_EGT bool isUsbSerial(BaseChannel * channel) { @@ -146,8 +209,12 @@ bool isUsbSerial(BaseChannel * channel) { } BaseChannel * getConsoleChannel(void) { +#if defined(EFI_CONSOLE_SERIAL_DEVICE) + return (BaseChannel *) EFI_CONSOLE_SERIAL_DEVICE; +#endif /* EFI_CONSOLE_SERIAL_DEVICE */ + #if defined(EFI_CONSOLE_UART_DEVICE) - return (BaseChannel *) EFI_CONSOLE_UART_DEVICE; + return (BaseChannel *) &uartChannel; #endif /* EFI_CONSOLE_UART_DEVICE */ #if HAL_USE_SERIAL_USB @@ -164,7 +231,7 @@ bool isCommandLineConsoleReady(void) { #if !defined(EFI_CONSOLE_NO_THREAD) -ts_channel_s binaryConsole; +static ts_channel_s binaryConsole; static THD_WORKING_AREA(consoleThreadStack, 3 * UTILITY_THREAD_STACK_SIZE); static THD_FUNCTION(consoleThreadEntryPoint, arg) { @@ -181,9 +248,6 @@ static THD_FUNCTION(consoleThreadEntryPoint, arg) { #endif /* EFI_CONSOLE_NO_THREAD */ -// 10 seconds -#define CONSOLE_WRITE_TIMEOUT 10000 - void consolePutChar(int x) { chnWriteTimeout(getConsoleChannel(), (const uint8_t *)&x, 1, CONSOLE_WRITE_TIMEOUT); } @@ -203,22 +267,31 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p) logger = sharedLogger; console_line_callback = console_line_callback_p; -#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR) +#if (defined(EFI_CONSOLE_SERIAL_DEVICE) && ! EFI_SIMULATOR) /* * Activates the serial * it is important to set 'NONE' as flow control! in terminal application on the PC */ serialConfig.speed = engineConfiguration->uartConsoleSerialSpeed; - sdStart(EFI_CONSOLE_UART_DEVICE, &serialConfig); + sdStart(EFI_CONSOLE_SERIAL_DEVICE, &serialConfig); -// cannot use pin repository here because pin repository prints to console + // cannot use pin repository here because pin repository prints to console palSetPadMode(EFI_CONSOLE_RX_PORT, EFI_CONSOLE_RX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); palSetPadMode(EFI_CONSOLE_TX_PORT, EFI_CONSOLE_TX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); isSerialConsoleStarted = true; - chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1); -#endif /* EFI_PROD_CODE */ + chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_SERIAL_DEVICE), &consoleEventListener, 1); +#elif (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR) + uartConfig.speed = engineConfiguration->uartConsoleSerialSpeed; + uartStart(EFI_CONSOLE_UART_DEVICE, &uartConfig); + + // cannot use pin repository here because pin repository prints to console + palSetPadMode(EFI_CONSOLE_RX_PORT, EFI_CONSOLE_RX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); + palSetPadMode(EFI_CONSOLE_TX_PORT, EFI_CONSOLE_TX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); + + isSerialConsoleStarted = true; +#endif /* EFI_CONSOLE_SERIAL_DEVICE || EFI_CONSOLE_UART_DEVICE */ #if !defined(EFI_CONSOLE_NO_THREAD) chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, (tfunc_t)consoleThreadEntryPoint, NULL); diff --git a/firmware/egt2can.cpp b/firmware/egt2can.cpp index 1c7476a948..6ed4c3e20c 100644 --- a/firmware/egt2can.cpp +++ b/firmware/egt2can.cpp @@ -31,7 +31,7 @@ static msg_t Thread1(void *arg) { void runRusEfi(void) { -#if defined(EFI_CONSOLE_UART_DEVICE) +#if defined(EFI_CONSOLE_SERIAL_DEVICE) /* * Activates the serial driver 1 using the driver default configuration. * PA9 and PA10 are routed to USART1. diff --git a/firmware/hw_layer/drivers/gpio/tle6240.c b/firmware/hw_layer/drivers/gpio/tle6240.c index 43de1f4e1f..e7e9b7b76e 100644 --- a/firmware/hw_layer/drivers/gpio/tle6240.c +++ b/firmware/hw_layer/drivers/gpio/tle6240.c @@ -204,7 +204,8 @@ static int tle6240_chip_init(struct tle6240_priv *chip) const struct tle6240_config *cfg = chip->cfg; /* mark pins used */ - ret = gpio_pin_markUsed(cfg->spi_config.ssport, cfg->spi_config.sspad, DRIVER_NAME " CS"); + //ret = gpio_pin_markUsed(cfg->spi_config.ssport, cfg->spi_config.sspad, DRIVER_NAME " CS"); + ret = 0; if (cfg->reset.port != NULL) ret |= gpio_pin_markUsed(cfg->reset.port, cfg->reset.pad, DRIVER_NAME " RST"); for (n = 0; n < TLE6240_DIRECT_OUTPUTS; n++) @@ -293,7 +294,7 @@ static int tle6240_chip_init(struct tle6240_priv *chip) err_gpios: /* unmark pins */ - gpio_pin_markUnused(cfg->spi_config.ssport, cfg->spi_config.sspad); + //gpio_pin_markUnused(cfg->spi_config.ssport, cfg->spi_config.sspad); if (cfg->reset.port != NULL) gpio_pin_markUnused(cfg->reset.port, cfg->reset.pad); for (n = 0; n < TLE6240_DIRECT_OUTPUTS; n++) @@ -478,9 +479,9 @@ int tle6240_add(unsigned int index, const struct tle6240_config *cfg) return -1; /* check for valid cs. - * DOTO: remove this check? CS can be driven by SPI */ - if (cfg->spi_config.ssport == NULL) - return -1; + * TODO: remove this check? CS can be driven by SPI */ + //if (cfg->spi_config.ssport == NULL) + // return -1; chip = &chips[index]; diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 11c5d68cc6..6cbbd56c58 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -319,10 +319,6 @@ void applyNewHardwareSettings(void) { enginePins.unregisterPins(); -#if (BOARD_TLE6240_COUNT > 0) - startSmartCsPins(); -#endif /* (BOARD_MC33972_COUNT > 0) */ - #if EFI_SHAFT_POSITION_INPUT startTriggerInputPins(); #endif /* EFI_SHAFT_POSITION_INPUT */ diff --git a/firmware/hw_layer/hw_layer.mk b/firmware/hw_layer/hw_layer.mk index faf32968dd..389569b6cd 100644 --- a/firmware/hw_layer/hw_layer.mk +++ b/firmware/hw_layer/hw_layer.mk @@ -7,9 +7,7 @@ HW_LAYER_EGT_CPP = $(PROJECT_DIR)/hw_layer/can_hw.cpp \ HW_LAYER_EMS = $(HW_LAYER_EGT) \ $(PROJECT_DIR)/hw_layer/mcp3208.c \ $(PROJECT_DIR)/hw_layer/mc33816_data.c \ - $(PROJECT_DIR)/hw_layer/flash.c \ - HW_LAYER_EMS_CPP = $(HW_LAYER_EGT_CPP) \ $(PROJECT_DIR)/hw_layer/pin_repository.cpp \ $(PROJECT_DIR)/hw_layer/microsecond_timer.cpp \ @@ -36,18 +34,5 @@ HW_LAYER_EMS_CPP = $(HW_LAYER_EGT_CPP) \ $(PROJECT_DIR)/hw_layer/backup_ram.cpp \ -ifeq ($(PROJECT_CPU),ARCH_STM32F7) -HW_LAYER_EMS += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/stm32f7xx_hal_flash.c \ - $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/stm32f7xx_hal_flash_ex.c -endif - -ifeq ($(PROJECT_CPU),ARCH_STM32F4) -HW_LAYER_EMS += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/stm32f4xx_hal_flash.c \ - $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/stm32f4xx_hal_flash_ex.c -endif - -ifeq ($(PROJECT_CPU),ARCH_STM32F1) -endif - -include $(PROJECT_DIR)/hw_layer/$(CPU_HWLAYER)/hw_ports.mk \ No newline at end of file diff --git a/firmware/hw_layer/flash.c b/firmware/hw_layer/ports/stm32/flash.c similarity index 100% rename from firmware/hw_layer/flash.c rename to firmware/hw_layer/ports/stm32/flash.c diff --git a/firmware/hw_layer/ports/stm32/stm32f1/hw_ports.mk b/firmware/hw_layer/ports/stm32/stm32f1/hw_ports.mk index 8af34c257e..0e18e72619 100644 --- a/firmware/hw_layer/ports/stm32/stm32f1/hw_ports.mk +++ b/firmware/hw_layer/ports/stm32/stm32f1/hw_ports.mk @@ -1,3 +1,4 @@ +HW_LAYER_EMS += $(PROJECT_DIR)/hw_layer/ports/stm32/flash.c HW_LAYER_EMS_CPP += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f1/mpu_util.cpp \ $(PROJECT_DIR)/hw_layer/ports/stm32/stm32_common.cpp diff --git a/firmware/hw_layer/ports/stm32/stm32f4/hw_ports.mk b/firmware/hw_layer/ports/stm32/stm32f4/hw_ports.mk index ec2bc46d7e..218704b7c4 100644 --- a/firmware/hw_layer/ports/stm32/stm32f4/hw_ports.mk +++ b/firmware/hw_layer/ports/stm32/stm32f4/hw_ports.mk @@ -1,3 +1,6 @@ +HW_LAYER_EMS += $(PROJECT_DIR)/hw_layer/ports/stm32/flash.c \ + $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/stm32f4xx_hal_flash.c \ + $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/stm32f4xx_hal_flash_ex.c HW_LAYER_EMS_CPP += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/mpu_util.cpp \ $(PROJECT_DIR)/hw_layer/ports/stm32/stm32_common.cpp diff --git a/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk b/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk index c3d982ebbf..84ff98f145 100644 --- a/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk +++ b/firmware/hw_layer/ports/stm32/stm32f7/hw_ports.mk @@ -1,3 +1,6 @@ +HW_LAYER_EMS += $(PROJECT_DIR)/hw_layer/ports/stm32/flash.c \ + $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/stm32f7xx_hal_flash.c \ + $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/stm32f7xx_hal_flash_ex.c HW_LAYER_EMS_CPP += $(PROJECT_DIR)/hw_layer/ports/stm32/stm32f7/mpu_util.cpp \ $(PROJECT_DIR)/hw_layer/ports/stm32/stm32_common.cpp diff --git a/firmware/hw_layer/smart_gpio.cpp b/firmware/hw_layer/smart_gpio.cpp index d9362c2c09..763956b601 100644 --- a/firmware/hw_layer/smart_gpio.cpp +++ b/firmware/hw_layer/smart_gpio.cpp @@ -178,7 +178,7 @@ void initSmartGpio() { ret = -1; } if (ret < 0) -#endif /* (BOARD_TLE6240_COUNT > 0) */ +#endif /* (BOARD_TLE8888_COUNT > 0) */ /* whenever chip is disabled or error returned - occupy its gpio range */ gpiochip_use_gpio_base(TLE8888_OUTPUTS); @@ -190,18 +190,30 @@ void initSmartGpio() { #if (BOARD_EXT_GPIOCHIPS > 0) void stopSmartCsPins() { +#if (BOARD_TLE8888_COUNT > 0) brain_pin_markUnused(activeConfiguration.tle8888_cs); +#endif /* BOARD_TLE8888_COUNT */ +#if (BOARD_TLE6240_COUNT > 0) brain_pin_markUnused(activeConfiguration.tle6240_cs); +#endif /* BOARD_TLE6240_COUNT */ +#if (BOARD_MC33972_COUNT > 0) brain_pin_markUnused(activeConfiguration.bc.mc33972_cs); +#endif /* BOARD_MC33972_COUNT */ } void startSmartCsPins() { +#if (BOARD_TLE8888_COUNT > 0) tle8888Cs.initPin("tle8888 CS", engineConfiguration->tle8888_cs, &engineConfiguration->tle8888_csPinMode); - tle6240Cs.initPin("tle8888 CS", engineConfiguration->tle6240_cs, +#endif /* BOARD_TLE8888_COUNT */ +#if (BOARD_TLE6240_COUNT > 0) + tle6240Cs.initPin("tle6240 CS", engineConfiguration->tle6240_cs, &engineConfiguration->tle6240_csPinMode); +#endif /* BOARD_TLE6240_COUNT */ +#if (BOARD_MC33972_COUNT > 0) mc33972Cs.initPin("mc33972 CS", boardConfiguration->mc33972_cs, &boardConfiguration->mc33972_csPinMode); +#endif /* BOARD_MC33972_COUNT */ } #endif /* (BOARD_EXT_GPIOCHIPS > 0) */ diff --git a/firmware/util/loggingcentral.cpp b/firmware/util/loggingcentral.cpp index 06057f068a..c7cdbfa1aa 100644 --- a/firmware/util/loggingcentral.cpp +++ b/firmware/util/loggingcentral.cpp @@ -46,6 +46,10 @@ static char * outputBuffer; */ void scheduleLogging(Logging *logging) { #if EFI_TEXT_LOGGING +#ifdef EFI_PRINT_MESSAGES_TO_TERMINAL + print(logging->buffer); + print("\r\n"); +#endif /* EFI_PRINT_MESSAGES_TO_TERMINAL */ // this could be done without locking int newLength = efiStrlen(logging->buffer); diff --git a/simulator/simulator/boards.h b/simulator/simulator/boards.h index 2b5c9366e1..1f39606f55 100644 --- a/simulator/simulator/boards.h +++ b/simulator/simulator/boards.h @@ -19,7 +19,7 @@ /** * This implementation writes to both windows console and console port */ -#define EFI_CONSOLE_UART_DEVICE (&serialAdapterInstance) +#define EFI_CONSOLE_SERIAL_DEVICE (&serialAdapterInstance) int getAdcValue(const char *msg, int channel); #define getSlowAdcCounter() 0 diff --git a/simulator/simulator/rusEfiFunctionalTest.cpp b/simulator/simulator/rusEfiFunctionalTest.cpp index 57f8a97119..d18c2e0200 100644 --- a/simulator/simulator/rusEfiFunctionalTest.cpp +++ b/simulator/simulator/rusEfiFunctionalTest.cpp @@ -168,5 +168,5 @@ void logMsg(const char *format, ...) { } BaseChannel * getConsoleChannel(void) { - return (BaseChannel *)EFI_CONSOLE_UART_DEVICE; + return (BaseChannel *)EFI_CONSOLE_SERIAL_DEVICE; }