Refactoring: less confusion macro names around serial/uart/etc in connectivity #4999
This commit is contained in:
parent
7b58305ea3
commit
b699bb48d4
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue