Default binary should have more relaxed pinout: serial #4998
refactoring: it looks like we can go with simpler code?
This commit is contained in:
parent
15ae3a4591
commit
f036c566f4
|
@ -10,9 +10,6 @@ DDEFS += -DFIRMWARE_ID=\"atlas\"
|
||||||
# DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
|
# DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
|
||||||
# DEFS += -DEFI_SOFTWARE_KNOCK=TRUE
|
# DEFS += -DEFI_SOFTWARE_KNOCK=TRUE
|
||||||
|
|
||||||
# disable hardware serial ports on H7
|
|
||||||
# DDEFS += -DTS_NO_PRIMARY=1 -DTS_NO_SECONDARY=1
|
|
||||||
|
|
||||||
# We are running on Atlas hardware!
|
# We are running on Atlas hardware!
|
||||||
DDEFS += -DHW_ATLAS=1
|
DDEFS += -DHW_ATLAS=1
|
||||||
|
|
||||||
|
|
|
@ -11,5 +11,3 @@ DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=INVERTED_OUTPUT
|
||||||
|
|
||||||
# We are running on Hellen-One hardware!
|
# We are running on Hellen-One hardware!
|
||||||
DDEFS += -DHW_HELLEN=1
|
DDEFS += -DHW_HELLEN=1
|
||||||
|
|
||||||
DDEFS += -DTS_NO_SECONDARY=TRUE
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ PROJECT_CPU = ARCH_STM32F4
|
||||||
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::C11
|
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::C11
|
||||||
|
|
||||||
# No serial ports for now
|
# No serial ports for now
|
||||||
DDEFS += -DTS_NO_PRIMARY=TRUE -DTS_NO_SECONDARY=TRUE
|
DDEFS += -DTS_NO_PRIMARY=TRUE
|
||||||
|
|
||||||
# No USB
|
# No USB
|
||||||
DDEFS += -DEFI_USB_SERIAL=FALSE
|
DDEFS += -DEFI_USB_SERIAL=FALSE
|
||||||
|
|
|
@ -46,9 +46,6 @@
|
||||||
#ifndef TS_NO_PRIMARY
|
#ifndef TS_NO_PRIMARY
|
||||||
#define TS_NO_PRIMARY 1
|
#define TS_NO_PRIMARY 1
|
||||||
#endif
|
#endif
|
||||||
#ifndef TS_NO_SECONDARY
|
|
||||||
#define TS_NO_SECONDARY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define AUX_SERIAL_DEVICE (&SD6)
|
#define AUX_SERIAL_DEVICE (&SD6)
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,6 @@
|
||||||
#define HAS_UxART_PRIMARY false
|
#define HAS_UxART_PRIMARY false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (!TS_NO_SECONDARY && defined(TS_SECONDARY_UxART_PORT))
|
|
||||||
#define HAS_UxART_SECONDARY true
|
|
||||||
#else
|
|
||||||
#define HAS_UxART_SECONDARY false
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if EFI_USB_SERIAL
|
#if EFI_USB_SERIAL
|
||||||
#include "usbconsole.h"
|
#include "usbconsole.h"
|
||||||
#endif // EFI_USB_SERIAL
|
#endif // EFI_USB_SERIAL
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "tunerstudio_io.h"
|
#include "tunerstudio_io.h"
|
||||||
|
|
||||||
#if HAS_UxART_PRIMARY || HAS_UxART_SECONDARY
|
#if HAS_UxART_PRIMARY || defined(TS_SECONDARY_UxART_PORT)
|
||||||
#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_UxART_PRIMARY || HAS_UxART_SECONDARY
|
#endif // HAS_UxART_PRIMARY || defined(TS_SECONDARY_UxART_PORT)
|
||||||
|
|
|
@ -58,7 +58,7 @@ class SerialTsChannel;
|
||||||
static PrimaryChannelThread primaryChannelThread;
|
static PrimaryChannelThread primaryChannelThread;
|
||||||
#endif // HAS_UxART_PRIMARY
|
#endif // HAS_UxART_PRIMARY
|
||||||
|
|
||||||
#if HAS_UxART_SECONDARY
|
#if defined(TS_SECONDARY_UxART_PORT)
|
||||||
#ifdef TS_SECONDARY_UxART_PORT
|
#ifdef TS_SECONDARY_UxART_PORT
|
||||||
std::conditional_t<
|
std::conditional_t<
|
||||||
std::is_same_v<decltype(TS_SECONDARY_UxART_PORT), UARTDriver>,
|
std::is_same_v<decltype(TS_SECONDARY_UxART_PORT), UARTDriver>,
|
||||||
|
@ -68,7 +68,7 @@ class SerialTsChannel;
|
||||||
UartTsChannel,
|
UartTsChannel,
|
||||||
#endif // EFI_USE_UART_DMA
|
#endif // EFI_USE_UART_DMA
|
||||||
SerialTsChannel> secondaryChannel(TS_SECONDARY_UxART_PORT);
|
SerialTsChannel> secondaryChannel(TS_SECONDARY_UxART_PORT);
|
||||||
#endif // TS_SECONDARY_UxART_PORT
|
#endif // defined(TS_SECONDARY_UxART_PORT)
|
||||||
|
|
||||||
|
|
||||||
struct SecondaryChannelThread : public TunerstudioThread {
|
struct SecondaryChannelThread : public TunerstudioThread {
|
||||||
|
@ -87,7 +87,7 @@ class SerialTsChannel;
|
||||||
};
|
};
|
||||||
|
|
||||||
static SecondaryChannelThread secondaryChannelThread;
|
static SecondaryChannelThread secondaryChannelThread;
|
||||||
#endif // HAS_UxART_SECONDARY
|
#endif // defined(TS_SECONDARY_UxART_PORT)
|
||||||
|
|
||||||
void startSerialChannels() {
|
void startSerialChannels() {
|
||||||
#if HAS_UxART_PRIMARY
|
#if HAS_UxART_PRIMARY
|
||||||
|
@ -97,13 +97,13 @@ void startSerialChannels() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_UxART_SECONDARY
|
#if defined(TS_SECONDARY_UxART_PORT)
|
||||||
secondaryChannelThread.start();
|
secondaryChannelThread.start();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SerialTsChannelBase* getBluetoothChannel() {
|
SerialTsChannelBase* getBluetoothChannel() {
|
||||||
#if HAS_UxART_SECONDARY
|
#if defined(TS_SECONDARY_UxART_PORT)
|
||||||
// Prefer secondary channel for bluetooth
|
// Prefer secondary channel for bluetooth
|
||||||
return &secondaryChannel;
|
return &secondaryChannel;
|
||||||
#elif HAS_UxART_PRIMARY
|
#elif HAS_UxART_PRIMARY
|
||||||
|
|
Loading…
Reference in New Issue