auto-sync
This commit is contained in:
parent
31c4f7ab6b
commit
7501b2c353
|
@ -179,9 +179,10 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
|
|||
// VICS solenoid
|
||||
/**
|
||||
* to test
|
||||
* set_fsio_setting 0 1
|
||||
* set_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);
|
||||
|
||||
// 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) {
|
||||
int index = atoi(indexStr) - 1;
|
||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||
scheduleMsg(logger, "invalid index %d", index);
|
||||
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||
return;
|
||||
}
|
||||
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) {
|
||||
int index = atoi(indexStr) - 1;
|
||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||
scheduleMsg(logger, "invalid index %d", index);
|
||||
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||
return;
|
||||
}
|
||||
brain_pin_e pin = parseBrainPin(pinName);
|
||||
|
@ -133,6 +133,9 @@ static void setFsioOutputPin(const char *indexStr, const char *pinName) {
|
|||
|
||||
#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) {
|
||||
boardConfiguration->fsioPins[index] = pin;
|
||||
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) {
|
||||
index--;
|
||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||
scheduleMsg(logger, "invalid index %d", index);
|
||||
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||
return;
|
||||
}
|
||||
boardConfiguration->fsioFrequency[index] = frequency;
|
||||
|
@ -376,7 +379,7 @@ static void setFsioSetting(float indexF, float value) {
|
|||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
int index = indexF;
|
||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||
scheduleMsg(logger, "invalid index %d", index);
|
||||
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||
return;
|
||||
}
|
||||
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
|
||||
int index = atoi(indexStr) - 1;
|
||||
if (index < 0 || index >= LE_COMMAND_COUNT) {
|
||||
scheduleMsg(logger, "invalid index %d", index);
|
||||
scheduleMsg(logger, "invalid FSIO index: %d", index);
|
||||
return;
|
||||
}
|
||||
char * l = unquote((char*) quotedLine);
|
||||
|
|
|
@ -443,7 +443,7 @@ static void setFloat(const char *offsetStr, const char *valueStr) {
|
|||
getFloat(offset);
|
||||
}
|
||||
|
||||
void initConfigActions(void) {
|
||||
static void initConfigActions(void) {
|
||||
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
||||
addConsoleActionII("set_int", (VoidIntInt) setInt);
|
||||
addConsoleActionII("set_short", (VoidIntInt) setShort);
|
||||
|
@ -462,8 +462,8 @@ static void getKnockInfo(void) {
|
|||
engine->printKnockState();
|
||||
}
|
||||
|
||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
addConsoleAction("analoginfo", printAnalogInfo);
|
||||
// this method is used by real firmware and simulator
|
||||
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||
initConfigActions();
|
||||
#if EFI_PROD_CODE
|
||||
// todo: this is a mess, remove code duplication with simulator
|
||||
|
@ -479,9 +479,22 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
|||
if (hasFirmwareError()) {
|
||||
return;
|
||||
}
|
||||
|
||||
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__)
|
||||
initPwmGenerator();
|
||||
#endif
|
||||
|
@ -567,15 +580,10 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
|||
|
||||
initAccelEnrichment(sharedLogger);
|
||||
|
||||
initConfigActions();
|
||||
#if EFI_PROD_CODE
|
||||
addConsoleAction("reset_accel", resetAccel);
|
||||
#endif
|
||||
|
||||
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||
initFsioImpl(sharedLogger PASS_ENGINE_PARAMETER);
|
||||
#endif
|
||||
|
||||
#if EFI_HD44780_LCD || defined(__DOXYGEN__)
|
||||
initLcdController();
|
||||
#endif
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#include "engine.h"
|
||||
|
||||
char * getPinNameByAdcChannel(adc_channel_e hwChannel, char *buffer);
|
||||
void initConfigActions(void);
|
||||
void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_F);
|
||||
void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||
void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
#endif /* ENGINE_STATUS_H_ */
|
||||
|
|
|
@ -85,10 +85,8 @@ void rusEfiFunctionalTest(void) {
|
|||
resetConfigurationExt(NULL, FORD_ESCORT_GT PASS_ENGINE_PARAMETER);
|
||||
prepareShapes(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
initSensors(&sharedLogger PASS_ENGINE_PARAMETER);
|
||||
|
||||
initAlgo(&sharedLogger, engineConfiguration);
|
||||
initConfigActions();
|
||||
commonInitEngineController(&sharedLogger);
|
||||
|
||||
initRpmCalculator(&sharedLogger, engine);
|
||||
|
||||
|
@ -108,12 +106,6 @@ void rusEfiFunctionalTest(void) {
|
|||
|
||||
startStatusThreads(engine);
|
||||
|
||||
#if EFI_TUNER_STUDIO
|
||||
if (engineConfiguration->isTunerStudioEnabled) {
|
||||
startTunerStudioConnectivity();
|
||||
}
|
||||
#endif
|
||||
|
||||
initPeriodicEvents(PASS_ENGINE_PARAMETER_F);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue