auto-sync
This commit is contained in:
parent
31c4f7ab6b
commit
7501b2c353
|
@ -179,9 +179,10 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
// VICS solenoid
|
// VICS solenoid
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 0 1
|
* set_fsio_setting 0 5000
|
||||||
*/
|
*/
|
||||||
engineConfiguration->bc.fsio_setting[0] = 5000;
|
engineConfiguration->bc.fsio_setting[0] = 5000;
|
||||||
|
// set_fsio_expression 1 "rpm 0 fsio_setting >"
|
||||||
setFsioExt(0, GPIOE_3, "rpm 0 fsio_setting >", 150 PASS_ENGINE_PARAMETER);
|
setFsioExt(0, GPIOE_3, "rpm 0 fsio_setting >", 150 PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
// end of Ford Escort GT config
|
// end of Ford Escort GT config
|
||||||
|
|
|
@ -101,7 +101,7 @@ float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action) {
|
||||||
static void setFsioInputPin(const char *indexStr, const char *pinName) {
|
static void setFsioInputPin(const char *indexStr, const char *pinName) {
|
||||||
int index = atoi(indexStr) - 1;
|
int index = atoi(indexStr) - 1;
|
||||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||||
scheduleMsg(logger, "invalid index %d", index);
|
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
brain_pin_e pin = parseBrainPin(pinName);
|
brain_pin_e pin = parseBrainPin(pinName);
|
||||||
|
@ -117,7 +117,7 @@ static void setFsioInputPin(const char *indexStr, const char *pinName) {
|
||||||
static void setFsioOutputPin(const char *indexStr, const char *pinName) {
|
static void setFsioOutputPin(const char *indexStr, const char *pinName) {
|
||||||
int index = atoi(indexStr) - 1;
|
int index = atoi(indexStr) - 1;
|
||||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||||
scheduleMsg(logger, "invalid index %d", index);
|
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
brain_pin_e pin = parseBrainPin(pinName);
|
brain_pin_e pin = parseBrainPin(pinName);
|
||||||
|
@ -133,6 +133,9 @@ static void setFsioOutputPin(const char *indexStr, const char *pinName) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* index is between zero and LE_COMMAND_LENGTH-1
|
||||||
|
*/
|
||||||
void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_ENGINE_PARAMETER_S) {
|
void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_ENGINE_PARAMETER_S) {
|
||||||
boardConfiguration->fsioPins[index] = pin;
|
boardConfiguration->fsioPins[index] = pin;
|
||||||
int len = strlen(exp);
|
int len = strlen(exp);
|
||||||
|
@ -276,7 +279,7 @@ static void setPinState(const char * msg, OutputPin *pin, LEElement *element, En
|
||||||
static void setFsioFrequency(int index, int frequency) {
|
static void setFsioFrequency(int index, int frequency) {
|
||||||
index--;
|
index--;
|
||||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||||
scheduleMsg(logger, "invalid index %d", index);
|
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boardConfiguration->fsioFrequency[index] = frequency;
|
boardConfiguration->fsioFrequency[index] = frequency;
|
||||||
|
@ -376,7 +379,7 @@ static void setFsioSetting(float indexF, float value) {
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
int index = indexF;
|
int index = indexF;
|
||||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||||
scheduleMsg(logger, "invalid index %d", index);
|
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
engineConfiguration->bc.fsio_setting[index] = value;
|
engineConfiguration->bc.fsio_setting[index] = value;
|
||||||
|
@ -388,7 +391,7 @@ static void setFsioExpression(const char *indexStr, const char *quotedLine, Engi
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
int index = atoi(indexStr) - 1;
|
int index = atoi(indexStr) - 1;
|
||||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||||
scheduleMsg(logger, "invalid index %d", index);
|
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char * l = unquote((char*) quotedLine);
|
char * l = unquote((char*) quotedLine);
|
||||||
|
|
|
@ -443,7 +443,7 @@ static void setFloat(const char *offsetStr, const char *valueStr) {
|
||||||
getFloat(offset);
|
getFloat(offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initConfigActions(void) {
|
static void initConfigActions(void) {
|
||||||
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
||||||
addConsoleActionII("set_int", (VoidIntInt) setInt);
|
addConsoleActionII("set_int", (VoidIntInt) setInt);
|
||||||
addConsoleActionII("set_short", (VoidIntInt) setShort);
|
addConsoleActionII("set_short", (VoidIntInt) setShort);
|
||||||
|
@ -462,8 +462,8 @@ static void getKnockInfo(void) {
|
||||||
engine->printKnockState();
|
engine->printKnockState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
// this method is used by real firmware and simulator
|
||||||
addConsoleAction("analoginfo", printAnalogInfo);
|
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
initConfigActions();
|
initConfigActions();
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
// todo: this is a mess, remove code duplication with simulator
|
// todo: this is a mess, remove code duplication with simulator
|
||||||
|
@ -479,9 +479,22 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
if (hasFirmwareError()) {
|
if (hasFirmwareError()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
initSensors(sharedLogger PASS_ENGINE_PARAMETER_F);
|
initSensors(sharedLogger PASS_ENGINE_PARAMETER_F);
|
||||||
|
|
||||||
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
|
initFsioImpl(sharedLogger PASS_ENGINE_PARAMETER);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
addConsoleAction("analoginfo", printAnalogInfo);
|
||||||
|
commonInitEngineController(sharedLogger);
|
||||||
|
|
||||||
|
if (hasFirmwareError()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
initPwmGenerator();
|
initPwmGenerator();
|
||||||
#endif
|
#endif
|
||||||
|
@ -567,15 +580,10 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
|
||||||
initAccelEnrichment(sharedLogger);
|
initAccelEnrichment(sharedLogger);
|
||||||
|
|
||||||
initConfigActions();
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
addConsoleAction("reset_accel", resetAccel);
|
addConsoleAction("reset_accel", resetAccel);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EFI_FSIO || defined(__DOXYGEN__)
|
|
||||||
initFsioImpl(sharedLogger PASS_ENGINE_PARAMETER);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if EFI_HD44780_LCD || defined(__DOXYGEN__)
|
#if EFI_HD44780_LCD || defined(__DOXYGEN__)
|
||||||
initLcdController();
|
initLcdController();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
char * getPinNameByAdcChannel(adc_channel_e hwChannel, char *buffer);
|
char * getPinNameByAdcChannel(adc_channel_e hwChannel, char *buffer);
|
||||||
void initConfigActions(void);
|
|
||||||
void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_F);
|
void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_F);
|
||||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||||
|
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||||
|
|
||||||
#endif /* ENGINE_STATUS_H_ */
|
#endif /* ENGINE_STATUS_H_ */
|
||||||
|
|
|
@ -85,10 +85,8 @@ void rusEfiFunctionalTest(void) {
|
||||||
resetConfigurationExt(NULL, FORD_ESCORT_GT PASS_ENGINE_PARAMETER);
|
resetConfigurationExt(NULL, FORD_ESCORT_GT PASS_ENGINE_PARAMETER);
|
||||||
prepareShapes(PASS_ENGINE_PARAMETER_F);
|
prepareShapes(PASS_ENGINE_PARAMETER_F);
|
||||||
|
|
||||||
initSensors(&sharedLogger PASS_ENGINE_PARAMETER);
|
|
||||||
|
|
||||||
initAlgo(&sharedLogger, engineConfiguration);
|
initAlgo(&sharedLogger, engineConfiguration);
|
||||||
initConfigActions();
|
commonInitEngineController(&sharedLogger);
|
||||||
|
|
||||||
initRpmCalculator(&sharedLogger, engine);
|
initRpmCalculator(&sharedLogger, engine);
|
||||||
|
|
||||||
|
@ -108,12 +106,6 @@ void rusEfiFunctionalTest(void) {
|
||||||
|
|
||||||
startStatusThreads(engine);
|
startStatusThreads(engine);
|
||||||
|
|
||||||
#if EFI_TUNER_STUDIO
|
|
||||||
if (engineConfiguration->isTunerStudioEnabled) {
|
|
||||||
startTunerStudioConnectivity();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
initPeriodicEvents(PASS_ENGINE_PARAMETER_F);
|
initPeriodicEvents(PASS_ENGINE_PARAMETER_F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue