2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file engine_configuration.cpp
|
|
|
|
* @brief Utility method related to the engine configuration data structure.
|
|
|
|
*
|
|
|
|
* @date Nov 22, 2013
|
2020-01-07 21:02:40 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
|
|
|
* This file is part of rusEfi - see http://rusefi.com
|
|
|
|
*
|
|
|
|
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
|
|
|
|
* the GNU General Public License as published by the Free Software Foundation; either
|
|
|
|
* version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
|
|
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with this program.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-07-25 22:05:17 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2019-07-04 00:57:21 -07:00
|
|
|
#include "os_access.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "fsio_impl.h"
|
|
|
|
#include "speed_density.h"
|
|
|
|
#include "advance_map.h"
|
2021-03-25 15:16:26 -07:00
|
|
|
#include "flash_main.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2021-01-22 21:00:34 -08:00
|
|
|
#include "hip9011_logic.h"
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_MEMS
|
2017-08-18 13:18:11 -07:00
|
|
|
#include "accelerometer.h"
|
2019-04-02 20:19:21 -07:00
|
|
|
#endif
|
2017-08-16 23:56:25 -07:00
|
|
|
|
2021-06-02 14:50:07 -07:00
|
|
|
#include "defaults.h"
|
2021-10-02 09:50:06 -07:00
|
|
|
|
2019-11-14 20:58:04 -08:00
|
|
|
#include "bmw_m73.h"
|
2021-10-02 09:50:06 -07:00
|
|
|
#include "bmw_n73.h"
|
2016-10-04 12:02:36 -07:00
|
|
|
|
2021-10-02 09:50:06 -07:00
|
|
|
#include "citroenBerlingoTU3JP.h"
|
|
|
|
#include "custom_engine.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "dodge_neon.h"
|
2016-10-04 12:02:36 -07:00
|
|
|
#include "dodge_ram.h"
|
|
|
|
|
2021-10-02 09:50:06 -07:00
|
|
|
#include "engine_template.h"
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "ford_aspire.h"
|
|
|
|
#include "ford_1995_inline_6.h"
|
2016-10-04 12:02:36 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "honda_accord.h"
|
2021-10-02 09:50:06 -07:00
|
|
|
#include "honda_k_dbc.h"
|
|
|
|
#include "honda_600.h"
|
2021-10-11 12:04:27 -07:00
|
|
|
#include "hyundai.h"
|
2021-10-02 09:50:06 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "GY6_139QMB.h"
|
2016-10-04 12:02:36 -07:00
|
|
|
|
2021-10-02 09:50:06 -07:00
|
|
|
#include "nissan_primera.h"
|
|
|
|
#include "nissan_vq.h"
|
|
|
|
|
2016-10-04 12:02:36 -07:00
|
|
|
#include "mazda_miata.h"
|
|
|
|
#include "mazda_miata_1_6.h"
|
2018-09-06 19:41:05 -07:00
|
|
|
#include "mazda_miata_na8.h"
|
|
|
|
#include "mazda_miata_nb.h"
|
2016-10-04 12:02:36 -07:00
|
|
|
#include "mazda_miata_vvt.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "mazda_626.h"
|
2020-12-14 21:09:35 -08:00
|
|
|
#include "m111.h"
|
2021-09-17 21:17:52 -07:00
|
|
|
#include "mercedes.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "mitsubishi.h"
|
2021-10-02 09:50:06 -07:00
|
|
|
#include "me7pnp.h"
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "subaru.h"
|
|
|
|
#include "test_engine.h"
|
|
|
|
#include "sachs.h"
|
|
|
|
#include "vw.h"
|
2019-12-26 18:33:12 -08:00
|
|
|
#include "vw_b6.h"
|
2015-10-16 13:01:21 -07:00
|
|
|
#include "chevrolet_camaro_4.h"
|
2015-12-30 13:02:18 -08:00
|
|
|
#include "toyota_jzs147.h"
|
2016-01-04 02:02:45 -08:00
|
|
|
#include "ford_festiva.h"
|
2020-02-02 00:56:21 -08:00
|
|
|
#include "boost_control.h"
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_IDLE_CONTROL
|
2017-12-03 12:31:11 -08:00
|
|
|
#include "idle_thread.h"
|
2018-10-30 04:58:50 -07:00
|
|
|
#endif /* EFI_IDLE_CONTROL */
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_ALTERNATOR_CONTROL
|
2019-03-31 13:56:13 -07:00
|
|
|
#include "alternator_controller.h"
|
2018-10-30 04:58:50 -07:00
|
|
|
#endif
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
2018-10-30 04:58:50 -07:00
|
|
|
#include "electronic_throttle.h"
|
|
|
|
#endif
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_HIP_9011
|
2019-04-09 16:12:35 -07:00
|
|
|
#include "hip9011.h"
|
2018-10-30 04:58:50 -07:00
|
|
|
#endif
|
|
|
|
|
2021-07-14 22:28:44 -07:00
|
|
|
#include "hardware.h"
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_PROD_CODE
|
2017-12-03 12:31:11 -08:00
|
|
|
#include "board.h"
|
|
|
|
#endif /* EFI_PROD_CODE */
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_EMULATE_POSITION_SENSORS
|
2020-04-24 11:00:06 -07:00
|
|
|
#include "trigger_emulator_algo.h"
|
2017-12-17 12:41:58 -08:00
|
|
|
#endif /* EFI_EMULATE_POSITION_SENSORS */
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_TUNER_STUDIO
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "tunerstudio.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//#define TS_DEFAULT_SPEED 115200
|
|
|
|
#define TS_DEFAULT_SPEED 38400
|
|
|
|
|
2016-09-13 17:03:14 -07:00
|
|
|
/**
|
|
|
|
* Current engine configuration. On firmware start we assign empty configuration, then
|
|
|
|
* we copy actual configuration after reading settings.
|
|
|
|
* This is useful to compare old and new configurations in order to apply new settings.
|
|
|
|
*
|
|
|
|
* todo: place this field next to 'engineConfiguration'?
|
|
|
|
*/
|
2020-12-16 19:53:26 -08:00
|
|
|
#if EFI_ACTIVE_CONFIGURATION_IN_FLASH
|
2020-04-25 13:32:32 -07:00
|
|
|
#include "flash_int.h"
|
2020-02-04 18:36:38 -08:00
|
|
|
engine_configuration_s & activeConfiguration = reinterpret_cast<persistent_config_container_s*>(getFlashAddrFirstCopy())->persistentConfiguration.engineConfiguration;
|
2019-11-24 21:02:53 -08:00
|
|
|
// we cannot use this activeConfiguration until we call rememberCurrentConfiguration()
|
|
|
|
bool isActiveConfigurationVoid = true;
|
2019-04-15 05:40:12 -07:00
|
|
|
#else
|
2019-10-31 13:06:34 -07:00
|
|
|
static engine_configuration_s activeConfigurationLocalStorage;
|
|
|
|
engine_configuration_s & activeConfiguration = activeConfigurationLocalStorage;
|
2019-04-15 05:40:12 -07:00
|
|
|
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
|
2016-09-13 17:03:14 -07:00
|
|
|
|
|
|
|
extern engine_configuration_s *engineConfiguration;
|
|
|
|
|
2021-03-30 04:28:22 -07:00
|
|
|
void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2020-12-16 19:00:42 -08:00
|
|
|
#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
|
2016-09-13 17:03:14 -07:00
|
|
|
memcpy(&activeConfiguration, engineConfiguration, sizeof(engine_configuration_s));
|
2019-11-24 21:02:53 -08:00
|
|
|
#else
|
|
|
|
isActiveConfigurationVoid = false;
|
2019-04-15 05:40:12 -07:00
|
|
|
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
|
2016-09-13 17:03:14 -07:00
|
|
|
}
|
|
|
|
|
2020-07-05 08:16:07 -07:00
|
|
|
static void wipeString(char *string, int size) {
|
|
|
|
// we have to reset bytes after \0 symbol in order to calculate correct tune CRC from MSQ file
|
|
|
|
for (int i = strlen(string) + 1; i < size; i++) {
|
|
|
|
string[i] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-25 15:16:26 -07:00
|
|
|
static void wipeStrings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2020-07-05 08:16:07 -07:00
|
|
|
wipeString(engineConfiguration->engineMake, sizeof(vehicle_info_t));
|
|
|
|
wipeString(engineConfiguration->engineCode, sizeof(vehicle_info_t));
|
|
|
|
wipeString(engineConfiguration->vehicleName, sizeof(vehicle_info_t));
|
|
|
|
|
|
|
|
for (int i = 0; i < FSIO_COMMAND_COUNT; i++) {
|
|
|
|
wipeString(config->fsioFormulas[i], sizeof(le_formula_t));
|
|
|
|
}
|
2020-07-05 10:34:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void onBurnRequest(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
|
|
wipeStrings(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2020-07-05 08:16:07 -07:00
|
|
|
|
2021-06-25 16:38:42 -07:00
|
|
|
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2020-07-05 08:16:07 -07:00
|
|
|
}
|
|
|
|
|
2016-09-13 17:03:14 -07:00
|
|
|
/**
|
|
|
|
* this is the top-level method which should be called in case of any changes to engine configuration
|
|
|
|
* online tuning of most values in the maps does not count as configuration change, but 'Burn' command does
|
2019-10-30 17:51:20 -07:00
|
|
|
*
|
|
|
|
* this method is NOT currently invoked on ECU start - actual user input has to happen!
|
2020-06-04 17:43:52 -07:00
|
|
|
* See preCalculate which is invoked BOTH on start and configuration change
|
2016-09-13 17:03:14 -07:00
|
|
|
*/
|
2017-05-15 20:28:49 -07:00
|
|
|
void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2019-04-15 18:37:54 -07:00
|
|
|
ENGINE(globalConfigurationVersion++);
|
2018-03-04 18:32:48 -08:00
|
|
|
#if EFI_DEFAILED_LOGGING
|
2021-04-19 05:11:59 -07:00
|
|
|
efiPrintf("set globalConfigurationVersion=%d", globalConfigurationVersion);
|
2018-03-04 18:32:48 -08:00
|
|
|
#endif /* EFI_DEFAILED_LOGGING */
|
2021-07-14 22:28:44 -07:00
|
|
|
|
|
|
|
applyNewHardwareSettings(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
|
|
|
2016-09-15 20:01:48 -07:00
|
|
|
/**
|
|
|
|
* All these callbacks could be implemented as listeners, but these days I am saving RAM
|
|
|
|
*/
|
2019-01-04 21:57:09 -08:00
|
|
|
engine->preCalculate(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_ALTERNATOR_CONTROL
|
2016-09-15 20:01:48 -07:00
|
|
|
onConfigurationChangeAlternatorCallback(&activeConfiguration);
|
2017-03-20 19:22:06 -07:00
|
|
|
#endif /* EFI_ALTERNATOR_CONTROL */
|
2020-02-02 00:56:21 -08:00
|
|
|
|
|
|
|
#if EFI_BOOST_CONTROL
|
|
|
|
onConfigurationChangeBoostCallback(&activeConfiguration);
|
|
|
|
#endif
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
2017-05-27 20:01:41 -07:00
|
|
|
onConfigurationChangeElectronicThrottleCallback(&activeConfiguration);
|
|
|
|
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
|
|
|
|
|
2019-08-29 20:50:20 -07:00
|
|
|
#if EFI_IDLE_CONTROL && ! EFI_UNIT_TEST
|
2017-05-28 10:44:26 -07:00
|
|
|
onConfigurationChangeIdleCallback(&activeConfiguration);
|
|
|
|
#endif /* EFI_IDLE_CONTROL */
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_SHAFT_POSITION_INPUT
|
2019-10-21 20:47:40 -07:00
|
|
|
onConfigurationChangeTriggerCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2017-06-26 11:31:10 -07:00
|
|
|
#endif /* EFI_SHAFT_POSITION_INPUT */
|
2021-06-25 08:50:23 -07:00
|
|
|
#if EFI_EMULATE_POSITION_SENSORS && ! EFI_UNIT_TEST
|
2017-12-17 12:41:58 -08:00
|
|
|
onConfigurationChangeRpmEmulatorCallback(&activeConfiguration);
|
|
|
|
#endif /* EFI_EMULATE_POSITION_SENSORS */
|
2018-02-03 08:42:50 -08:00
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_FSIO
|
2018-02-03 08:42:50 -08:00
|
|
|
onConfigurationChangeFsioCallback(&activeConfiguration PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-03-29 07:46:16 -07:00
|
|
|
#endif /* EFI_FSIO */
|
2018-03-04 18:32:48 -08:00
|
|
|
rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sets the same dwell time across the whole getRpm() range
|
2019-11-05 20:17:44 -08:00
|
|
|
* set dwell X
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
2019-05-03 15:41:43 -07:00
|
|
|
void setConstantDwell(floatms_t dwellMs DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
2015-07-10 06:01:56 -07:00
|
|
|
for (int i = 0; i < DWELL_CURVE_SIZE; i++) {
|
2017-02-18 12:01:47 -08:00
|
|
|
engineConfiguration->sparkDwellRpmBins[i] = 1000 * i;
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
2021-06-03 11:40:19 -07:00
|
|
|
setArrayValues(engineConfiguration->sparkDwellValues, dwellMs);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
2021-05-04 07:03:41 -07:00
|
|
|
setTable(config->ignitionIatCorrTable, value);
|
2015-10-18 18:02:32 -07:00
|
|
|
}
|
|
|
|
|
2019-01-10 16:25:07 -08:00
|
|
|
void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(config->injPhaseLoadBins, minValue, maxValue, 1);
|
|
|
|
setLinearCurve(config->veLoadBins, minValue, maxValue, 1);
|
2020-10-26 15:15:17 -07:00
|
|
|
setLinearCurve(config->lambdaLoadBins, minValue, maxValue, 1);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
void setWholeIatCorrTimingTable(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
2021-05-09 11:37:16 -07:00
|
|
|
setTable(config->ignitionIatCorrTable, value);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See also crankingTimingAngle
|
|
|
|
*/
|
2019-01-10 18:10:46 -08:00
|
|
|
void setWholeTimingTable_d(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
2021-05-09 11:37:16 -07:00
|
|
|
setTable(config->ignitionTable, value);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2017-06-11 12:13:03 -07:00
|
|
|
static void initTemperatureCurve(float *bins, float *values, int size, float defaultValue) {
|
2015-07-10 06:01:56 -07:00
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
bins[i] = -40 + i * 10;
|
2016-02-15 16:02:15 -08:00
|
|
|
values[i] = defaultValue; // this correction is a multiplier
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-04 14:53:52 -08:00
|
|
|
void prepareVoidConfiguration(engine_configuration_s *engineConfiguration) {
|
2019-01-04 21:11:17 -08:00
|
|
|
efiAssertVoid(OBD_PCM_Processor_Fault, engineConfiguration != NULL, "ec NULL");
|
2021-05-20 17:00:32 -07:00
|
|
|
efi::clear(engineConfiguration);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->clutchDownPinMode = PI_PULLUP;
|
2019-11-30 07:24:37 -08:00
|
|
|
engineConfiguration->clutchUpPinMode = PI_PULLUP;
|
2017-05-15 01:53:04 -07:00
|
|
|
engineConfiguration->brakePedalPinMode = PI_PULLUP;
|
2015-12-02 17:10:06 -08:00
|
|
|
}
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-04-28 20:42:49 -07:00
|
|
|
void setDefaultBasePins(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-06-10 14:33:05 -07:00
|
|
|
#ifdef EFI_WARNING_PIN
|
|
|
|
engineConfiguration->warningLedPin = EFI_WARNING_PIN;
|
|
|
|
#else
|
|
|
|
engineConfiguration->warningLedPin = GPIOD_13; // orange LED on discovery
|
|
|
|
#endif
|
|
|
|
|
2019-04-16 07:27:34 -07:00
|
|
|
|
|
|
|
#ifdef EFI_COMMUNICATION_PIN
|
|
|
|
engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN;
|
|
|
|
#else
|
|
|
|
engineConfiguration->communicationLedPin = GPIOD_15; // blue LED on discovery
|
|
|
|
#endif
|
2019-06-10 14:33:05 -07:00
|
|
|
#ifdef EFI_RUNNING_PIN
|
|
|
|
engineConfiguration->runningLedPin = EFI_RUNNING_PIN;
|
|
|
|
#else
|
2019-04-16 07:27:34 -07:00
|
|
|
engineConfiguration->runningLedPin = GPIOD_12; // green LED on discovery
|
2019-06-10 14:33:05 -07:00
|
|
|
#endif
|
2019-04-16 07:27:34 -07:00
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_PROD_CODE
|
2017-12-24 10:45:03 -08:00
|
|
|
// call overrided board-specific serial configuration setup, if needed (for custom boards only)
|
|
|
|
// needed also by bootloader code
|
|
|
|
setPinConfigurationOverrides();
|
2019-04-21 11:00:19 -07:00
|
|
|
#endif /* EFI_PROD_CODE */
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-07-24 18:24:39 -07:00
|
|
|
// set UART pads configuration based on the board
|
2017-05-30 10:50:33 -07:00
|
|
|
// needed also by bootloader code
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->useSerialPort = true;
|
2017-05-30 10:50:33 -07:00
|
|
|
engineConfiguration->binarySerialTxPin = GPIOC_10;
|
|
|
|
engineConfiguration->binarySerialRxPin = GPIOC_11;
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;
|
2017-05-30 10:50:33 -07:00
|
|
|
engineConfiguration->uartConsoleSerialSpeed = 115200;
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_PROD_CODE
|
2017-05-30 10:50:33 -07:00
|
|
|
// call overrided board-specific serial configuration setup, if needed (for custom boards only)
|
|
|
|
setSerialConfigurationOverrides();
|
2019-04-21 11:00:19 -07:00
|
|
|
#endif /* EFI_PROD_CODE */
|
2017-05-30 10:50:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// needed also by bootloader code
|
2019-04-21 11:00:19 -07:00
|
|
|
// at the moment bootloader does NOT really need SD card, this is a step towards future bootloader SD card usage
|
2019-04-28 20:42:49 -07:00
|
|
|
void setDefaultSdCardParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->is_enabled_spi_3 = true;
|
2017-05-30 10:50:33 -07:00
|
|
|
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->sdCardCsPin = GPIOD_4;
|
|
|
|
engineConfiguration->isSdCardEnabled = true;
|
2017-05-30 10:50:33 -07:00
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_PROD_CODE
|
2017-05-30 10:50:33 -07:00
|
|
|
// call overrided board-specific SD card configuration setup, if needed (for custom boards only)
|
|
|
|
setSdCardConfigurationOverrides();
|
2019-04-21 11:00:19 -07:00
|
|
|
#endif /* EFI_PROD_CODE */
|
2017-05-30 10:50:33 -07:00
|
|
|
}
|
|
|
|
|
2019-01-10 16:25:07 -08:00
|
|
|
static void setDefaultWarmupIdleCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-06-13 06:05:22 -07:00
|
|
|
initTemperatureCurve(CLT_MANUAL_IDLE_CORRECTION, 1.0);
|
2017-05-11 15:58:13 -07:00
|
|
|
|
2017-05-11 19:58:06 -07:00
|
|
|
float baseIdle = 30;
|
|
|
|
|
2019-06-13 06:05:22 -07:00
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, -40, 1.5);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, -30, 1.5);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, -20, 40.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, -10, 40.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 0, 40.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 10, 40.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 20, 40.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 30, 40.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 40, 40.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 50, 37.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 60, 35.0 / baseIdle);
|
|
|
|
setCurveValue(CLT_MANUAL_IDLE_CORRECTION, 70, 33.0 / baseIdle);
|
2017-05-11 15:58:13 -07:00
|
|
|
}
|
|
|
|
|
2018-01-07 09:11:49 -08:00
|
|
|
/**
|
|
|
|
* see also setTargetRpmCurve()
|
|
|
|
*/
|
2017-05-15 20:28:49 -07:00
|
|
|
static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_RANGE_FROM, 140, 10);
|
2018-01-07 09:11:49 -08:00
|
|
|
|
2017-06-11 12:06:05 -07:00
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -20, 1300);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -10, 1200);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 0, 1150);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 10, 1100);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 20, 1050);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 30, 1000);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 40, 1000);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 50, 950);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 60, 950);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 70, 930);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 80, 900);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 90, 900);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 100, 1000);
|
|
|
|
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 110, 1100);
|
2017-05-11 16:03:31 -07:00
|
|
|
}
|
|
|
|
|
2021-09-25 16:37:30 -07:00
|
|
|
static void setDefaultFrankensoStepperIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->idle.stepperDirectionPin = GPIOE_10;
|
|
|
|
engineConfiguration->idle.stepperStepPin = GPIOE_12;
|
2017-05-11 16:03:31 -07:00
|
|
|
engineConfiguration->stepperEnablePin = GPIOE_14;
|
|
|
|
engineConfiguration->idleStepperReactionTime = 10;
|
|
|
|
engineConfiguration->idleStepperTotalSteps = 150;
|
|
|
|
}
|
|
|
|
|
2019-11-03 14:17:43 -08:00
|
|
|
static void setCanFrankensoDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->canTxPin = GPIOB_6;
|
|
|
|
engineConfiguration->canRxPin = GPIOB_12;
|
2017-05-11 16:07:15 -07:00
|
|
|
}
|
|
|
|
|
2018-01-07 09:11:49 -08:00
|
|
|
/**
|
|
|
|
* see also setDefaultIdleSpeedTarget()
|
|
|
|
*/
|
2019-05-03 15:41:43 -07:00
|
|
|
void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
2021-08-16 06:11:22 -07:00
|
|
|
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_RANGE_FROM, 140, 10);
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(engineConfiguration->cltIdleRpm, rpm, rpm, 10);
|
2017-12-24 19:05:16 -08:00
|
|
|
}
|
|
|
|
|
2020-04-26 11:06:28 -07:00
|
|
|
void setDefaultGppwmParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
|
|
// Same config for all channels
|
|
|
|
for (size_t i = 0; i < efi::size(CONFIG(gppwm)); i++) {
|
|
|
|
auto& cfg = CONFIG(gppwm)[i];
|
|
|
|
|
|
|
|
cfg.pin = GPIO_UNASSIGNED;
|
|
|
|
cfg.dutyIfError = 0;
|
|
|
|
cfg.onAboveDuty = 60;
|
|
|
|
cfg.offBelowDuty = 50;
|
|
|
|
cfg.pwmFrequency = 250;
|
|
|
|
|
|
|
|
for (size_t j = 0; j < efi::size(cfg.loadBins); j++) {
|
|
|
|
uint8_t z = j * 100 / (efi::size(cfg.loadBins) - 1);
|
|
|
|
cfg.loadBins[j] = z;
|
|
|
|
|
|
|
|
// Fill some values in the table
|
|
|
|
for (size_t k = 0; k < efi::size(cfg.rpmBins); k++) {
|
|
|
|
cfg.table[j][k] = z;
|
|
|
|
}
|
2020-09-07 12:55:43 -07:00
|
|
|
|
2020-04-26 11:06:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t j = 0; j < efi::size(cfg.rpmBins); j++) {
|
|
|
|
cfg.rpmBins[j] = 1000 * j / RPM_1_BYTE_PACKING_MULT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-09 14:07:38 -07:00
|
|
|
static void setDefaultEngineNoiseTable(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2021-03-30 07:56:25 -07:00
|
|
|
setRpmTableBin(engineConfiguration->knockNoiseRpmBins, ENGINE_NOISE_CURVE_SIZE);
|
|
|
|
|
2021-08-09 14:07:38 -07:00
|
|
|
engineConfiguration->knockSamplingDuration = 45;
|
|
|
|
|
2021-03-30 07:56:25 -07:00
|
|
|
engineConfiguration->knockNoise[0] = 2; // 800
|
|
|
|
engineConfiguration->knockNoise[1] = 2; // 1700
|
|
|
|
engineConfiguration->knockNoise[2] = 2; // 2600
|
|
|
|
engineConfiguration->knockNoise[3] = 2; // 3400
|
|
|
|
engineConfiguration->knockNoise[4] = 2; // 4300
|
|
|
|
engineConfiguration->knockNoise[5] = 2; // 5200
|
|
|
|
engineConfiguration->knockNoise[6] = 2; // 6100
|
|
|
|
engineConfiguration->knockNoise[7] = 2; // 7000
|
|
|
|
}
|
|
|
|
|
2021-04-03 20:34:56 -07:00
|
|
|
static void setHip9011FrankensoPinout(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2021-03-31 11:46:50 -07:00
|
|
|
/**
|
|
|
|
* SPI on PB13/14/15
|
|
|
|
*/
|
|
|
|
// CONFIG(hip9011CsPin) = GPIOD_0; // rev 0.1
|
|
|
|
|
|
|
|
CONFIG(isHip9011Enabled) = true;
|
|
|
|
engineConfiguration->hip9011PrescalerAndSDO = HIP_8MHZ_PRESCALER; // 8MHz chip
|
|
|
|
CONFIG(is_enabled_spi_2) = true;
|
|
|
|
// todo: convert this to rusEfi, hardware-independent enum
|
|
|
|
#if EFI_PROD_CODE
|
|
|
|
#ifdef EFI_HIP_CS_PIN
|
|
|
|
CONFIG(hip9011CsPin) = EFI_HIP_CS_PIN;
|
|
|
|
#else
|
|
|
|
CONFIG(hip9011CsPin) = GPIOB_0; // rev 0.4
|
|
|
|
#endif
|
|
|
|
CONFIG(hip9011CsPinMode) = OM_OPENDRAIN;
|
|
|
|
|
|
|
|
CONFIG(hip9011IntHoldPin) = GPIOB_11;
|
|
|
|
CONFIG(hip9011IntHoldPinMode) = OM_OPENDRAIN;
|
|
|
|
|
|
|
|
engineConfiguration->spi2SckMode = PO_OPENDRAIN; // 4
|
|
|
|
engineConfiguration->spi2MosiMode = PO_OPENDRAIN; // 4
|
|
|
|
engineConfiguration->spi2MisoMode = PO_PULLUP; // 32
|
|
|
|
#endif /* EFI_PROD_CODE */
|
|
|
|
|
|
|
|
engineConfiguration->hip9011Gain = 1;
|
|
|
|
|
|
|
|
if (!CONFIG(useTpicAdvancedMode)) {
|
|
|
|
engineConfiguration->hipOutputChannel = EFI_ADC_10; // PC0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @brief Global default engine configuration
|
2015-09-26 06:01:32 -07:00
|
|
|
* This method sets the global engine configuration defaults. These default values are then
|
|
|
|
* overridden by engine-specific defaults and the settings are saved in flash memory.
|
|
|
|
*
|
|
|
|
* This method is invoked only when new configuration is needed:
|
|
|
|
* * recently re-flashed chip
|
|
|
|
* * flash version of configuration failed CRC check or appears to be older then FLASH_DATA_VERSION
|
|
|
|
* * 'rewriteconfig' command
|
2017-01-06 07:04:41 -08:00
|
|
|
* * 'set engine_type X' command
|
2015-12-21 17:02:32 -08:00
|
|
|
*
|
|
|
|
* This method should only change the state of the configuration data structure but should NOT change the state of
|
|
|
|
* anything else.
|
2019-07-24 18:15:18 -07:00
|
|
|
*
|
|
|
|
* This method should NOT be setting any default pinout
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
2019-07-24 19:00:48 -07:00
|
|
|
static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2019-04-12 19:07:03 -07:00
|
|
|
#if (! EFI_UNIT_TEST)
|
2021-05-20 17:00:32 -07:00
|
|
|
efi::clear(persistentState.persistentConfiguration);
|
2015-07-10 06:01:56 -07:00
|
|
|
#endif
|
|
|
|
prepareVoidConfiguration(engineConfiguration);
|
|
|
|
|
2021-06-02 14:50:07 -07:00
|
|
|
setDefaultBaseEngine(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
setDefaultFuel(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2021-06-03 11:40:19 -07:00
|
|
|
setDefaultIgnition(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
setDefaultCranking(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-07-24 18:15:18 -07:00
|
|
|
|
2021-10-29 09:16:19 -07:00
|
|
|
// VVT closed loop, totally random values!
|
|
|
|
engineConfiguration->auxPid[0].pFactor = 2;
|
|
|
|
engineConfiguration->auxPid[0].iFactor = 0.005;
|
|
|
|
engineConfiguration->auxPid[0].dFactor = 0;
|
|
|
|
engineConfiguration->auxPid[0].offset = 33;
|
|
|
|
engineConfiguration->auxPid[0].minValue = 10;
|
|
|
|
engineConfiguration->auxPid[0].maxValue = 90;
|
|
|
|
|
2021-10-31 12:25:43 -07:00
|
|
|
engineConfiguration->vvtOutputFrequency[0] = 300; // VVT solenoid control
|
2021-10-29 09:16:19 -07:00
|
|
|
|
|
|
|
engineConfiguration->auxPid[1].minValue = 10;
|
|
|
|
engineConfiguration->auxPid[2].maxValue = 90;
|
|
|
|
|
2021-11-04 16:35:58 -07:00
|
|
|
engineConfiguration->turboSpeedSensorMultiplier = 1;
|
2021-10-29 09:16:19 -07:00
|
|
|
|
2019-08-29 20:50:20 -07:00
|
|
|
#if EFI_IDLE_CONTROL
|
|
|
|
setDefaultIdleParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
#endif /* EFI_IDLE_CONTROL */
|
|
|
|
|
2019-07-24 18:15:18 -07:00
|
|
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
2019-09-21 21:16:46 -07:00
|
|
|
setDefaultEtbParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
setDefaultEtbBiasCurve(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-07-24 18:15:18 -07:00
|
|
|
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
|
2020-02-02 00:56:21 -08:00
|
|
|
#if EFI_BOOST_CONTROL
|
|
|
|
setDefaultBoostParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
#endif
|
2019-07-24 18:15:18 -07:00
|
|
|
|
2020-09-01 19:24:25 -07:00
|
|
|
// OBD-II default rate is 500kbps
|
|
|
|
CONFIG(canBaudRate) = B500KBPS;
|
|
|
|
|
2019-11-30 07:24:37 -08:00
|
|
|
CONFIG(mafSensorType) = Bosch0280218037;
|
2015-07-10 06:01:56 -07:00
|
|
|
setBosch0280218037(config);
|
|
|
|
|
2019-07-24 18:24:39 -07:00
|
|
|
engineConfiguration->canSleepPeriodMs = 50;
|
|
|
|
engineConfiguration->canReadEnabled = true;
|
|
|
|
engineConfiguration->canWriteEnabled = true;
|
|
|
|
|
2020-03-19 06:22:16 -07:00
|
|
|
// Don't enable, but set default address
|
2020-03-29 18:15:06 -07:00
|
|
|
engineConfiguration->verboseCanBaseAddress = CAN_DEFAULT_BASE;
|
2020-03-19 06:22:16 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->sdCardPeriodMs = 50;
|
2019-09-20 17:18:22 -07:00
|
|
|
|
2017-08-06 16:47:16 -07:00
|
|
|
for (int i = 0; i < FSIO_COMMAND_COUNT; i++) {
|
|
|
|
config->fsioFormulas[i][0] = 0;
|
|
|
|
}
|
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
CONFIG(mapMinBufferLength) = 1;
|
2021-06-02 14:50:07 -07:00
|
|
|
|
2020-11-25 14:02:28 -08:00
|
|
|
CONFIG(startCrankingDuration) = 3;
|
2020-03-24 21:58:59 -07:00
|
|
|
|
2017-12-26 21:26:40 -08:00
|
|
|
engineConfiguration->idlePidRpmDeadZone = 50;
|
2017-07-15 12:36:49 -07:00
|
|
|
engineConfiguration->startOfCrankingPrimingPulse = 0;
|
|
|
|
|
2021-07-04 06:22:42 -07:00
|
|
|
engineConfiguration->maxAcRpm = 5000;
|
|
|
|
engineConfiguration->maxAcClt = 100;
|
|
|
|
engineConfiguration->maxAcTps = 75;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-06-11 12:17:02 -07:00
|
|
|
initTemperatureCurve(IAT_FUEL_CORRECTION_CURVE, 1);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-28 19:32:32 -07:00
|
|
|
engineConfiguration->auxPid[0].minValue = 10;
|
|
|
|
engineConfiguration->auxPid[0].maxValue = 90;
|
2017-04-10 11:59:21 -07:00
|
|
|
|
2017-05-28 19:32:32 -07:00
|
|
|
engineConfiguration->alternatorControl.minValue = 10;
|
|
|
|
engineConfiguration->alternatorControl.maxValue = 90;
|
2017-04-10 11:59:21 -07:00
|
|
|
|
2021-11-04 20:19:44 -07:00
|
|
|
setLinearCurve(engineConfiguration->scriptCurve1Bins, 0, 100, 1);
|
|
|
|
setLinearCurve(engineConfiguration->scriptCurve1, 0, 100, 1);
|
2017-11-27 18:49:58 -08:00
|
|
|
|
2021-11-04 20:19:44 -07:00
|
|
|
setLinearCurve(engineConfiguration->scriptCurve2Bins, 0, 100, 1);
|
|
|
|
setLinearCurve(engineConfiguration->scriptCurve2, 30, 170, 1);
|
2017-11-27 18:49:58 -08:00
|
|
|
|
2021-11-04 20:19:44 -07:00
|
|
|
setLinearCurve(engineConfiguration->scriptCurve3Bins, 0, 100, 1);
|
|
|
|
setLinearCurve(engineConfiguration->scriptCurve4Bins, 0, 100, 1);
|
2021-11-04 20:59:04 -07:00
|
|
|
setLinearCurve(engineConfiguration->scriptCurve5Bins, 0, 100, 1);
|
|
|
|
setLinearCurve(engineConfiguration->scriptCurve6Bins, 0, 100, 1);
|
2017-11-25 22:17:37 -08:00
|
|
|
|
2020-02-24 16:08:02 -08:00
|
|
|
#if EFI_ENGINE_CONTROL
|
2019-01-10 16:25:07 -08:00
|
|
|
setDefaultWarmupIdleCorrection(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2016-02-14 10:02:00 -08:00
|
|
|
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(engineConfiguration->map.samplingAngleBins, 800, 7000, 1);
|
|
|
|
setLinearCurve(engineConfiguration->map.samplingAngle, 100, 130, 1);
|
|
|
|
setLinearCurve(engineConfiguration->map.samplingWindowBins, 800, 7000, 1);
|
|
|
|
setLinearCurve(engineConfiguration->map.samplingWindow, 50, 50, 1);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2021-02-10 09:41:38 -08:00
|
|
|
setLinearCurve(config->vvtTable1LoadBins, 20, 120, 10);
|
|
|
|
setRpmTableBin(config->vvtTable1RpmBins, FSIO_TABLE_8);
|
|
|
|
setLinearCurve(config->vvtTable2LoadBins, 20, 120, 10);
|
|
|
|
setRpmTableBin(config->vvtTable2RpmBins, FSIO_TABLE_8);
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(config->fsioTable1LoadBins, 20, 120, 10);
|
2016-03-03 21:02:18 -08:00
|
|
|
setRpmTableBin(config->fsioTable1RpmBins, FSIO_TABLE_8);
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(config->fsioTable2LoadBins, 20, 120, 10);
|
2016-03-03 21:02:18 -08:00
|
|
|
setRpmTableBin(config->fsioTable2RpmBins, FSIO_TABLE_8);
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(config->fsioTable3LoadBins, 20, 120, 10);
|
2016-07-01 20:01:22 -07:00
|
|
|
setRpmTableBin(config->fsioTable3RpmBins, FSIO_TABLE_8);
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(config->fsioTable4LoadBins, 20, 120, 10);
|
2016-07-01 20:01:22 -07:00
|
|
|
setRpmTableBin(config->fsioTable4RpmBins, FSIO_TABLE_8);
|
2016-03-03 21:02:18 -08:00
|
|
|
|
2021-03-30 07:56:25 -07:00
|
|
|
setDefaultEngineNoiseTable(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2016-01-01 14:02:49 -08:00
|
|
|
|
2019-10-02 18:00:10 -07:00
|
|
|
engineConfiguration->clt.config = {0, 23.8889, 48.8889, 9500, 2100, 1000, 1500};
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
// todo: this value is way off! I am pretty sure temp coeffs are off also
|
2019-10-02 18:00:10 -07:00
|
|
|
engineConfiguration->iat.config = {32, 75, 120, 9500, 2100, 1000, 2700};
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-02-02 07:44:31 -08:00
|
|
|
engineConfiguration->launchRpm = 3000;
|
|
|
|
engineConfiguration->launchTimingRetard = 10;
|
|
|
|
engineConfiguration->launchTimingRpmRange = 500;
|
|
|
|
engineConfiguration->launchSparkCutEnable = false;
|
|
|
|
engineConfiguration->launchFuelCutEnable = false;
|
|
|
|
engineConfiguration->hardCutRpmRange = 500;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2016-05-23 12:02:46 -07:00
|
|
|
engineConfiguration->slowAdcAlpha = 0.33333;
|
2016-01-30 19:03:36 -08:00
|
|
|
engineConfiguration->engineSnifferRpmThreshold = 2500;
|
|
|
|
engineConfiguration->sensorSnifferRpmThreshold = 2500;
|
2016-07-01 07:02:58 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->noAccelAfterHardLimitPeriodSecs = 3;
|
|
|
|
|
2018-01-07 09:11:49 -08:00
|
|
|
/**
|
|
|
|
* Idle control defaults
|
|
|
|
*/
|
|
|
|
setDefaultIdleSpeedTarget(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
|
|
// setTargetRpmCurve(1200 PASS_ENGINE_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-06-04 17:13:37 -07:00
|
|
|
engineConfiguration->idleRpmPid.pFactor = 0.05;
|
|
|
|
engineConfiguration->idleRpmPid.iFactor = 0.002;
|
|
|
|
|
2020-12-08 10:59:40 -08:00
|
|
|
engineConfiguration->idleRpmPid.minValue = 0;
|
2019-02-26 18:50:58 -08:00
|
|
|
engineConfiguration->idleRpmPid.maxValue = 99;
|
2021-07-24 08:56:29 -07:00
|
|
|
/**
|
|
|
|
* between variation between different sensor and weather and fabrication tolerance
|
|
|
|
* five percent looks like a safer default
|
|
|
|
*/
|
|
|
|
engineConfiguration->idlePidDeactivationTpsThreshold = 5;
|
2017-05-28 10:44:26 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->idle.solenoidFrequency = 200;
|
2018-01-07 09:11:49 -08:00
|
|
|
// set idle_position 50
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->manIdlePosition = 50;
|
2018-01-07 09:11:49 -08:00
|
|
|
// engineConfiguration->idleMode = IM_AUTO;
|
|
|
|
engineConfiguration->idleMode = IM_MANUAL;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->useStepperIdle = false;
|
2018-01-07 09:11:49 -08:00
|
|
|
|
2020-04-26 11:06:28 -07:00
|
|
|
setDefaultGppwmParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
|
|
|
2019-06-17 09:18:55 -07:00
|
|
|
#if !EFI_UNIT_TEST
|
2018-01-07 09:11:49 -08:00
|
|
|
engineConfiguration->analogInputDividerCoefficient = 2;
|
2019-06-17 09:18:55 -07:00
|
|
|
#endif
|
2018-01-07 09:11:49 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
// performance optimization
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->sensorChartMode = SC_OFF;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
|
2016-08-28 13:02:34 -07:00
|
|
|
engineConfiguration->extraInjectionOffset = 0;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-05-10 13:13:15 -07:00
|
|
|
engineConfiguration->tpsMin = convertVoltageTo10bitADC(0);
|
|
|
|
engineConfiguration->tpsMax = convertVoltageTo10bitADC(5);
|
|
|
|
engineConfiguration->tps1SecondaryMin = convertVoltageTo10bitADC(0);
|
|
|
|
engineConfiguration->tps1SecondaryMax = convertVoltageTo10bitADC(5);
|
|
|
|
engineConfiguration->tps2Min = convertVoltageTo10bitADC(0);
|
|
|
|
engineConfiguration->tps2Max = convertVoltageTo10bitADC(5);
|
|
|
|
engineConfiguration->tps2SecondaryMin = convertVoltageTo10bitADC(0);
|
|
|
|
engineConfiguration->tps2SecondaryMax = convertVoltageTo10bitADC(5);
|
2020-11-14 15:05:27 -08:00
|
|
|
engineConfiguration->idlePositionMin = PACK_MULT_VOLTAGE * 0;
|
|
|
|
engineConfiguration->idlePositionMax = PACK_MULT_VOLTAGE * 5;
|
|
|
|
engineConfiguration->wastegatePositionMin = PACK_MULT_VOLTAGE * 0;
|
|
|
|
engineConfiguration->wastegatePositionMax = PACK_MULT_VOLTAGE * 5;
|
2016-01-08 08:01:40 -08:00
|
|
|
engineConfiguration->tpsErrorDetectionTooLow = -10; // -10% open
|
|
|
|
engineConfiguration->tpsErrorDetectionTooHigh = 110; // 110% open
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-11-15 11:30:13 -08:00
|
|
|
engineConfiguration->oilPressure.v1 = 0.5f;
|
|
|
|
engineConfiguration->oilPressure.v2 = 4.5f;
|
|
|
|
engineConfiguration->oilPressure.value1 = 0;
|
|
|
|
engineConfiguration->oilPressure.value2 = 689.476f; // 100psi = 689.476kPa
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2016-06-25 13:02:01 -07:00
|
|
|
engineConfiguration->mapLowValueVoltage = 0;
|
|
|
|
// todo: start using this for custom MAP
|
|
|
|
engineConfiguration->mapHighValueVoltage = 5;
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->logFormat = LF_NATIVE;
|
|
|
|
|
|
|
|
engineConfiguration->HD44780width = 20;
|
|
|
|
engineConfiguration->HD44780height = 4;
|
|
|
|
|
|
|
|
engineConfiguration->cylinderBore = 87.5;
|
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
setEgoSensor(ES_14Point7_Free PASS_CONFIG_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
engineConfiguration->globalFuelCorrection = 1;
|
2017-06-12 05:41:32 -07:00
|
|
|
engineConfiguration->adcVcc = 3.0;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
engineConfiguration->map.sensor.type = MT_MPX4250;
|
|
|
|
|
|
|
|
engineConfiguration->baroSensor.type = MT_CUSTOM;
|
2016-06-25 16:03:02 -07:00
|
|
|
engineConfiguration->baroSensor.lowValue = 0;
|
|
|
|
engineConfiguration->baroSensor.highValue = 500;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
engineConfiguration->isEngineChartEnabled = true;
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_PROD_CODE
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->engineChartSize = 300;
|
|
|
|
#else
|
|
|
|
// need more events for automated test
|
|
|
|
engineConfiguration->engineChartSize = 400;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
engineConfiguration->primingSquirtDurationMs = 5;
|
|
|
|
|
|
|
|
engineConfiguration->isMapAveragingEnabled = true;
|
|
|
|
engineConfiguration->isWaveAnalyzerEnabled = true;
|
|
|
|
|
2017-02-12 18:04:18 -08:00
|
|
|
engineConfiguration->debugMode = DBG_ALTERNATOR_PID;
|
2016-02-04 20:02:52 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->acIdleRpmBump = 200;
|
2021-05-08 15:43:55 -07:00
|
|
|
|
|
|
|
/* these two are used for HIP9011 only
|
|
|
|
* Currently this is offset from fire event, not TDC */
|
|
|
|
/* TODO: convert to offset from TDC */
|
|
|
|
engineConfiguration->knockDetectionWindowStart = 15.0 + 5.0;
|
|
|
|
engineConfiguration->knockDetectionWindowEnd = 15.0 + 45.0;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* this is RPM. 10000 rpm is only 166Hz, 800 rpm is 13Hz
|
|
|
|
*/
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->triggerSimulatorFrequency = 1200;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2016-07-02 15:02:12 -07:00
|
|
|
engineConfiguration->alternatorPwmFrequency = 300;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
strcpy(config->timingMultiplier, "1");
|
|
|
|
strcpy(config->timingAdditive, "0");
|
|
|
|
|
2018-08-08 17:56:11 -07:00
|
|
|
engineConfiguration->cj125isUaDivided = true;
|
|
|
|
|
2019-08-01 19:27:23 -07:00
|
|
|
engineConfiguration->isAlternatorControlEnabled = false;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
engineConfiguration->vehicleSpeedCoef = 1.0f;
|
|
|
|
|
|
|
|
|
2016-01-08 08:01:40 -08:00
|
|
|
engineConfiguration->mapErrorDetectionTooLow = 5;
|
|
|
|
engineConfiguration->mapErrorDetectionTooHigh = 250;
|
2015-08-30 13:02:00 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->useLcdScreen = true;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-01-04 14:18:43 -08:00
|
|
|
engineConfiguration->hip9011Gain = 1;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->isEngineControlEnabled = true;
|
2020-02-24 16:08:02 -08:00
|
|
|
#endif // EFI_ENGINE_CONTROL
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_FSIO
|
2017-12-17 09:02:35 -08:00
|
|
|
/**
|
|
|
|
* to test:
|
|
|
|
* set_fsio_setting 1 5000
|
|
|
|
* set_fsio_output_pin 1 PE3
|
|
|
|
* set debug_mode 23
|
|
|
|
* writeconfig
|
|
|
|
* <reboot ECU>
|
|
|
|
* fsioinfo
|
|
|
|
*/
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->fsio_setting[0] = 5000;
|
2017-12-17 09:02:35 -08:00
|
|
|
// simple warning light as default configuration
|
|
|
|
// set_fsio_expression 1 "rpm > fsio_setting(1)"
|
2019-05-03 15:41:43 -07:00
|
|
|
setFsio(0, GPIO_UNASSIGNED, RPM_ABOVE_USER_SETTING_1 PASS_CONFIG_PARAMETER_SUFFIX);
|
2019-03-29 07:46:16 -07:00
|
|
|
#endif /* EFI_FSIO */
|
2021-05-18 10:58:39 -07:00
|
|
|
|
|
|
|
strncpy(config->luaScript, "function onTick()\nend", efi::size(config->luaScript));
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2019-04-16 07:27:34 -07:00
|
|
|
/**
|
|
|
|
* @brief Hardware board-specific default configuration (GPIO pins, ADC channels, SPI configs etc.)
|
|
|
|
*/
|
2019-11-03 14:17:43 -08:00
|
|
|
void setDefaultFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2021-09-25 16:37:30 -07:00
|
|
|
setDefaultFrankensoStepperIdleParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-11-03 14:17:43 -08:00
|
|
|
setCanFrankensoDefaults(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-04-16 07:27:34 -07:00
|
|
|
|
|
|
|
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
|
|
|
|
engineConfiguration->clt.adcChannel = EFI_ADC_6;
|
|
|
|
engineConfiguration->iat.adcChannel = EFI_ADC_7;
|
|
|
|
engineConfiguration->afr.hwChannel = EFI_ADC_14;
|
|
|
|
|
|
|
|
engineConfiguration->accelerometerSpiDevice = SPI_DEVICE_1;
|
|
|
|
engineConfiguration->hip9011SpiDevice = SPI_DEVICE_2;
|
|
|
|
engineConfiguration->cj125SpiDevice = SPI_DEVICE_2;
|
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
// engineConfiguration->gps_rx_pin = GPIOB_7;
|
|
|
|
// engineConfiguration->gps_tx_pin = GPIOB_6;
|
2019-04-16 07:27:34 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->triggerSimulatorPins[0] = GPIOD_1;
|
|
|
|
engineConfiguration->triggerSimulatorPins[1] = GPIOD_2;
|
2019-04-16 07:27:34 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->triggerInputPins[0] = GPIOC_6;
|
|
|
|
engineConfiguration->triggerInputPins[1] = GPIOA_5;
|
2019-04-16 07:27:34 -07:00
|
|
|
|
|
|
|
// set this to SPI_DEVICE_3 to enable stimulation
|
2019-12-11 14:48:55 -08:00
|
|
|
//engineConfiguration->digitalPotentiometerSpiDevice = SPI_DEVICE_3;
|
|
|
|
engineConfiguration->digitalPotentiometerChipSelect[0] = GPIOD_7;
|
|
|
|
engineConfiguration->digitalPotentiometerChipSelect[1] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->digitalPotentiometerChipSelect[2] = GPIOD_5;
|
|
|
|
engineConfiguration->digitalPotentiometerChipSelect[3] = GPIO_UNASSIGNED;
|
|
|
|
|
|
|
|
engineConfiguration->spi1mosiPin = GPIOB_5;
|
|
|
|
engineConfiguration->spi1misoPin = GPIOB_4;
|
|
|
|
engineConfiguration->spi1sckPin = GPIOB_3; // please note that this pin is also SWO/SWD - Single Wire debug Output
|
|
|
|
|
|
|
|
engineConfiguration->spi2mosiPin = GPIOB_15;
|
|
|
|
engineConfiguration->spi2misoPin = GPIOB_14;
|
|
|
|
engineConfiguration->spi2sckPin = GPIOB_13;
|
|
|
|
|
|
|
|
engineConfiguration->spi3mosiPin = GPIOB_5;
|
|
|
|
engineConfiguration->spi3misoPin = GPIOB_4;
|
|
|
|
engineConfiguration->spi3sckPin = GPIOB_3;
|
2019-04-16 07:27:34 -07:00
|
|
|
|
|
|
|
// set optional subsystem configs
|
|
|
|
#if EFI_MEMS
|
|
|
|
// this would override some values from above
|
2019-11-03 14:17:43 -08:00
|
|
|
configureAccelerometerPins(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-04-16 07:27:34 -07:00
|
|
|
#endif /* EFI_MEMS */
|
|
|
|
|
|
|
|
#if EFI_HIP_9011
|
2021-04-03 20:34:56 -07:00
|
|
|
setHip9011FrankensoPinout(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-04-16 07:27:34 -07:00
|
|
|
#endif /* EFI_HIP_9011 */
|
|
|
|
|
|
|
|
#if EFI_FILE_LOGGING
|
2019-11-03 14:17:43 -08:00
|
|
|
setDefaultSdCardParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-04-16 07:27:34 -07:00
|
|
|
#endif /* EFI_FILE_LOGGING */
|
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->is_enabled_spi_1 = false;
|
|
|
|
engineConfiguration->is_enabled_spi_2 = false;
|
|
|
|
engineConfiguration->is_enabled_spi_3 = true;
|
2019-04-16 07:27:34 -07:00
|
|
|
}
|
|
|
|
|
2021-03-25 15:16:26 -07:00
|
|
|
#ifdef CONFIG_RESET_SWITCH_PORT
|
|
|
|
// this pin is not configurable at runtime so that we have a reliable way to reset configuration
|
|
|
|
#define SHOULD_IGNORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
|
|
|
|
#else
|
|
|
|
#define SHOULD_IGNORE_FLASH() (false)
|
|
|
|
#endif // CONFIG_RESET_SWITCH_PORT
|
|
|
|
|
|
|
|
// by default, do not ignore config from flash! use it!
|
|
|
|
#ifndef IGNORE_FLASH_CONFIGURATION
|
|
|
|
#define IGNORE_FLASH_CONFIGURATION false
|
|
|
|
#endif
|
|
|
|
|
2021-04-21 11:28:48 -07:00
|
|
|
void loadConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2021-03-25 15:16:26 -07:00
|
|
|
#ifdef CONFIG_RESET_SWITCH_PORT
|
|
|
|
// initialize the reset pin if necessary
|
|
|
|
palSetPadMode(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN, PAL_MODE_INPUT_PULLUP);
|
|
|
|
#endif /* CONFIG_RESET_SWITCH_PORT */
|
|
|
|
|
2021-03-30 04:28:22 -07:00
|
|
|
#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
|
|
|
|
// Clear the active configuration so that registered output pins (etc) detect the change on startup and init properly
|
|
|
|
prepareVoidConfiguration(&activeConfiguration);
|
|
|
|
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
|
|
|
|
|
2021-03-25 15:16:26 -07:00
|
|
|
#if EFI_INTERNAL_FLASH
|
|
|
|
if (SHOULD_IGNORE_FLASH() || IGNORE_FLASH_CONFIGURATION) {
|
|
|
|
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
2021-04-21 11:28:48 -07:00
|
|
|
resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
2021-03-25 15:16:26 -07:00
|
|
|
writeToFlashNow();
|
|
|
|
} else {
|
|
|
|
// this call reads configuration from flash memory or sets default configuration
|
|
|
|
// if flash state does not look right.
|
|
|
|
readFromFlash();
|
|
|
|
}
|
|
|
|
#else // not EFI_INTERNAL_FLASH
|
|
|
|
// This board doesn't load configuration, initialize the default
|
|
|
|
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
2021-04-21 11:28:48 -07:00
|
|
|
resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
2021-03-25 15:16:26 -07:00
|
|
|
#endif /* EFI_INTERNAL_FLASH */
|
2021-03-31 11:46:50 -07:00
|
|
|
|
|
|
|
// Force any board configuration options that humans shouldn't be able to change
|
|
|
|
setBoardConfigOverrides();
|
2021-03-25 15:16:26 -07:00
|
|
|
}
|
|
|
|
|
2021-04-21 11:28:48 -07:00
|
|
|
void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
2016-11-03 14:03:11 -07:00
|
|
|
enginePins.reset(); // that's mostly important for functional tests
|
2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* Let's apply global defaults first
|
|
|
|
*/
|
2019-07-24 19:00:48 -07:00
|
|
|
setDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
|
|
|
|
|
|
|
// set initial pin groups
|
|
|
|
setDefaultBasePins(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
|
2020-09-21 09:29:01 -07:00
|
|
|
if (boardCallback != nullptr) {
|
|
|
|
boardCallback(engineConfiguration);
|
|
|
|
}
|
2019-08-08 18:27:57 -07:00
|
|
|
|
2019-04-16 07:27:34 -07:00
|
|
|
#if EFI_PROD_CODE
|
|
|
|
// call overrided board-specific configuration setup, if needed (for custom boards only)
|
2021-03-22 11:15:09 -07:00
|
|
|
setBoardDefaultConfiguration();
|
2021-03-31 11:46:50 -07:00
|
|
|
setBoardConfigOverrides();
|
2019-04-16 07:27:34 -07:00
|
|
|
#endif
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->engineType = engineType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* And override them with engine-specific defaults
|
|
|
|
*/
|
|
|
|
switch (engineType) {
|
2020-02-24 16:08:02 -08:00
|
|
|
case MICRO_RUS_EFI:
|
|
|
|
// todo: is it time to replace MICRO_RUS_EFI, PROTEUS, PROMETHEUS_DEFAULTS with MINIMAL_PINS? maybe rename MINIMAL_PINS to DEFAULT?
|
2020-12-22 07:13:27 -08:00
|
|
|
case PROTEUS_DEFAULTS:
|
2020-02-24 16:08:02 -08:00
|
|
|
case PROMETHEUS_DEFAULTS:
|
|
|
|
case MINIMAL_PINS:
|
|
|
|
// all basic settings are already set in prepareVoidConfiguration(), no need to set anything here
|
2021-03-22 11:15:09 -07:00
|
|
|
// nothing to do - we do it all in setBoardDefaultConfiguration
|
2020-02-24 16:08:02 -08:00
|
|
|
break;
|
2020-08-25 12:50:50 -07:00
|
|
|
case TEST_ENGINE:
|
|
|
|
setTestEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-02-24 16:08:02 -08:00
|
|
|
#if EFI_UNIT_TEST
|
|
|
|
case TEST_ISSUE_366_BOTH:
|
|
|
|
setTestEngineIssue366both(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case TEST_ISSUE_366_RISE:
|
|
|
|
setTestEngineIssue366rise(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-12-18 06:01:18 -08:00
|
|
|
case TEST_ISSUE_898:
|
2020-02-24 16:08:02 -08:00
|
|
|
setIssue898(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
#endif // EFI_UNIT_TEST
|
2020-12-22 18:54:40 -08:00
|
|
|
#if HW_MICRO_RUSEFI
|
|
|
|
case MRE_M111:
|
|
|
|
setM111EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2021-10-26 18:05:38 -07:00
|
|
|
case MRE_SECONDARY_CAN:
|
2021-10-27 16:54:45 -07:00
|
|
|
mreSecondaryCan(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-26 18:24:16 -07:00
|
|
|
case UNUSED101:
|
2020-12-22 18:54:40 -08:00
|
|
|
case MRE_SUBARU_EJ18:
|
|
|
|
setSubaruEJ18_MRE(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2020-02-18 14:53:56 -08:00
|
|
|
break;
|
2021-10-26 18:24:16 -07:00
|
|
|
case UNUSED30:
|
2020-12-22 18:54:40 -08:00
|
|
|
case MRE_BOARD_NEW_TEST:
|
|
|
|
mreBoardNewTest(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-11-14 20:58:04 -08:00
|
|
|
break;
|
2020-03-11 17:48:09 -07:00
|
|
|
case BMW_M73_MRE:
|
2020-03-29 19:10:13 -07:00
|
|
|
case BMW_M73_MRE_SLAVE:
|
2020-03-11 21:16:32 -07:00
|
|
|
setEngineBMW_M73_microRusEfi(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-07-29 12:51:01 -07:00
|
|
|
case MRE_MIATA_NA6_VAF:
|
2019-08-06 14:59:02 -07:00
|
|
|
setMiataNA6_VAF_MRE(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-11-28 19:49:28 -08:00
|
|
|
case MRE_MIATA_94_MAP:
|
|
|
|
setMiata94_MAP_MRE(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-07-29 18:38:34 -07:00
|
|
|
case MRE_MIATA_NA6_MAP:
|
|
|
|
setMiataNA6_MAP_MRE(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-05-21 17:44:14 -07:00
|
|
|
case MRE_MIATA_NB2_MAP:
|
|
|
|
setMiataNB2_MRE_MAP(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-12-15 19:21:49 -08:00
|
|
|
break;
|
2020-05-21 17:44:14 -07:00
|
|
|
case MRE_MIATA_NB2_MAF:
|
|
|
|
setMiataNB2_MRE_MAF(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case MRE_MIATA_NB2_ETB:
|
2019-12-15 19:21:49 -08:00
|
|
|
setMiataNB2_MRE_ETB(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-08-31 15:36:44 -07:00
|
|
|
break;
|
2020-08-29 07:06:14 -07:00
|
|
|
case MRE_BODY_CONTROL:
|
2020-08-29 11:29:34 -07:00
|
|
|
mreBCM(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-12-22 18:54:40 -08:00
|
|
|
#endif // HW_MICRO_RUSEFI
|
|
|
|
#if HW_PROTEUS
|
|
|
|
case PROTEUS_QC_TEST_BOARD:
|
2020-12-26 07:41:33 -08:00
|
|
|
proteusBoardTest(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-24 10:10:38 -07:00
|
|
|
case PROTEUS_BMW_M73:
|
2020-12-22 18:54:40 -08:00
|
|
|
setEngineBMW_M73_Proteus(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case MIATA_PROTEUS_TCU:
|
|
|
|
setMiataNB2_Proteus_TCU(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-02 09:50:06 -07:00
|
|
|
case PROTEUS_HONDA_ELEMENT_2003:
|
|
|
|
setProteusHondaElement2003(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case PROTEUS_HONDA_OBD2A:
|
2021-10-12 15:24:45 -07:00
|
|
|
setProteusHondaOBD2A(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-02 09:50:06 -07:00
|
|
|
case PROTEUS_VAG_80_18T:
|
|
|
|
case PROTEUS_N73:
|
2020-12-22 18:54:40 -08:00
|
|
|
case PROTEUS_MIATA_NB2:
|
|
|
|
setMiataNB2_ProteusEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-02-03 11:34:48 -08:00
|
|
|
#ifdef HARDWARE_CI
|
|
|
|
case PROTEUS_ANALOG_PWM_TEST:
|
|
|
|
setProteusAnalogPwmTest(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
#endif // HARDWARE_CI
|
2020-12-22 18:54:40 -08:00
|
|
|
#endif // HW_PROTEUS
|
2020-12-31 22:10:28 -08:00
|
|
|
#if HW_HELLEN
|
2021-09-18 18:27:17 -07:00
|
|
|
case HELLEN_128_MERCEDES_4_CYL:
|
|
|
|
setHellenMercedes128_4_cyl(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-09-17 21:17:52 -07:00
|
|
|
case HELLEN_128_MERCEDES_6_CYL:
|
|
|
|
setHellenMercedes128_6_cyl(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case HELLEN_128_MERCEDES_8_CYL:
|
|
|
|
setHellenMercedes128_8_cyl(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-12-31 22:10:28 -08:00
|
|
|
case HELLEN_NB2:
|
2021-01-21 23:02:16 -08:00
|
|
|
setMiataNB2_Hellen72(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2021-01-21 22:47:01 -08:00
|
|
|
break;
|
2021-08-09 23:34:59 -07:00
|
|
|
case HELLEN_NB2_36:
|
|
|
|
setMiataNB2_Hellen72_36(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-02 20:20:30 -07:00
|
|
|
case HELLEN_NB1:
|
|
|
|
setHellenNB1(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-04-10 20:30:36 -07:00
|
|
|
case HELLEN72_ETB:
|
|
|
|
setHellen72etb(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-08-08 04:04:18 -07:00
|
|
|
case HELLEN_121_NISSAN_4_CYL:
|
|
|
|
setHellen121nissanQR(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case HELLEN_121_NISSAN_6_CYL:
|
2021-08-08 03:15:37 -07:00
|
|
|
setHellen121nissanVQ(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2021-07-02 13:26:23 -07:00
|
|
|
break;
|
2021-07-08 13:35:58 -07:00
|
|
|
case HELLEN_121_VAG_5_CYL:
|
|
|
|
setHellen121Vag_5_cyl(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-07-08 17:42:35 -07:00
|
|
|
case HELLEN_121_VAG_V6_CYL:
|
|
|
|
setHellen121Vag_v6_cyl(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case HELLEN_121_VAG_VR6_CYL:
|
|
|
|
setHellen121Vag_vr6_cyl(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2021-07-08 13:35:58 -07:00
|
|
|
break;
|
|
|
|
case HELLEN_121_VAG_8_CYL:
|
|
|
|
setHellen121Vag_8_cyl(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-24 11:17:37 -07:00
|
|
|
case HELLEN_121_VAG_4_CYL:
|
2021-05-02 16:02:30 -07:00
|
|
|
case HELLEN_55_BMW:
|
|
|
|
case HELLEN_88_BMW:
|
|
|
|
case HELLEN_134_BMW:
|
|
|
|
case HELLEN_154_VAG:
|
2021-10-11 11:22:35 -07:00
|
|
|
break;
|
2021-10-11 09:37:24 -07:00
|
|
|
case HELLEN_154_HYUNDAI_COUPE_BK1:
|
2021-10-11 11:22:35 -07:00
|
|
|
setGenesisCoupeBK1(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-11 09:37:24 -07:00
|
|
|
case HELLEN_154_HYUNDAI_COUPE_BK2:
|
2021-10-11 11:22:35 -07:00
|
|
|
setGenesisCoupeBK2(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2021-07-08 22:53:09 -07:00
|
|
|
break;
|
2021-04-18 07:42:50 -07:00
|
|
|
case HELLEN_NA6:
|
|
|
|
setHellenNA6(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2021-08-24 13:01:49 -07:00
|
|
|
break;
|
|
|
|
case HELLEN_NA94:
|
|
|
|
setHellenNA94(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2021-04-18 07:42:50 -07:00
|
|
|
break;
|
2020-12-31 22:10:28 -08:00
|
|
|
#endif // HW_HELLEN
|
2020-12-22 18:54:40 -08:00
|
|
|
#if HW_FRANKENSO
|
|
|
|
case DEFAULT_FRANKENSO:
|
|
|
|
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case FRANKENSO_QA_ENGINE:
|
|
|
|
setFrankensoBoardTestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-24 06:31:32 -07:00
|
|
|
case FRANKENSO_BMW_M73_F:
|
2020-12-22 18:54:40 -08:00
|
|
|
setEngineBMW_M73_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case BMW_M73_M:
|
|
|
|
setEngineBMW_M73_Manhattan(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case DODGE_NEON_1995:
|
|
|
|
setDodgeNeon1995EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2016-09-21 10:02:42 -07:00
|
|
|
case DODGE_NEON_2003_CRANK:
|
2019-11-03 14:17:43 -08:00
|
|
|
setDodgeNeonNGCEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2016-09-21 10:02:42 -07:00
|
|
|
break;
|
2021-10-26 18:24:16 -07:00
|
|
|
case UNUSED39:
|
2015-07-10 06:01:56 -07:00
|
|
|
case FORD_ASPIRE_1996:
|
2019-05-03 15:41:43 -07:00
|
|
|
setFordAspireEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2020-11-26 18:21:25 -08:00
|
|
|
case NISSAN_PRIMERA:
|
|
|
|
setNissanPrimeraEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-10-24 06:16:11 -07:00
|
|
|
case FRANKENSO_MIATA_NA6_MAP:
|
2019-08-06 14:12:15 -07:00
|
|
|
setMiataNA6_MAP_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-01-19 17:27:14 -08:00
|
|
|
break;
|
2021-10-24 06:16:11 -07:00
|
|
|
case FRANKENSO_MIATA_NA6_VAF:
|
2019-08-06 14:12:15 -07:00
|
|
|
setMiataNA6_VAF_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2016-04-16 15:01:43 -07:00
|
|
|
break;
|
2019-02-27 05:55:56 -08:00
|
|
|
case ETB_BENCH_ENGINE:
|
2019-05-03 15:41:43 -07:00
|
|
|
setEtbTestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-02-27 05:55:56 -08:00
|
|
|
break;
|
2019-04-04 18:34:33 -07:00
|
|
|
case TLE8888_BENCH_ENGINE:
|
2019-05-03 15:41:43 -07:00
|
|
|
setTle8888TestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-04-04 18:34:33 -07:00
|
|
|
break;
|
2021-10-24 06:16:11 -07:00
|
|
|
case FRANKENSO_MAZDA_MIATA_NA8:
|
2019-05-03 15:41:43 -07:00
|
|
|
setMazdaMiataNA8Configuration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2018-09-06 19:31:23 -07:00
|
|
|
break;
|
2015-07-10 06:01:56 -07:00
|
|
|
case HONDA_ACCORD_CD_TWO_WIRES:
|
2019-05-03 15:41:43 -07:00
|
|
|
setHondaAccordConfiguration1_24(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
|
|
|
case HONDA_ACCORD_CD_DIP:
|
2021-10-20 07:45:43 -07:00
|
|
|
/*
|
2019-05-03 15:41:43 -07:00
|
|
|
setHondaAccordConfigurationDip(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2021-10-20 07:45:43 -07:00
|
|
|
*/
|
2015-07-10 06:01:56 -07:00
|
|
|
case MITSU_4G93:
|
2019-05-03 15:41:43 -07:00
|
|
|
setMitsubishiConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
|
|
|
case FORD_INLINE_6_1995:
|
2019-05-03 15:41:43 -07:00
|
|
|
setFordInline6(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
|
|
|
case GY6_139QMB:
|
2019-05-03 15:41:43 -07:00
|
|
|
setGy6139qmbDefaultEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2016-07-09 16:03:08 -07:00
|
|
|
case HONDA_600:
|
2019-05-03 15:41:43 -07:00
|
|
|
setHonda600(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2016-07-09 16:03:08 -07:00
|
|
|
break;
|
2021-11-06 15:42:55 -07:00
|
|
|
case UNUSED9:
|
2015-07-10 06:01:56 -07:00
|
|
|
case MAZDA_626:
|
2019-05-03 15:41:43 -07:00
|
|
|
setMazda626EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
|
|
|
case FORD_ESCORT_GT:
|
2019-05-03 15:41:43 -07:00
|
|
|
setFordEscortGt(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2021-11-06 15:42:55 -07:00
|
|
|
case UNUSED_19:
|
2015-07-10 06:01:56 -07:00
|
|
|
case MIATA_1996:
|
2021-11-04 06:56:05 -07:00
|
|
|
setFrankensteinMiata1996(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
|
|
|
case CITROEN_TU3JP:
|
2019-05-03 15:41:43 -07:00
|
|
|
setCitroenBerlingoTU3JPConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
|
|
|
case SUBARU_2003_WRX:
|
2019-05-03 15:41:43 -07:00
|
|
|
setSubaru2003Wrx(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
|
|
|
case DODGE_RAM:
|
2019-05-03 15:41:43 -07:00
|
|
|
setDodgeRam1996(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2020-08-29 07:06:14 -07:00
|
|
|
case VW_B6:
|
|
|
|
setVwPassatB6(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2015-07-10 06:01:56 -07:00
|
|
|
case VW_ABA:
|
2019-05-03 15:41:43 -07:00
|
|
|
setVwAba(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2021-10-24 06:31:32 -07:00
|
|
|
case FRANKENSO_MAZDA_MIATA_2003:
|
2019-05-03 15:41:43 -07:00
|
|
|
setMazdaMiata2003EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2016-10-04 12:02:36 -07:00
|
|
|
break;
|
2017-11-19 14:54:00 -08:00
|
|
|
case MAZDA_MIATA_2003_NA_RAIL:
|
2019-05-03 15:41:43 -07:00
|
|
|
setMazdaMiata2003EngineConfigurationNaFuelRail(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2017-04-17 19:10:19 -07:00
|
|
|
break;
|
2017-12-02 17:59:31 -08:00
|
|
|
case MAZDA_MIATA_2003_BOARD_TEST:
|
2019-05-03 15:41:43 -07:00
|
|
|
setMazdaMiata2003EngineConfigurationBoardTest(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2017-12-02 17:59:31 -08:00
|
|
|
break;
|
2016-08-20 18:03:09 -07:00
|
|
|
case TEST_ENGINE_VVT:
|
2019-05-03 15:41:43 -07:00
|
|
|
setTestVVTEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2016-08-20 18:03:09 -07:00
|
|
|
break;
|
2015-07-10 06:01:56 -07:00
|
|
|
case SACHS:
|
2019-05-03 15:41:43 -07:00
|
|
|
setSachs(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
break;
|
2015-10-16 13:01:21 -07:00
|
|
|
case CAMARO_4:
|
2019-05-03 15:41:43 -07:00
|
|
|
setCamaro4(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-10-16 13:01:21 -07:00
|
|
|
break;
|
2016-07-13 19:02:35 -07:00
|
|
|
case TOYOTA_2JZ_GTE_VVTi:
|
2019-05-03 15:41:43 -07:00
|
|
|
setToyota_2jz_vics(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2016-07-13 20:01:43 -07:00
|
|
|
break;
|
2015-12-30 13:02:18 -08:00
|
|
|
case TOYOTA_JZS147:
|
2019-05-03 15:41:43 -07:00
|
|
|
setToyota_jzs147EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-12-30 13:02:18 -08:00
|
|
|
break;
|
2020-04-08 20:14:21 -07:00
|
|
|
case VAG_18_TURBO:
|
|
|
|
vag_18_Turbo(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-02-25 18:35:21 -08:00
|
|
|
case TEST_33816:
|
|
|
|
setTest33816EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2021-09-25 23:21:21 -07:00
|
|
|
case TEST_108:
|
|
|
|
setVrThresholdTest(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
case TEST_109:
|
|
|
|
case TEST_110:
|
2021-07-21 16:55:14 -07:00
|
|
|
case TEST_ROTARY:
|
|
|
|
setRotary(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
2020-12-22 18:54:40 -08:00
|
|
|
#endif // HW_FRANKENSO
|
2021-02-06 10:50:34 -08:00
|
|
|
#ifdef HW_SUBARU_EG33
|
|
|
|
case SUBARUEG33_DEFAULTS:
|
|
|
|
setSubaruEG33Defaults(PASS_CONFIG_PARAMETER_SIGNATURE);
|
|
|
|
break;
|
|
|
|
#endif //HW_SUBARU_EG33
|
2015-07-10 06:01:56 -07:00
|
|
|
default:
|
2020-05-23 07:46:28 -07:00
|
|
|
firmwareError(CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", engineType);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
2021-04-21 11:28:48 -07:00
|
|
|
applyNonPersistentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#if EFI_TUNER_STUDIO
|
|
|
|
syncTunerStudioCopy();
|
2019-04-08 08:57:16 -07:00
|
|
|
#endif /* EFI_TUNER_STUDIO */
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2019-08-08 19:12:51 -07:00
|
|
|
void emptyCallbackWithConfiguration(engine_configuration_s * engineConfiguration) {
|
2019-11-05 17:07:55 -08:00
|
|
|
UNUSED(engineConfiguration);
|
2019-08-08 18:27:57 -07:00
|
|
|
}
|
|
|
|
|
2021-04-21 11:28:48 -07:00
|
|
|
void resetConfigurationExt(engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|
|
|
resetConfigurationExt(&emptyCallbackWithConfiguration, engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
2019-08-08 18:27:57 -07:00
|
|
|
}
|
|
|
|
|
2017-08-31 04:53:41 -07:00
|
|
|
void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
|
|
if (engineConfiguration->adcVcc > 5.0f || engineConfiguration->adcVcc < 1.0f) {
|
|
|
|
engineConfiguration->adcVcc = 3.0f;
|
|
|
|
}
|
2020-05-09 19:43:39 -07:00
|
|
|
engine->preCalculate(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2020-06-18 20:29:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* TunerStudio text tune files convert negative zero into positive zero so to keep things consistent we should avoid
|
|
|
|
* negative zeros altogether. Unfortunately default configuration had one and here we are mitigating that.
|
|
|
|
*/
|
|
|
|
for (int i = 0;i < CLT_CURVE_SIZE;i++) {
|
|
|
|
engineConfiguration->cltIdleRpmBins[i] = fixNegativeZero(engineConfiguration->cltIdleRpmBins[i]);
|
|
|
|
}
|
2017-08-31 04:53:41 -07:00
|
|
|
}
|
|
|
|
|
2021-04-21 11:28:48 -07:00
|
|
|
void applyNonPersistentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_PROD_CODE
|
2019-12-13 15:02:24 -08:00
|
|
|
efiAssertVoid(CUSTOM_APPLY_STACK, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "apply c");
|
2021-04-21 09:53:13 -07:00
|
|
|
efiPrintf("applyNonPersistentConfiguration()");
|
2018-02-03 08:42:50 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
assertEngineReference();
|
2018-02-03 17:43:31 -08:00
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_ENGINE_CONTROL
|
2021-04-21 11:28:48 -07:00
|
|
|
ENGINE(initializeTriggerWaveform(PASS_ENGINE_PARAMETER_SIGNATURE));
|
2020-05-22 15:07:19 -07:00
|
|
|
#endif // EFI_ENGINE_CONTROL
|
2018-02-03 08:42:50 -08:00
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_FSIO
|
2017-05-15 20:28:49 -07:00
|
|
|
applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2020-05-22 15:07:19 -07:00
|
|
|
#endif // EFI_FSIO
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if EFI_ENGINE_CONTROL
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
void prepareShapes(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
|
|
prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
engine->injectionEvents.addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void setOperationMode(engine_configuration_s *engineConfiguration, operation_mode_e mode) {
|
2019-08-07 21:32:31 -07:00
|
|
|
engineConfiguration->ambiguousOperationMode = mode;
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2019-01-09 21:56:08 -08:00
|
|
|
void commonFrankensoAnalogInputs(engine_configuration_s *engineConfiguration) {
|
2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* VBatt
|
|
|
|
*/
|
|
|
|
engineConfiguration->vbattAdcChannel = EFI_ADC_14;
|
|
|
|
}
|
|
|
|
|
2019-01-09 21:56:08 -08:00
|
|
|
void setFrankenso0_1_joystick(engine_configuration_s *engineConfiguration) {
|
2019-12-11 14:48:55 -08:00
|
|
|
|
|
|
|
engineConfiguration->joystickCenterPin = GPIOC_8;
|
|
|
|
engineConfiguration->joystickAPin = GPIOD_10;
|
|
|
|
engineConfiguration->joystickBPin = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->joystickCPin = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->joystickDPin = GPIOD_11;
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2021-03-31 11:46:50 -07:00
|
|
|
// These symbols are weak so that a board_configuration.cpp file can override them
|
|
|
|
__attribute__((weak)) void setBoardDefaultConfiguration(void) { }
|
|
|
|
__attribute__((weak)) void setBoardConfigOverrides(void) { }
|