get rid of setSerialConfigurationOverrides (#4274)
* get rid of setSerialConfigurationOverrides * missed a few * kinetis
This commit is contained in:
parent
6ef7562666
commit
b92c0149d6
|
@ -25,7 +25,6 @@ extern "C" {
|
|||
#endif
|
||||
void boardInit(void);
|
||||
void setPinConfigurationOverrides(void);
|
||||
void setSerialConfigurationOverrides(void);
|
||||
void setAdcChannelOverrides(void);
|
||||
|
||||
/**
|
||||
|
|
|
@ -107,27 +107,12 @@ void setBoardDefaultConfiguration() {
|
|||
|
||||
engineConfiguration->adcVcc = 5.0f;
|
||||
engineConfiguration->analogInputDividerCoefficient = 1;
|
||||
|
||||
// we call it here because setDefaultBoardConfiguration() is not called for DEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||
setSerialConfigurationOverrides();
|
||||
#endif
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!
|
||||
//engineConfiguration->isFastAdcEnabled = false;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
#if 0
|
||||
engineConfiguration->useSerialPort = true;
|
||||
engineConfiguration->binarySerialTxPin = Gpio::C7;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::C6;
|
||||
engineConfiguration->consoleSerialTxPin = Gpio::A10;
|
||||
engineConfiguration->consoleSerialRxPin = Gpio::A11;
|
||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
||||
#endif
|
||||
}
|
||||
|
||||
void setAdcChannelOverrides() {
|
||||
addAdcChannelForTrigger();
|
||||
}
|
||||
|
|
|
@ -147,15 +147,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -125,11 +125,6 @@ void setBoardConfigOverrides() {
|
|||
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -100,11 +100,6 @@ void setBoardConfigOverrides() {
|
|||
}
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -98,15 +98,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->iat.config.bias_resistor = 4700;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -108,15 +108,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -161,15 +161,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->canRxPin = H176_CAN_RX;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -123,15 +123,6 @@ void setBoardConfigOverrides() {
|
|||
}
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -101,15 +101,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->canRxPin = H176_CAN_RX;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -106,15 +106,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -115,15 +115,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -95,15 +95,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->iat.config.bias_resistor = 4700;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -102,15 +102,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->etbIo[0].controlPin = Gpio::C6; // PWM 2
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -86,7 +86,6 @@ void setBoardOverrides() {
|
|||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = true;
|
||||
engineConfiguration->binarySerialTxPin = Gpio::C7;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::C6;
|
||||
// engineConfiguration->consoleSerialTxPin = Gpio::A10;
|
||||
|
|
|
@ -174,12 +174,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->spi3sckPin = Gpio::C10;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
// why would MRE disable serial by default? we definitely have pads exposed
|
||||
engineConfiguration->useSerialPort = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -13,22 +13,15 @@
|
|||
#undef SERIAL_SPEED
|
||||
#define SERIAL_SPEED 115200
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = true;
|
||||
engineConfiguration->binarySerialTxPin = Gpio::D8;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::D9;
|
||||
// engineConfiguration->consoleSerialTxPin = Gpio::D8;
|
||||
// engineConfiguration->consoleSerialRxPin = Gpio::D9;
|
||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
void setBoardDefaultConfiguration() {
|
||||
setSerialConfigurationOverrides();
|
||||
engineConfiguration->binarySerialTxPin = Gpio::D8;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::D9;
|
||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
||||
|
||||
engineConfiguration->runningLedPin = Gpio::B0; //green LED
|
||||
engineConfiguration->warningLedPin = Gpio::Unassigned;
|
||||
|
|
|
@ -97,16 +97,6 @@ void setPinConfigurationOverrides() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = true;
|
||||
engineConfiguration->binarySerialTxPin = Gpio::A0;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::A1;
|
||||
// engineConfiguration->consoleSerialTxPin = Gpio::A0;
|
||||
// engineConfiguration->consoleSerialRxPin = Gpio::A1;
|
||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
* @todo Add your board-specific code, if any.
|
||||
|
@ -116,7 +106,10 @@ void setBoardDefaultConfiguration() {
|
|||
// TODO: remove it when the bootloader is ready
|
||||
chThdSleepMilliseconds(2000);
|
||||
|
||||
setSerialConfigurationOverrides();
|
||||
engineConfiguration->binarySerialTxPin = Gpio::A0;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::A1;
|
||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
||||
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_13;
|
||||
engineConfiguration->tps1_1AdcChannel = is469 ? EFI_ADC_7 : EFI_ADC_14;
|
||||
|
|
|
@ -154,15 +154,6 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->lps25BaroSensorSda = Gpio::B11;
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
* firmware/controllers/algo/engine_configuration.cpp
|
||||
* void setBoardDefaultConfiguration();
|
||||
* void setPinConfigurationOverrides();
|
||||
* void setSerialConfigurationOverrides();
|
||||
*
|
||||
* Future: Clean up the distinction between these functions.
|
||||
*/
|
||||
|
@ -108,15 +107,6 @@ static void setupDefaultSensorInputs() {
|
|||
}
|
||||
|
||||
// Future: configure USART3 for LIN bus and UART4 for console
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration overrides.
|
||||
*
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
#include "smart_gpio.h"
|
||||
#include "drivers/gpio/mc33810.h"
|
||||
|
||||
void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
static void setSerialConfigurationOverrides() {
|
||||
engineConfiguration->binarySerialTxPin = Gpio::E1;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::E0;
|
||||
/* actually Bluetooth/WiFi interface */
|
||||
|
|
|
@ -31,8 +31,6 @@ void setSachs() {
|
|||
engineConfiguration->trigger.customTotalToothCount = 50;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 2;
|
||||
|
||||
engineConfiguration->useSerialPort = false;
|
||||
|
||||
// Frankenstein analog input #1: PA1 adc1 MAP
|
||||
// Frankenstein analog input #2: PA3 adc3 TPS
|
||||
// Frankenstein analog input #3: PC3 adc13 IAT
|
||||
|
|
|
@ -388,11 +388,10 @@
|
|||
|
||||
#define AUX_SERIAL_DEVICE (&SD6)
|
||||
|
||||
// todo: start using consoleSerialTxPin? Not sure
|
||||
#ifndef EFI_CONSOLE_TX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN Gpio::C10
|
||||
#endif
|
||||
// todo: start using consoleSerialRxPin? Not sure
|
||||
|
||||
#ifndef EFI_CONSOLE_RX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN Gpio::C11
|
||||
#endif
|
||||
|
|
|
@ -52,11 +52,9 @@
|
|||
|
||||
#define AUX_SERIAL_DEVICE (&SD6)
|
||||
|
||||
// todo: start using consoleSerialTxPin? Not sure
|
||||
#undef EFI_CONSOLE_TX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN Gpio::D8
|
||||
|
||||
// todo: start using consoleSerialRxPin? Not sure
|
||||
#undef EFI_CONSOLE_RX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN Gpio::D9
|
||||
|
||||
|
|
|
@ -174,12 +174,6 @@ void bluetoothStart(bluetooth_module_e moduleType, const char *baudRate, const c
|
|||
static const char *usage = "Usage: bluetooth_hc06 <baud> <name> <pincode>";
|
||||
|
||||
tsChannel = getBluetoothChannel();
|
||||
|
||||
// if a binary protocol uses USB, we cannot init the bluetooth module!
|
||||
if (!engineConfiguration->useSerialPort) {
|
||||
efiPrintf("Failed! Serial Port connection is disabled!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (btProcessIsStarted) {
|
||||
efiPrintf("The Bluetooth module init procedure is already started and waiting! To cancel it, run \"bluetooth_cancel\" command!");
|
||||
|
|
|
@ -80,7 +80,7 @@ class SerialTsChannel;
|
|||
efiSetPadMode("Secondary UART TX", engineConfiguration->binarySerialTxPin, PAL_MODE_ALTERNATE(TS_SERIAL_AF));
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
secondaryChannel.start(engineConfiguration->uartConsoleSerialSpeed);
|
||||
secondaryChannel.start(engineConfiguration->tunerStudioSerialSpeed);
|
||||
|
||||
return &secondaryChannel;
|
||||
}
|
||||
|
|
|
@ -280,16 +280,10 @@ void setDefaultBasePins() {
|
|||
|
||||
// set UART pads configuration based on the board
|
||||
// needed also by bootloader code
|
||||
engineConfiguration->useSerialPort = true;
|
||||
engineConfiguration->binarySerialTxPin = Gpio::C10;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::C11;
|
||||
engineConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = 115200;
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
// call overrided board-specific serial configuration setup, if needed (for custom boards only)
|
||||
setSerialConfigurationOverrides();
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
// needed also by bootloader code
|
||||
|
@ -1188,4 +1182,3 @@ void setFrankenso0_1_joystick(engine_configuration_s *engineConfiguration) {
|
|||
// These symbols are weak so that a board_configuration.cpp file can override them
|
||||
__attribute__((weak)) void setBoardDefaultConfiguration() { }
|
||||
__attribute__((weak)) void setBoardConfigOverrides() { }
|
||||
__attribute__((weak)) void setSerialConfigurationOverrides() { }
|
||||
|
|
|
@ -723,8 +723,6 @@ static void enableOrDisable(const char *param, bool isEnabled) {
|
|||
setIdleMode(isEnabled ? IM_MANUAL : IM_AUTO);
|
||||
#endif /* EFI_IDLE_CONTROL */
|
||||
#endif /* EFI_PROD_CODE */
|
||||
} else if (strEqualCaseInsensitive(param, "serial")) {
|
||||
engineConfiguration->useSerialPort = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "stepperidle")) {
|
||||
engineConfiguration->useStepperIdle = isEnabled;
|
||||
} else if (strEqualCaseInsensitive(param, "trigger_only_front")) {
|
||||
|
|
|
@ -46,7 +46,6 @@ extern "C" {
|
|||
#endif
|
||||
void boardInit(void);
|
||||
void setPinConfigurationOverrides(void);
|
||||
void setSerialConfigurationOverrides(void);
|
||||
void setAdcChannelOverrides(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -755,7 +755,7 @@ bit is_enabled_spi_2
|
|||
bit isEngineControlEnabled
|
||||
bit isHip9011Enabled
|
||||
bit isVerboseAlternator
|
||||
bit useSerialPort
|
||||
bit unused744b8
|
||||
bit useStepperIdle;+This setting should only be used if you have a stepper motor idle valve and a stepper motor driver installed.
|
||||
|
||||
bit enabledStep1Limiter
|
||||
|
|
|
@ -267,7 +267,6 @@ enable2ndByteCanID = false
|
|||
requiresPowerCycle = runningLedPin
|
||||
requiresPowerCycle = binarySerialTxPin
|
||||
requiresPowerCycle = binarySerialRxPin
|
||||
requiresPowerCycle = useSerialPort
|
||||
requiresPowerCycle = tunerStudioSerialSpeed
|
||||
requiresPowerCycle = auxSerialRxPin
|
||||
requiresPowerCycle = auxSerialTxPin
|
||||
|
@ -3218,10 +3217,9 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
|
|||
|
||||
; Board->Connection
|
||||
dialog = tsPort, "Calibration Secondary Serial"
|
||||
field = "Use UART/TTL calibration serial?", useSerialPort
|
||||
field = "tunerStudioSerialSpeed", tunerStudioSerialSpeed, {useSerialPort == 1}
|
||||
field = "TX pin", binarySerialTxPin, {useSerialPort == 1}
|
||||
field = "RX pin", binarySerialRxPin, {useSerialPort == 1}
|
||||
field = "tunerStudioSerialSpeed", tunerStudioSerialSpeed
|
||||
field = "TX pin", binarySerialTxPin
|
||||
field = "RX pin", binarySerialRxPin
|
||||
|
||||
dialog = canHw1, "Primary CAN"
|
||||
field = "Verbose Can", verboseCan
|
||||
|
|
Loading…
Reference in New Issue