Refactoring: less confusion macro names around serial/uart/etc in connectivity #4999

This commit is contained in:
rusefillc 2023-01-23 04:59:43 -05:00
parent b699bb48d4
commit 46005774f4
3 changed files with 8 additions and 8 deletions

View File

@ -17,9 +17,9 @@
#endif
#if (!TS_NO_SECONDARY && defined(TS_SECONDARY_PORT))
#define HAS_SECONDARY true
#define HAS_UxART_SECONDARY true
#else
#define HAS_SECONDARY false
#define HAS_UxART_SECONDARY false
#endif
#if EFI_USB_SERIAL

View File

@ -4,7 +4,7 @@
#include "tunerstudio_io.h"
#if HAS_UxART_PRIMARY || HAS_SECONDARY
#if HAS_UxART_PRIMARY || HAS_UxART_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_UxART_PRIMARY || HAS_SECONDARY
#endif // HAS_UxART_PRIMARY || HAS_UxART_SECONDARY

View File

@ -58,7 +58,7 @@ class SerialTsChannel;
static PrimaryChannelThread primaryChannelThread;
#endif // HAS_UxART_PRIMARY
#if HAS_SECONDARY
#if HAS_UxART_SECONDARY
#ifdef TS_SECONDARY_PORT
std::conditional_t<
std::is_same_v<decltype(TS_SECONDARY_PORT), UARTDriver>,
@ -87,7 +87,7 @@ class SerialTsChannel;
};
static SecondaryChannelThread secondaryChannelThread;
#endif // HAS_SECONDARY
#endif // HAS_UxART_SECONDARY
void startSerialChannels() {
#if HAS_UxART_PRIMARY
@ -97,13 +97,13 @@ void startSerialChannels() {
}
#endif
#if HAS_SECONDARY
#if HAS_UxART_SECONDARY
secondaryChannelThread.start();
#endif
}
SerialTsChannelBase* getBluetoothChannel() {
#if HAS_SECONDARY
#if HAS_UxART_SECONDARY
// Prefer secondary channel for bluetooth
return &secondaryChannel;
#elif HAS_UxART_PRIMARY