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

This commit is contained in:
rusefillc 2023-01-23 04:55:24 -05:00
parent 00755e37f7
commit 406c8b167f
3 changed files with 8 additions and 8 deletions

View File

@ -11,9 +11,9 @@
#include "tunerstudio_impl.h" #include "tunerstudio_impl.h"
#if (!TS_NO_PRIMARY && defined(TS_PRIMARY_PORT)) #if (!TS_NO_PRIMARY && defined(TS_PRIMARY_PORT))
#define HAS_PRIMARY true #define HAS_UxART_PRIMARY true
#else #else
#define HAS_PRIMARY false #define HAS_UxART_PRIMARY false
#endif #endif
#if (!TS_NO_SECONDARY && defined(TS_SECONDARY_PORT)) #if (!TS_NO_SECONDARY && defined(TS_SECONDARY_PORT))

View File

@ -4,7 +4,7 @@
#include "tunerstudio_io.h" #include "tunerstudio_io.h"
#if HAS_PRIMARY || HAS_SECONDARY #if HAS_UxART_PRIMARY || HAS_SECONDARY
#if HAL_USE_SERIAL #if HAL_USE_SERIAL
void SerialTsChannel::start(uint32_t baud) { void SerialTsChannel::start(uint32_t baud) {
SerialConfig cfg = { SerialConfig cfg = {
@ -65,4 +65,4 @@ size_t UartTsChannel::readTimeout(uint8_t* buffer, size_t size, int timeout) {
return size; return size;
} }
#endif // HAL_USE_UART #endif // HAL_USE_UART
#endif // HAS_PRIMARY || HAS_SECONDARY #endif // HAS_UxART_PRIMARY || HAS_SECONDARY

View File

@ -20,7 +20,7 @@ class UartDmaTsChannel;
class UartTsChannel; class UartTsChannel;
class SerialTsChannel; class SerialTsChannel;
#if HAS_PRIMARY #if HAS_UxART_PRIMARY
#ifdef TS_PRIMARY_PORT #ifdef TS_PRIMARY_PORT
// We want to instantiate the correct channel type depending on what type of serial port we're // 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; static PrimaryChannelThread primaryChannelThread;
#endif // HAS_PRIMARY #endif // HAS_UxART_PRIMARY
#if HAS_SECONDARY #if HAS_SECONDARY
#ifdef TS_SECONDARY_PORT #ifdef TS_SECONDARY_PORT
@ -90,7 +90,7 @@ class SerialTsChannel;
#endif // HAS_SECONDARY #endif // HAS_SECONDARY
void startSerialChannels() { void startSerialChannels() {
#if HAS_PRIMARY #if HAS_UxART_PRIMARY
// todo: invert setting one day? // todo: invert setting one day?
if (!engineConfiguration->disablePrimaryUart) { if (!engineConfiguration->disablePrimaryUart) {
primaryChannelThread.start(); primaryChannelThread.start();
@ -106,7 +106,7 @@ SerialTsChannelBase* getBluetoothChannel() {
#if HAS_SECONDARY #if HAS_SECONDARY
// Prefer secondary channel for bluetooth // Prefer secondary channel for bluetooth
return &secondaryChannel; return &secondaryChannel;
#elif HAS_PRIMARY #elif HAS_UxART_PRIMARY
// Use primary channel for BT if no secondary exists // Use primary channel for BT if no secondary exists
return &primaryChannel; return &primaryChannel;
#endif #endif