diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 7a38967d96..8bf837bd5e 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -113,8 +113,8 @@ static void resetTs() { void printTsStats(void) { #if EFI_PROD_CODE #ifdef EFI_CONSOLE_RX_BRAIN_PIN - efiPrintf("Primary Channel RX", hwPortname(EFI_CONSOLE_RX_BRAIN_PIN)); - efiPrintf("Primary Channel TX", hwPortname(EFI_CONSOLE_TX_BRAIN_PIN)); + efiPrintf("Primary UART RX", hwPortname(EFI_CONSOLE_RX_BRAIN_PIN)); + efiPrintf("Primary UART TX", hwPortname(EFI_CONSOLE_TX_BRAIN_PIN)); #endif if (false) { diff --git a/firmware/console/binary/tunerstudio_io_serial_ports.cpp b/firmware/console/binary/tunerstudio_io_serial_ports.cpp index 4297933c0e..6bff431c77 100644 --- a/firmware/console/binary/tunerstudio_io_serial_ports.cpp +++ b/firmware/console/binary/tunerstudio_io_serial_ports.cpp @@ -40,8 +40,10 @@ class SerialTsChannel; TsChannelBase* setupChannel() { #if EFI_PROD_CODE - efiSetPadMode("Primary Channel RX", EFI_CONSOLE_RX_BRAIN_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); - efiSetPadMode("Primary Channel TX", EFI_CONSOLE_TX_BRAIN_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); + // historically the idea was that primary UART has to be very hard-coded as the last line of reliability defense + // as of 2022 it looks like sometimes we just need the GPIO on MRE for instance more than we need UART + efiSetPadMode("Primary UART RX", EFI_CONSOLE_RX_BRAIN_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); + efiSetPadMode("Primary UART TX", EFI_CONSOLE_TX_BRAIN_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF)); #endif /* EFI_PROD_CODE */ primaryChannel.start(engineConfiguration->uartConsoleSerialSpeed); @@ -71,8 +73,8 @@ class SerialTsChannel; TsChannelBase* setupChannel() { #if EFI_PROD_CODE - efiSetPadMode("Secondary Channel RX", engineConfiguration->binarySerialRxPin, PAL_MODE_ALTERNATE(TS_SERIAL_AF)); - efiSetPadMode("Secondary Channel TX", engineConfiguration->binarySerialTxPin, PAL_MODE_ALTERNATE(TS_SERIAL_AF)); + efiSetPadMode("Secondary UART RX", engineConfiguration->binarySerialRxPin, PAL_MODE_ALTERNATE(TS_SERIAL_AF)); + efiSetPadMode("Secondary UART TX", engineConfiguration->binarySerialTxPin, PAL_MODE_ALTERNATE(TS_SERIAL_AF)); #endif /* EFI_PROD_CODE */ secondaryChannel.start(engineConfiguration->uartConsoleSerialSpeed); @@ -86,7 +88,10 @@ class SerialTsChannel; void startSerialChannels() { #if HAS_PRIMARY - primaryChannelThread.Start(); + // todo: invert setting one day? + if (!engineConfiguration->disablePrimaryUart) { + primaryChannelThread.Start(); + } #endif #if HAS_SECONDARY diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index d0b7a8b4d1..ba7d5f1530 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1000,7 +1000,7 @@ end_struct uint16_t tps2SecondaryMin;;"ADC", 1, 0, 0, 1000, 0 uint16_t tps2SecondaryMax;;"ADC", 1, 0, 0, 1000, 0 - bit unused1464b0 + bit disablePrimaryUart bit fuelClosedLoopCorrectionEnabled;+Enables lambda sensor closed loop feedback for fuelling. bit isVerboseIAC;+Print details into rusEfi console\nenable verbose_idle bit unused1464b3 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 404724bf3a..07c5c61cf4 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -3563,6 +3563,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" ; Racing Features->Launch Control dialog = smLaunchControl, "Launch Control Settings EXPERIMENTAL" + field = "disablePrimaryUart", disablePrimaryUart field = "Enable Launch Control", launchControlEnabled field = "Activation Mode", launchActivationMode field = "Switch Input", launchActivatePin, {launchActivationMode == 0 && launchControlEnabled == 1}