Default binary should have more relaxed pinout: serial #4998

we can now simplify code a bit
This commit is contained in:
rusefillc 2023-01-23 08:04:41 -05:00
parent 223f69083d
commit d4e61df602
4 changed files with 6 additions and 16 deletions

View File

@ -42,6 +42,7 @@ Release template (copy/paste this for new release):
- STM32Cube v2.12
- detect and ignore doubled trigger edges #4656
- Additional fuel and timing correction gauges in Tunerstudio #4955
- Default bundle no longer initializes UART TTL connectivity by default #4998
### Fixed
- multi-line tooltips in TS #4927

View File

@ -10,12 +10,6 @@
#include "global.h"
#include "tunerstudio_impl.h"
#if (!TS_NO_PRIMARY && defined(TS_PRIMARY_UxART_PORT))
#define HAS_UxART_PRIMARY true
#else
#define HAS_UxART_PRIMARY false
#endif
#if EFI_USB_SERIAL
#include "usbconsole.h"
#endif // EFI_USB_SERIAL

View File

@ -4,7 +4,7 @@
#include "tunerstudio_io.h"
#if HAS_UxART_PRIMARY || defined(TS_SECONDARY_UxART_PORT)
#if defined(TS_PRIMARY_UxART_PORT) || defined(TS_SECONDARY_UxART_PORT)
#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 || defined(TS_SECONDARY_UxART_PORT)
#endif // defined(TS_PRIMARY_UxART_PORT) || defined(TS_SECONDARY_UxART_PORT)

View File

@ -20,7 +20,6 @@ class UartDmaTsChannel;
class UartTsChannel;
class SerialTsChannel;
#if HAS_UxART_PRIMARY
#ifdef TS_PRIMARY_UxART_PORT
// We want to instantiate the correct channel type depending on what type of serial port we're
@ -36,7 +35,6 @@ class SerialTsChannel;
UartTsChannel,
#endif // EFI_USE_UART_DMA
SerialTsChannel> primaryChannel(TS_PRIMARY_UxART_PORT);
#endif // TS_PRIMARY_UxART_PORT
struct PrimaryChannelThread : public TunerstudioThread {
PrimaryChannelThread() : TunerstudioThread("Primary TS Channel") { }
@ -56,9 +54,8 @@ class SerialTsChannel;
};
static PrimaryChannelThread primaryChannelThread;
#endif // HAS_UxART_PRIMARY
#endif // defined(TS_PRIMARY_UxART_PORT)
#if defined(TS_SECONDARY_UxART_PORT)
#ifdef TS_SECONDARY_UxART_PORT
std::conditional_t<
std::is_same_v<decltype(TS_SECONDARY_UxART_PORT), UARTDriver>,
@ -68,8 +65,6 @@ class SerialTsChannel;
UartTsChannel,
#endif // EFI_USE_UART_DMA
SerialTsChannel> secondaryChannel(TS_SECONDARY_UxART_PORT);
#endif // defined(TS_SECONDARY_UxART_PORT)
struct SecondaryChannelThread : public TunerstudioThread {
SecondaryChannelThread() : TunerstudioThread("Secondary TS Channel") { }
@ -90,7 +85,7 @@ class SerialTsChannel;
#endif // defined(TS_SECONDARY_UxART_PORT)
void startSerialChannels() {
#if HAS_UxART_PRIMARY
#if defined(TS_PRIMARY_UxART_PORT)
// todo: invert setting one day?
if (!engineConfiguration->disablePrimaryUart) {
primaryChannelThread.start();
@ -106,7 +101,7 @@ SerialTsChannelBase* getBluetoothChannel() {
#if defined(TS_SECONDARY_UxART_PORT)
// Prefer secondary channel for bluetooth
return &secondaryChannel;
#elif HAS_UxART_PRIMARY
#elif defined(TS_PRIMARY_UxART_PORT)
// Use primary channel for BT if no secondary exists
return &primaryChannel;
#endif