auto-sync
This commit is contained in:
parent
52bd55c302
commit
848e4ccda6
|
@ -131,6 +131,8 @@ static void setFsioOutputPin(const char *indexStr, const char *pinName) {
|
||||||
}
|
}
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
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);
|
||||||
|
@ -145,8 +147,6 @@ void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMET
|
||||||
setFsioExt(index, pin, exp, NO_PWM PASS_ENGINE_PARAMETER);
|
setFsioExt(index, pin, exp, NO_PWM PASS_ENGINE_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
for (int i = 0; i < LE_COMMAND_COUNT; i++) {
|
for (int i = 0; i < LE_COMMAND_COUNT; i++) {
|
||||||
brain_pin_e brainPin = boardConfiguration->fsioPins[i];
|
brain_pin_e brainPin = boardConfiguration->fsioPins[i];
|
||||||
|
@ -321,6 +321,7 @@ static pin_output_mode_e defa = OM_DEFAULT;
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
static void showFsio(const char *msg, LEElement *element) {
|
static void showFsio(const char *msg, LEElement *element) {
|
||||||
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
if (msg != NULL)
|
if (msg != NULL)
|
||||||
scheduleMsg(logger, "%s:", msg);
|
scheduleMsg(logger, "%s:", msg);
|
||||||
while (element != NULL) {
|
while (element != NULL) {
|
||||||
|
@ -328,9 +329,11 @@ static void showFsio(const char *msg, LEElement *element) {
|
||||||
element = element->next;
|
element = element->next;
|
||||||
}
|
}
|
||||||
scheduleMsg(logger, "<end>");
|
scheduleMsg(logger, "<end>");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void showFsioInfo(void) {
|
static void showFsioInfo(void) {
|
||||||
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
scheduleMsg(logger, "sys used %d/user used %d", sysPool.getSize(), userPool.getSize());
|
scheduleMsg(logger, "sys used %d/user used %d", sysPool.getSize(), userPool.getSize());
|
||||||
showFsio("a/c", acRelayLogic);
|
showFsio("a/c", acRelayLogic);
|
||||||
showFsio("fuel", fuelPumpLogic);
|
showFsio("fuel", fuelPumpLogic);
|
||||||
|
@ -363,12 +366,14 @@ static void showFsioInfo(void) {
|
||||||
scheduleMsg(logger, "FSIO digital input #%d: %s", i, hwPortname(inputPin));
|
scheduleMsg(logger, "FSIO digital input #%d: %s", i, hwPortname(inputPin));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set_fsio_setting 0 0.11
|
* set_fsio_setting 0 0.11
|
||||||
*/
|
*/
|
||||||
static void setFsioSetting(float indexF, float value) {
|
static void setFsioSetting(float indexF, float value) {
|
||||||
|
#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 index %d", index);
|
||||||
|
@ -376,9 +381,11 @@ static void setFsioSetting(float indexF, float value) {
|
||||||
}
|
}
|
||||||
engineConfiguration->bc.fsio_setting[index] = value;
|
engineConfiguration->bc.fsio_setting[index] = value;
|
||||||
showFsioInfo();
|
showFsioInfo();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setFsioExpression(const char *indexStr, const char *quotedLine, Engine *engine) {
|
static void setFsioExpression(const char *indexStr, const char *quotedLine, Engine *engine) {
|
||||||
|
#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 index %d", index);
|
||||||
|
@ -395,9 +402,11 @@ static void setFsioExpression(const char *indexStr, const char *quotedLine, Engi
|
||||||
// this would apply the changes
|
// this would apply the changes
|
||||||
applyFsioConfiguration(PASS_ENGINE_PARAMETER_F);
|
applyFsioConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||||
showFsioInfo();
|
showFsioInfo();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eval(char *line, Engine *engine) {
|
static void eval(char *line, Engine *engine) {
|
||||||
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
line = unquote(line);
|
line = unquote(line);
|
||||||
scheduleMsg(logger, "Parsing [%s]", line);
|
scheduleMsg(logger, "Parsing [%s]", line);
|
||||||
evalPool.reset();
|
evalPool.reset();
|
||||||
|
@ -408,10 +417,13 @@ static void eval(char *line, Engine *engine) {
|
||||||
float result = evalCalc.getValue2(e, engine);
|
float result = evalCalc.getValue2(e, engine);
|
||||||
scheduleMsg(logger, "Eval result: %f", result);
|
scheduleMsg(logger, "Eval result: %f", result);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
logger = sharedLogger;
|
logger = sharedLogger;
|
||||||
|
#endif
|
||||||
for (int i = 0; i < LE_COMMAND_COUNT; i++) {
|
for (int i = 0; i < LE_COMMAND_COUNT; i++) {
|
||||||
fsioLogics[i] = NULL;
|
fsioLogics[i] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -453,13 +465,12 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
addConsoleActionSSP("set_fsio_expression", (VoidCharPtrCharPtrVoidPtr) setFsioExpression, engine);
|
addConsoleActionSSP("set_fsio_expression", (VoidCharPtrCharPtrVoidPtr) setFsioExpression, engine);
|
||||||
|
|
||||||
addConsoleActionFF("set_fsio_setting", setFsioSetting);
|
addConsoleActionFF("set_fsio_setting", setFsioSetting);
|
||||||
|
|
||||||
addConsoleAction("fsioinfo", showFsioInfo);
|
addConsoleAction("fsioinfo", showFsioInfo);
|
||||||
|
|
||||||
addConsoleActionSP("eval", (VoidCharPtrVoidPtr) eval, engine);
|
addConsoleActionSP("eval", (VoidCharPtrVoidPtr) eval, engine);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue