From b699bb48d4f869ee5581805a531c880d803d8403 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 23 Jan 2023 04:55:24 -0500 Subject: [PATCH] Refactoring: less confusion macro names around serial/uart/etc in connectivity #4999 --- firmware/console/binary/tunerstudio_io.h | 4 ++-- firmware/console/binary/tunerstudio_io_serial.cpp | 4 ++-- firmware/console/binary/tunerstudio_io_serial_ports.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/firmware/console/binary/tunerstudio_io.h b/firmware/console/binary/tunerstudio_io.h index c6f793b164..9e8806dc7b 100644 --- a/firmware/console/binary/tunerstudio_io.h +++ b/firmware/console/binary/tunerstudio_io.h @@ -11,9 +11,9 @@ #include "tunerstudio_impl.h" #if (!TS_NO_PRIMARY && defined(TS_PRIMARY_PORT)) - #define HAS_PRIMARY true + #define HAS_UxART_PRIMARY true #else - #define HAS_PRIMARY false + #define HAS_UxART_PRIMARY false #endif #if (!TS_NO_SECONDARY && defined(TS_SECONDARY_PORT)) diff --git a/firmware/console/binary/tunerstudio_io_serial.cpp b/firmware/console/binary/tunerstudio_io_serial.cpp index 421f7c87f0..6198f3f219 100644 --- a/firmware/console/binary/tunerstudio_io_serial.cpp +++ b/firmware/console/binary/tunerstudio_io_serial.cpp @@ -4,7 +4,7 @@ #include "tunerstudio_io.h" -#if HAS_PRIMARY || HAS_SECONDARY +#if HAS_UxART_PRIMARY || HAS_SECONDARY #if HAL_USE_SERIAL void SerialTsChannel::start(uint32_t baud) { SerialConfig cfg = { @@ -65,4 +65,4 @@ size_t UartTsChannel::readTimeout(uint8_t* buffer, size_t size, int timeout) { return size; } #endif // HAL_USE_UART -#endif // HAS_PRIMARY || HAS_SECONDARY +#endif // HAS_UxART_PRIMARY || HAS_SECONDARY diff --git a/firmware/console/binary/tunerstudio_io_serial_ports.cpp b/firmware/console/binary/tunerstudio_io_serial_ports.cpp index 2245bc4d5d..0b7b141757 100644 --- a/firmware/console/binary/tunerstudio_io_serial_ports.cpp +++ b/firmware/console/binary/tunerstudio_io_serial_ports.cpp @@ -20,7 +20,7 @@ class UartDmaTsChannel; class UartTsChannel; class SerialTsChannel; -#if HAS_PRIMARY +#if HAS_UxART_PRIMARY #ifdef TS_PRIMARY_PORT // We want to instantiate the correct channel type depending on what type of serial port we're @@ -56,7 +56,7 @@ class SerialTsChannel; }; static PrimaryChannelThread primaryChannelThread; -#endif // HAS_PRIMARY +#endif // HAS_UxART_PRIMARY #if HAS_SECONDARY #ifdef TS_SECONDARY_PORT @@ -90,7 +90,7 @@ class SerialTsChannel; #endif // HAS_SECONDARY void startSerialChannels() { -#if HAS_PRIMARY +#if HAS_UxART_PRIMARY // todo: invert setting one day? if (!engineConfiguration->disablePrimaryUart) { primaryChannelThread.start(); @@ -106,7 +106,7 @@ SerialTsChannelBase* getBluetoothChannel() { #if HAS_SECONDARY // Prefer secondary channel for bluetooth return &secondaryChannel; -#elif HAS_PRIMARY +#elif HAS_UxART_PRIMARY // Use primary channel for BT if no secondary exists return &primaryChannel; #endif