auto-sync

This commit is contained in:
rusEfi 2014-09-11 22:02:56 -05:00
parent a79d32aeac
commit cf4c4019c2
4 changed files with 66 additions and 15 deletions

View File

@ -13,6 +13,7 @@
#include "mazda_miata.h" #include "mazda_miata.h"
#include "engine_math.h" #include "engine_math.h"
#include "advance_map.h" #include "advance_map.h"
#include "allsensors.h"
// setFrankenso_01_LCD // setFrankenso_01_LCD
#include "honda_accord.h" #include "honda_accord.h"
@ -102,6 +103,12 @@ static void commonMiataNa(engine_configuration_s *engineConfiguration, board_con
boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN; boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN; boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;
setCommonNTCSensor(&engineConfiguration->cltThermistorConf);
engineConfiguration->cltThermistorConf.bias_resistor = 2700;
setCommonNTCSensor(&engineConfiguration->iatThermistorConf);
engineConfiguration->iatThermistorConf.bias_resistor = 2700;
} }
static void common079721_2351(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) { static void common079721_2351(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
@ -311,6 +318,9 @@ void setMiata1996(engine_configuration_s *engineConfiguration, board_configurati
boardConfiguration->triggerInputPins[0] = GPIOA_5; boardConfiguration->triggerInputPins[0] = GPIOA_5;
boardConfiguration->triggerInputPins[1] = GPIOC_6; boardConfiguration->triggerInputPins[1] = GPIOC_6;
boardConfiguration->fuelPumpPin = GPIOE_4;
boardConfiguration->idleValvePin = GPIOE_5;
engineConfiguration->mafAdcChannel = EFI_ADC_1; engineConfiguration->mafAdcChannel = EFI_ADC_1;
engineConfiguration->cltAdcChannel = EFI_ADC_11; engineConfiguration->cltAdcChannel = EFI_ADC_11;

View File

@ -259,7 +259,9 @@ void initEngineContoller(void) {
initAlgo(engineConfiguration); initAlgo(engineConfiguration);
#if EFI_WAVE_ANALYZER #if EFI_WAVE_ANALYZER
if (engineConfiguration->isWaveAnalyzerEnabled) {
initWaveAnalyzer(); initWaveAnalyzer();
}
#endif /* EFI_WAVE_ANALYZER */ #endif /* EFI_WAVE_ANALYZER */
#if EFI_SHAFT_POSITION_INPUT #if EFI_SHAFT_POSITION_INPUT
@ -271,7 +273,9 @@ void initEngineContoller(void) {
#endif /* EFI_SHAFT_POSITION_INPUT */ #endif /* EFI_SHAFT_POSITION_INPUT */
#if EFI_TUNER_STUDIO #if EFI_TUNER_STUDIO
if (engineConfiguration->isTunerStudioEnabled) {
startTunerStudioConnectivity(); startTunerStudioConnectivity();
}
#endif #endif
// multiple issues with this initMapAdjusterThread(); // multiple issues with this initMapAdjusterThread();
@ -289,11 +293,15 @@ void initEngineContoller(void) {
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */ #endif /* EFI_ELECTRONIC_THROTTLE_BODY */
#if EFI_MALFUNCTION_INDICATOR #if EFI_MALFUNCTION_INDICATOR
if (engineConfiguration->isMilEnabled) {
initMalfunctionIndicator(); initMalfunctionIndicator();
}
#endif /* EFI_MALFUNCTION_INDICATOR */ #endif /* EFI_MALFUNCTION_INDICATOR */
#if EFI_MAP_AVERAGING #if EFI_MAP_AVERAGING
if (engineConfiguration->isMapAveragingEnabled) {
initMapAveraging(); initMapAveraging();
}
#endif /* EFI_MAP_AVERAGING */ #endif /* EFI_MAP_AVERAGING */
#if EFI_ENGINE_CONTROL #if EFI_ENGINE_CONTROL
@ -306,13 +314,17 @@ void initEngineContoller(void) {
#endif /* EFI_ENGINE_CONTROL */ #endif /* EFI_ENGINE_CONTROL */
#if EFI_IDLE_CONTROL #if EFI_IDLE_CONTROL
if (engineConfiguration->isIdleThreadEnabled) {
startIdleThread(); startIdleThread();
}
#else #else
scheduleMsg(&logger, "no idle control"); scheduleMsg(&logger, "no idle control");
#endif #endif
#if EFI_FUEL_PUMP #if EFI_FUEL_PUMP
if (engineConfiguration->isFuelPumpEnabled) {
initFuelPump(); initFuelPump();
}
#endif #endif
addConsoleAction("analoginfo", printAnalogInfo); addConsoleAction("analoginfo", printAnalogInfo);

View File

@ -11,7 +11,7 @@
#include "engine_configuration.h" #include "engine_configuration.h"
#define FLASH_DATA_VERSION 4615 #define FLASH_DATA_VERSION 4635
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"

View File

@ -120,11 +120,10 @@ void printConfiguration(engine_configuration_s *engineConfiguration, engine_conf
scheduleMsg(&logger, "analogInputDividerCoefficient: %f", engineConfiguration->analogInputDividerCoefficient); scheduleMsg(&logger, "analogInputDividerCoefficient: %f", engineConfiguration->analogInputDividerCoefficient);
#if EFI_PROD_CODE #if EFI_PROD_CODE
scheduleMsg(&logger, "idlePinMode: %s", pinModeToString(boardConfiguration->idleValvePinMode)); scheduleMsg(&logger, "idlePin: mode %s @ %s", pinModeToString(boardConfiguration->idleValvePinMode), hwPortname(boardConfiguration->idleValvePin));
scheduleMsg(&logger, "malfunctionIndicatorPinMode: %s", scheduleMsg(&logger, "malfunctionIndicatorPinMode: %s",
pinModeToString(boardConfiguration->malfunctionIndicatorPinMode)); pinModeToString(boardConfiguration->malfunctionIndicatorPinMode));
scheduleMsg(&logger, "idleValvePin: %s", hwPortname(boardConfiguration->idleValvePin));
scheduleMsg(&logger, "fuelPumpPin: mode %s @ %s", pinModeToString(boardConfiguration->fuelPumpPinMode), scheduleMsg(&logger, "fuelPumpPin: mode %s @ %s", pinModeToString(boardConfiguration->fuelPumpPinMode),
hwPortname(boardConfiguration->fuelPumpPin)); hwPortname(boardConfiguration->fuelPumpPin));
@ -201,11 +200,6 @@ static void setIgnitionPinMode(int value) {
doPrintConfiguration(); doPrintConfiguration();
} }
static void setIdlePin(int value) {
boardConfiguration->idleValvePin = (brain_pin_e) value;
doPrintConfiguration();
}
static void setIdlePinMode(int value) { static void setIdlePinMode(int value) {
boardConfiguration->idleValvePinMode = (pin_output_mode_e) value; boardConfiguration->idleValvePinMode = (pin_output_mode_e) value;
doPrintConfiguration(); doPrintConfiguration();
@ -458,6 +452,28 @@ static void setIgnitionPin(const char *indexStr, const char *pinName) {
boardConfiguration->ignitionPins[index] = pin; boardConfiguration->ignitionPins[index] = pin;
} }
static void setIdlePin(const char *pinName) {
brain_pin_e pin = parseBrainPin(pinName);
// todo: extract method - code duplication with other 'set_xxx_pin' methods?
if (pin == GPIO_INVALID) {
scheduleMsg(&logger, "invalid pin name [%s]", pinName);
return;
}
scheduleMsg(&logger, "setting idleValve pin to %s please save&restart", hwPortname(pin));
boardConfiguration->idleValvePin = pin;
}
static void setFuelPumpPin(const char *pinName) {
brain_pin_e pin = parseBrainPin(pinName);
// todo: extract method - code duplication with other 'set_xxx_pin' methods?
if (pin == GPIO_INVALID) {
scheduleMsg(&logger, "invalid pin name [%s]", pinName);
return;
}
scheduleMsg(&logger, "setting fuelPump pin to %s please save&restart", hwPortname(pin));
boardConfiguration->fuelPumpPin = pin;
}
static void setInjectionPin(const char *indexStr, const char *pinName) { static void setInjectionPin(const char *indexStr, const char *pinName) {
int index = atoi(indexStr); int index = atoi(indexStr);
if (index < 0 || index > INJECTION_PIN_COUNT) if (index < 0 || index > INJECTION_PIN_COUNT)
@ -609,6 +625,18 @@ static void enableOrDisable(const char *param, bool isEnabled) {
engineConfiguration->directSelfStimulation = isEnabled; engineConfiguration->directSelfStimulation = isEnabled;
} else if (strEqualCaseInsensitive(param, "engine_control")) { } else if (strEqualCaseInsensitive(param, "engine_control")) {
boardConfiguration->isEngineControlEnabled = isEnabled; boardConfiguration->isEngineControlEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "map_avg")) {
engineConfiguration->isMapAveragingEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "mil")) {
engineConfiguration->isMilEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "fuel_pump")) {
engineConfiguration->isFuelPumpEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "tunerstudio")) {
engineConfiguration->isTunerStudioEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "wave_analyzer")) {
engineConfiguration->isWaveAnalyzerEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "idle_thread")) {
engineConfiguration->isIdleThreadEnabled = isEnabled;
} else { } else {
scheduleMsg(&logger, "unexpected [%s]", param); scheduleMsg(&logger, "unexpected [%s]", param);
return; // well, MISRA would not like this 'return' here :( return; // well, MISRA would not like this 'return' here :(
@ -698,7 +726,6 @@ void initSettings(void) {
addConsoleActionI("set_injection_pin_mode", setInjectionPinMode); addConsoleActionI("set_injection_pin_mode", setInjectionPinMode);
addConsoleActionI("set_ignition_pin_mode", setIgnitionPinMode); addConsoleActionI("set_ignition_pin_mode", setIgnitionPinMode);
addConsoleActionI("set_idle_pin", setIdlePin);
addConsoleActionI("set_idle_pin_mode", setIdlePinMode); addConsoleActionI("set_idle_pin_mode", setIdlePinMode);
addConsoleActionI("set_fuel_pump_pin_mode", setFuelPumpPinMode); addConsoleActionI("set_fuel_pump_pin_mode", setFuelPumpPinMode);
addConsoleActionI("set_malfunction_indicator_pin_mode", setMalfunctionIndicatorPinMode); addConsoleActionI("set_malfunction_indicator_pin_mode", setMalfunctionIndicatorPinMode);
@ -754,6 +781,8 @@ void initSettings(void) {
addConsoleActionSS("set_trigger_input_pin", setTriggerInputPin); addConsoleActionSS("set_trigger_input_pin", setTriggerInputPin);
addConsoleActionSS("set_trigger_simulator_pin", setTriggerSimulatorPin); addConsoleActionSS("set_trigger_simulator_pin", setTriggerSimulatorPin);
addConsoleActionSS("set_trigger_simulator_mode", setTriggerSimulatorMode); addConsoleActionSS("set_trigger_simulator_mode", setTriggerSimulatorMode);
addConsoleActionS("set_fuel_pump_pin", setFuelPumpPin);
addConsoleActionS("set_idle_pin", setIdlePin);
addConsoleAction("mapinfo", printMAPInfo); addConsoleAction("mapinfo", printMAPInfo);
addConsoleActionSS("set_analog_input_pin", setAnalogInputPin); addConsoleActionSS("set_analog_input_pin", setAnalogInputPin);