this change is probably breaking stuff, but some stuff is already broken. something is not right in too many places :(
This commit is contained in:
parent
919c973853
commit
5b522dc8fd
|
@ -41,8 +41,10 @@ int main(void) {
|
|||
setDefaultBasePins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
// set UART pads configuration based on the board
|
||||
setDefaultSerialParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
/* at the moment SD card is not needed by bootloader
|
||||
// set SD card configuration also
|
||||
setDefaultSdCardParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
*/
|
||||
|
||||
// start UART
|
||||
startTsPort(getTsChannel());
|
||||
|
|
|
@ -81,10 +81,6 @@ void disableLCD(board_configuration_s *boardConfiguration) {
|
|||
boardConfiguration->HD44780_db7 = GPIO_UNASSIGNED;
|
||||
}
|
||||
|
||||
void setMinimalPinsEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
// all basic settings are already set in prepareVoidConfiguration(), no need to set anything here
|
||||
}
|
||||
|
||||
// todo: should this be renamed to 'setFrankensoConfiguration'?
|
||||
// todo: should this be part of more default configurations?
|
||||
void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
@ -247,9 +243,6 @@ void setFrankensoBoardTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
|
||||
// ETB_BENCH_ENGINE
|
||||
void setEtbTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
setMinimalPinsEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// VAG test ETB
|
||||
// set tps_min 54
|
||||
engineConfiguration->tpsMin = 54;
|
||||
|
@ -296,9 +289,6 @@ void setEtbTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
// TLE8888_BENCH_ENGINE
|
||||
// set engine_type 59
|
||||
void setTle8888TestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
setMinimalPinsEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 8;
|
||||
engineConfiguration->specs.firingOrder = FO_1_8_7_2_6_5_4_3;
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
|
@ -353,6 +343,9 @@ void setTle8888TestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
CONFIG(etb2.directionPin2) = GPIOE_4;
|
||||
|
||||
boardConfiguration->fuelPumpPin = TLE8888_PIN_20;
|
||||
|
||||
engineConfiguration->tpsAdcChannel = EFI_ADC_3; // PA3
|
||||
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_4; // PA4
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ENGINES_CUSTOM_ENGINE_CPP_ */
|
||||
|
|
|
@ -13,7 +13,6 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|||
void setFrankenso_01_LCD(board_configuration_s *boardConfiguration);
|
||||
void disableLCD(board_configuration_s *boardConfiguration);
|
||||
void runSchedulingPrecisionTestIfNeeded(void);
|
||||
void setMinimalPinsEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void setFrankensoBoardTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void setEtbTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void setTle8888TestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
|
|
@ -90,12 +90,13 @@ void startTsPort(ts_channel_s *tsChannel) {
|
|||
print("TunerStudio over USB serial");
|
||||
/**
|
||||
* This method contains a long delay, that's the reason why this is not done on the main thread
|
||||
* TODO: actually now with some refactoring this IS on the main thread :(
|
||||
*/
|
||||
usb_serial_start();
|
||||
// if console uses UART then TS uses USB
|
||||
tsChannel->channel = (BaseChannel *) &CONSOLE_USB_DEVICE;
|
||||
return;
|
||||
#endif
|
||||
#endif /* CONSOLE_USB_DEVICE */
|
||||
#if defined(TS_UART_DEVICE) || defined(TS_SERIAL_DEVICE)
|
||||
if (CONFIGB(useSerialPort)) {
|
||||
|
||||
|
|
|
@ -456,7 +456,7 @@ void setDefaultBasePins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
// call overrided board-specific serial configuration setup, if needed (for custom boards only)
|
||||
// needed also by bootloader code
|
||||
setPinConfigurationOverrides();
|
||||
#endif
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
// needed also by bootloader code
|
||||
|
@ -472,10 +472,11 @@ void setDefaultSerialParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
#if EFI_PROD_CODE
|
||||
// call overrided board-specific serial configuration setup, if needed (for custom boards only)
|
||||
setSerialConfigurationOverrides();
|
||||
#endif
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
// needed also by bootloader code
|
||||
// at the moment bootloader does NOT really need SD card, this is a step towards future bootloader SD card usage
|
||||
void setDefaultSdCardParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
boardConfiguration->is_enabled_spi_3 = true;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
|
||||
|
@ -485,7 +486,7 @@ void setDefaultSdCardParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
#if EFI_PROD_CODE
|
||||
// call overrided board-specific SD card configuration setup, if needed (for custom boards only)
|
||||
setSdCardConfigurationOverrides();
|
||||
#endif
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
|
||||
|
@ -1145,7 +1146,10 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
/**
|
||||
* Let's apply global board defaults too, for most of the boards
|
||||
*/
|
||||
if (engineType != MINIMAL_PINS) {
|
||||
if (engineType != MINIMAL_PINS
|
||||
/* this is a bit nasty */
|
||||
&& engineType != ETB_BENCH_ENGINE
|
||||
&& engineType != TLE8888_BENCH_ENGINE) {
|
||||
setDefaultBoardConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
|
@ -1167,7 +1171,7 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case MINIMAL_PINS:
|
||||
setMinimalPinsEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
// all basic settings are already set in prepareVoidConfiguration(), no need to set anything here
|
||||
break;
|
||||
case ACURA_RSX:
|
||||
setAcuraRSX(engineConfiguration);
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
static bool isUsbSerialInitialized = false;
|
||||
|
||||
/**
|
||||
* start USB serial using hard-coded communications pins (see comments inside the code)
|
||||
*/
|
||||
void usb_serial_start(void) {
|
||||
/*
|
||||
* Initializes a serial-over-USB CDC driver.
|
||||
|
|
Loading…
Reference in New Issue