diff --git a/firmware/bootloader/src/dfu.cpp b/firmware/bootloader/src/dfu.cpp index 699baa7d7d..c370737700 100644 --- a/firmware/bootloader/src/dfu.cpp +++ b/firmware/bootloader/src/dfu.cpp @@ -7,7 +7,7 @@ #include "dfu.h" // Communication vars -static UartTsChannel blTsChannel(TS_PRIMARY_UART); +static UartTsChannel blTsChannel(TS_PRIMARY_PORT); static uint8_t buffer[DFU_BUFFER_SIZE]; // Use short timeout for the first data packet, and normal timeout for the rest static int sr5Timeout = DFU_SR5_TIMEOUT_FIRST; diff --git a/firmware/config/boards/atlas/board.mk b/firmware/config/boards/atlas/board.mk index 2b8b9bed99..b9b5c99e69 100644 --- a/firmware/config/boards/atlas/board.mk +++ b/firmware/config/boards/atlas/board.mk @@ -11,7 +11,7 @@ DDEFS += -DFIRMWARE_ID=\"atlas\" -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS # DEFS += -DEFI_SOFTWARE_KNOCK=TRUE # disable hardware serial ports on H7 -# DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +# DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # We are running on Atlas hardware! DDEFS += -DHW_ATLAS=1 diff --git a/firmware/config/boards/hellen/cypress/efifeatures.h b/firmware/config/boards/hellen/cypress/efifeatures.h index d0f29d15d4..0d9a44e095 100644 --- a/firmware/config/boards/hellen/cypress/efifeatures.h +++ b/firmware/config/boards/hellen/cypress/efifeatures.h @@ -279,16 +279,13 @@ */ #define EFI_USE_UART_DMA FALSE -#undef TS_SECONDARY_UART -#undef TS_SECONDARY_SERIAL - // todo: add CAN support //#define TS_CAN_DEVICE CAND1 #define TS_CAN_AF PAL_MODE_ALTERNATIVE_CAN #define TS_CAN_DEVICE_SHORT_PACKETS_IN_ONE_FRAME -#undef TS_PRIMARY_SERIAL -#undef TS_PRIMARY_UART +#undef TS_PRIMARY_PORT +#undef TS_SECONDARY_PORT #define EFI_USB_SERIAL TRUE #define EFI_CONSOLE_USB_DEVICE SDU1 diff --git a/firmware/config/boards/hellen/hellen-nb1/board.mk b/firmware/config/boards/hellen/hellen-nb1/board.mk index 51dca32527..aadf4c0353 100644 --- a/firmware/config/boards/hellen/hellen-nb1/board.mk +++ b/firmware/config/boards/hellen/hellen-nb1/board.mk @@ -31,7 +31,7 @@ DDEFS += -DEFI_ICU_INPUTS=FALSE -DHAL_TRIGGER_USE_PAL=TRUE DDEFS += -DEFI_LOGIC_ANALYZER=FALSE # Enable serial pins on expansion header -DDEFS += -DEFI_CONSOLE_TX_BRAIN_PIN=GPIOD_6 -DEFI_CONSOLE_RX_BRAIN_PIN=GPIOD_5 -DTS_PRIMARY_UART=UARTD2 -DSTM32_UART_USE_USART2=1 +DDEFS += -DEFI_CONSOLE_TX_BRAIN_PIN=GPIOD_6 -DEFI_CONSOLE_RX_BRAIN_PIN=GPIOD_5 -DTS_PRIMARY_PORT=UARTD2 -DSTM32_UART_USE_USART2=1 # We are running on Hellen-One hardware! DDEFS += -DHW_HELLEN=1 diff --git a/firmware/config/boards/hellen/hellen121nissan/board.mk b/firmware/config/boards/hellen/hellen121nissan/board.mk index 1b5b1fd28a..c893e0f8fd 100644 --- a/firmware/config/boards/hellen/hellen121nissan/board.mk +++ b/firmware/config/boards/hellen/hellen121nissan/board.mk @@ -22,7 +22,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellen121nissan\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/hellen/hellen121vag/board.mk b/firmware/config/boards/hellen/hellen121vag/board.mk index 117d139492..8f5a7d93f8 100644 --- a/firmware/config/boards/hellen/hellen121vag/board.mk +++ b/firmware/config/boards/hellen/hellen121vag/board.mk @@ -22,7 +22,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellen121vag\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/hellen/hellen128/board.mk b/firmware/config/boards/hellen/hellen128/board.mk index 69b1aa08b4..a7e7c7d0ff 100644 --- a/firmware/config/boards/hellen/hellen128/board.mk +++ b/firmware/config/boards/hellen/hellen128/board.mk @@ -22,7 +22,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellen128\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/hellen/hellen154hyundai/board.mk b/firmware/config/boards/hellen/hellen154hyundai/board.mk index 5a75961b33..e86e3b37bf 100644 --- a/firmware/config/boards/hellen/hellen154hyundai/board.mk +++ b/firmware/config/boards/hellen/hellen154hyundai/board.mk @@ -22,7 +22,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellen154hyundai\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/hellen/hellen64_miataNA6_94/board.mk b/firmware/config/boards/hellen/hellen64_miataNA6_94/board.mk index 706e910306..40a6753be2 100644 --- a/firmware/config/boards/hellen/hellen64_miataNA6_94/board.mk +++ b/firmware/config/boards/hellen/hellen64_miataNA6_94/board.mk @@ -22,7 +22,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellenNA6\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/hellen/hellen72/board.mk b/firmware/config/boards/hellen/hellen72/board.mk index 338cd6ca7e..ee90b35cec 100644 --- a/firmware/config/boards/hellen/hellen72/board.mk +++ b/firmware/config/boards/hellen/hellen72/board.mk @@ -22,7 +22,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellen72\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/hellen/hellen81/board.mk b/firmware/config/boards/hellen/hellen81/board.mk index a0b97e90d4..138cd4d37e 100644 --- a/firmware/config/boards/hellen/hellen81/board.mk +++ b/firmware/config/boards/hellen/hellen81/board.mk @@ -25,7 +25,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellen81\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/hellen/hellen88bmw/board.mk b/firmware/config/boards/hellen/hellen88bmw/board.mk index 7ec4e966ad..5bf4af5a19 100644 --- a/firmware/config/boards/hellen/hellen88bmw/board.mk +++ b/firmware/config/boards/hellen/hellen88bmw/board.mk @@ -22,7 +22,7 @@ DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=INVERTED_OUTPUT DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT # Disable serial ports on this board as UART3 causes a DMA conflict with the SD card -DDEFS += -DTS_NO_PRIMARY -DTS_NO_SECONDARY +DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1 # Add them all together DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"hellen88bmw\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(LED_COMMUNICATION_BRAIN_PIN) diff --git a/firmware/config/boards/kinetis/efifeatures.h b/firmware/config/boards/kinetis/efifeatures.h index b42a77be88..5a9d50ade4 100644 --- a/firmware/config/boards/kinetis/efifeatures.h +++ b/firmware/config/boards/kinetis/efifeatures.h @@ -268,8 +268,8 @@ */ #define EFI_USE_UART_DMA FALSE -#define TS_PRIMARY_UART UARTD2 -#undef TS_SECONDARY_UART +#define TS_PRIMARY_PORT UARTD2 +#undef TS_SECONDARY_PORT #define EFI_CONSOLE_TX_BRAIN_PIN GPIOA_10 #define EFI_CONSOLE_RX_BRAIN_PIN GPIOA_11 @@ -360,7 +360,7 @@ if (__debugEnabled) { \ extern char __debugBuffer[80]; \ chsnprintf(__debugBuffer, sizeof(__debugBuffer), fmt, ##__VA_ARGS__); \ - uart_lld_blocking_send(TS_PRIMARY_UART, strlen(__debugBuffer), (void *)__debugBuffer); \ + uart_lld_blocking_send(TS_PRIMARY_PORT, strlen(__debugBuffer), (void *)__debugBuffer); \ } \ } diff --git a/firmware/config/boards/nucleo_h743/board.mk b/firmware/config/boards/nucleo_h743/board.mk index 5d58154637..d5b9e029ca 100644 --- a/firmware/config/boards/nucleo_h743/board.mk +++ b/firmware/config/boards/nucleo_h743/board.mk @@ -1,5 +1,11 @@ # List of all the board related files. +DDEFS = -DTS_NO_PRIMARY=0 \ + -DTS_PRIMARY_PORT=SD3 \ + -DEFI_CONSOLE_TX_BRAIN_PIN=GPIOD_8 \ + -DEFI_CONSOLE_RX_BRAIN_PIN=GPIOD_9 \ + + # Shared variables ALLCPPSRC += $(PROJECT_DIR)/config/boards/nucleo_h743/board_configuration.cpp diff --git a/firmware/config/boards/prometheus/efifeatures.h b/firmware/config/boards/prometheus/efifeatures.h index 6ea65d39ee..022ed5ce6d 100644 --- a/firmware/config/boards/prometheus/efifeatures.h +++ b/firmware/config/boards/prometheus/efifeatures.h @@ -34,15 +34,13 @@ #define ADC_CHANNEL_VREF ADC_CHANNEL_IN14 -#undef TS_PRIMARY_SERIAL -#undef TS_PRIMARY_UART -#define TS_PRIMARY_UART UARTD4 +#undef TS_PRIMARY_PORT +#define TS_PRIMARY_PORT UARTD4 #undef EFI_UART_GPS #define EFI_UART_GPS FALSE -#undef TS_SECONDARY_UART -#undef TS_SECONDARY_SERIAL +#undef TS_SECONDARY_PORT #undef EFI_BLUETOOTH_SETUP #define EFI_BLUETOOTH_SETUP TRUE diff --git a/firmware/config/boards/proteus/board.mk b/firmware/config/boards/proteus/board.mk index fb9366ebef..27f8497f2a 100644 --- a/firmware/config/boards/proteus/board.mk +++ b/firmware/config/boards/proteus/board.mk @@ -32,7 +32,7 @@ endif ifeq ($(PROJECT_CPU),ARCH_STM32F4) # Hardware serial port on UART 2 -> PD5/PD6 DDEFS += -DSTM32_UART_USE_USART2=TRUE - DDEFS += -DTS_PRIMARY_UART=UARTD2 + DDEFS += -DTS_PRIMARY_PORT=UARTD2 DDEFS += -DEFI_CONSOLE_TX_BRAIN_PIN=GPIOD_5 -DEFI_CONSOLE_RX_BRAIN_PIN=GPIOD_6 endif diff --git a/firmware/config/boards/subaru_eg33/efifeatures.h b/firmware/config/boards/subaru_eg33/efifeatures.h index c07b05dfd6..e2e451163f 100644 --- a/firmware/config/boards/subaru_eg33/efifeatures.h +++ b/firmware/config/boards/subaru_eg33/efifeatures.h @@ -21,13 +21,11 @@ #define LED_RUNING_BRAIN_PIN_MODE INVERTED_OUTPUT /* debug console */ -#undef TS_PRIMARY_SERIAL -#undef TS_PRIMARY_UART -#define TS_PRIMARY_SERIAL SD1 +#undef TS_PRIMARY_PORT +#define TS_PRIMARY_PORT SD1 // no secondary channel -#undef TS_SECONDARY_UART -#undef TS_SECONDARY_SERIAL +#undef TS_SECONDARY_PORT /* Knock detection */ #undef EFI_HIP_9011 @@ -94,7 +92,7 @@ #undef SERIAL_SPEED #define SERIAL_SPEED 115200 -#ifdef TS_PRIMARY_SERIAL +#ifdef TS_PRIMARY_PORT #undef EFI_CONSOLE_TX_PORT #define EFI_CONSOLE_TX_PORT GPIOA #undef EFI_CONSOLE_TX_PIN diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index 688f9990b0..b9167c5e31 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -360,11 +360,11 @@ #define EFI_USE_UART_DMA TRUE #endif -#ifndef TS_PRIMARY_UART -#define TS_PRIMARY_UART UARTD3 +#ifndef TS_PRIMARY_PORT +#define TS_PRIMARY_PORT UARTD3 #endif -#undef TS_SECONDARY_UART +#undef TS_SECONDARY_PORT #define AUX_SERIAL_DEVICE (&SD6) diff --git a/firmware/config/stm32f7ems/efifeatures.h b/firmware/config/stm32f7ems/efifeatures.h index d3047d628f..b0351b69ef 100644 --- a/firmware/config/stm32f7ems/efifeatures.h +++ b/firmware/config/stm32f7ems/efifeatures.h @@ -37,8 +37,10 @@ #define EFI_USE_UART_DMA FALSE // UART driver not implemented on F7 -#define TS_NO_PRIMARY -#define TS_NO_SECONDARY +#ifndef TS_NO_PRIMARY +#define TS_NO_PRIMARY 1 +#endif +#define TS_NO_SECONDARY 1 #define AUX_SERIAL_DEVICE (&SD6) diff --git a/firmware/console/binary/tunerstudio_io.h b/firmware/console/binary/tunerstudio_io.h index 6d10847242..f09a120df3 100644 --- a/firmware/console/binary/tunerstudio_io.h +++ b/firmware/console/binary/tunerstudio_io.h @@ -9,13 +9,13 @@ #pragma once #include "global.h" -#if (!defined(TS_NO_PRIMARY) && (defined(TS_PRIMARY_UART) || defined(TS_PRIMARY_SERIAL))) +#if (!TS_NO_PRIMARY && defined(TS_PRIMARY_PORT)) #define HAS_PRIMARY true #else #define HAS_PRIMARY false #endif -#if (!defined(TS_NO_SECONDARY) && (defined(TS_SECONDARY_UART) || defined(TS_SECONDARY_SERIAL))) +#if (!TS_NO_SECONDARY && defined(TS_SECONDARY_PORT)) #define HAS_SECONDARY true #else #define HAS_SECONDARY false diff --git a/firmware/console/binary/tunerstudio_io_serial_ports.cpp b/firmware/console/binary/tunerstudio_io_serial_ports.cpp index 1993e5d7d3..4297933c0e 100644 --- a/firmware/console/binary/tunerstudio_io_serial_ports.cpp +++ b/firmware/console/binary/tunerstudio_io_serial_ports.cpp @@ -11,16 +11,29 @@ #include "tunerstudio_io.h" #include "connector_uart_dma.h" +// These may not be defined due to the HAL, but they're necessary for the compiler to do it's magic +class UARTDriver; +class UartDmaTsChannel; +class UartTsChannel; +class SerialTsChannel; + #if HAS_PRIMARY - #ifdef TS_PRIMARY_UART - #if EFI_USE_UART_DMA - UartDmaTsChannel primaryChannel(TS_PRIMARY_UART); - #else - UartTsChannel primaryChannel(TS_PRIMARY_UART); - #endif - #elif defined(TS_PRIMARY_SERIAL) - SerialTsChannel primaryChannel(TS_PRIMARY_SERIAL); - #endif +#ifdef TS_PRIMARY_PORT + +// We want to instantiate the correct channel type depending on what type of serial port we're +// using. ChibiOS supports two - UART and Serial. We compare the type of the port we're given +// against UartDriver and decide whether to instantiate a UART TS Channel or a Serial version. The +// UART is further subdivided into two depending whether we support DMA or not. We use the right +// combination of std::conditional, std::is_same, and #if to get what we want. + std::conditional_t< + std::is_same_v, +#if EFI_USE_UART_DMA + UartDmaTsChannel, +#else // EFI_USE_UART_DMA + UartTsChannel, +#endif // EFI_USE_UART_DMA + SerialTsChannel> primaryChannel(TS_PRIMARY_PORT); +#endif // TS_PRIMARY_PORT struct PrimaryChannelThread : public TunerstudioThread { PrimaryChannelThread() : TunerstudioThread("Primary TS Channel") { } @@ -41,15 +54,17 @@ #endif // HAS_PRIMARY #if HAS_SECONDARY - #ifdef TS_SECONDARY_UART - #if EFI_USE_UART_DMA - UartDmaTsChannel secondaryChannel(TS_SECONDARY_UART); - #else - UartTsChannel secondaryChannel(TS_SECONDARY_UART); - #endif - #elif defined(TS_SECONDARY_SERIAL) - SerialTsChannel secondaryChannel(TS_SECONDARY_SERIAL); - #endif +#ifdef TS_SECONDARY_PORT + std::conditional_t< + std::is_same_v, +#if EFI_USE_UART_DMA + UartDmaTsChannel, +#else // EFI_USE_UART_DMA + UartTsChannel, +#endif // EFI_USE_UART_DMA + SerialTsChannel> secondaryChannel(TS_SECONDARY_PORT); +#endif // TS_SECONDARY_PORT + struct SecondaryChannelThread : public TunerstudioThread { SecondaryChannelThread() : TunerstudioThread("Secondary TS Channel") { } diff --git a/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h b/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h index 00ea811bb3..2bbe0bde56 100644 --- a/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h +++ b/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h @@ -114,7 +114,7 @@ */ #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) /* Configured in efifeatures.h */ -#if defined(TS_PRIMARY_UART) || defined(TS_PRIMARY_SERIAL) +#if defined(TS_PRIMARY_PORT) #define HAL_USE_UART TRUE #else #define HAL_USE_UART FALSE diff --git a/firmware/hw_layer/ports/stm32/stm32f7/cfg/halconf.h b/firmware/hw_layer/ports/stm32/stm32f7/cfg/halconf.h index 2057316cf1..12f37740c5 100644 --- a/firmware/hw_layer/ports/stm32/stm32f7/cfg/halconf.h +++ b/firmware/hw_layer/ports/stm32/stm32f7/cfg/halconf.h @@ -121,7 +121,7 @@ */ #if !defined(HAL_USE_UART) || defined(__DOXYGEN__) /* Configured in efifeatures.h */ -#if defined(TS_PRIMARY_UART) || defined(TS_PRIMARY_SERIAL) +#if defined(TS_PRIMARY_PORT) #define HAL_USE_UART TRUE #else #define HAL_USE_UART FALSE @@ -200,7 +200,7 @@ */ #if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) /* Configured in efifeatures.h */ -#if defined(TS_PRIMARY_UART) || defined(TS_PRIMARY_SERIAL) +#if defined(TS_PRIMARY_PORT) #define UART_USE_WAIT TRUE #else #define UART_USE_WAIT FALSE diff --git a/firmware/hw_layer/ports/stm32/stm32h7/cfg/mcuconf.h b/firmware/hw_layer/ports/stm32/stm32h7/cfg/mcuconf.h index e0243d6d71..67b9aa0c16 100644 --- a/firmware/hw_layer/ports/stm32/stm32h7/cfg/mcuconf.h +++ b/firmware/hw_layer/ports/stm32/stm32h7/cfg/mcuconf.h @@ -385,7 +385,7 @@ */ #define STM32_SERIAL_USE_USART1 TRUE #define STM32_SERIAL_USE_USART2 TRUE -#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_USART3 TRUE #define STM32_SERIAL_USE_UART4 FALSE #define STM32_SERIAL_USE_UART5 FALSE #define STM32_SERIAL_USE_USART6 TRUE