Epic: Remove FSIO #2928
This commit is contained in:
parent
402f2a3f93
commit
22c872d8d8
|
@ -150,10 +150,6 @@ static void wipeStrings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
||||
void onBurnRequest(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
@ -518,10 +514,6 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
|
||||
engineConfiguration->sdCardPeriodMs = 50;
|
||||
|
||||
for (int i = 0; i < FSIO_COMMAND_COUNT; i++) {
|
||||
config->fsioFormulas[i][0] = 0;
|
||||
}
|
||||
|
||||
CONFIG(mapMinBufferLength) = 1;
|
||||
|
||||
CONFIG(startCrankingDuration) = 3;
|
||||
|
|
|
@ -75,7 +75,6 @@ public:
|
|||
class FsioState {
|
||||
public:
|
||||
FsioState();
|
||||
float fsioLastValue[FSIO_COMMAND_COUNT];
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
float mockFan = 0;
|
||||
|
|
|
@ -147,10 +147,10 @@ static void doTestSolenoid(int humanIndex, const char *delayStr, const char * on
|
|||
|
||||
static void doBenchTestFsio(int humanIndex, const char *delayStr, const char * onTimeStr, const char *offTimeStr,
|
||||
const char *countStr) {
|
||||
if (humanIndex < 1 || humanIndex > FSIO_COMMAND_COUNT) {
|
||||
efiPrintf("Invalid index: %d", humanIndex);
|
||||
return;
|
||||
}
|
||||
// if (humanIndex < 1 || humanIndex > FSIO_COMMAND_COUNT) {
|
||||
// efiPrintf("Invalid index: %d", humanIndex);
|
||||
// return;
|
||||
// }
|
||||
// todo: convert in lua bench test
|
||||
// brain_pin_e b = CONFIG(fsioOutputPins)[humanIndex - 1];
|
||||
// pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.fsioOutputs[humanIndex - 1], b);
|
||||
|
|
|
@ -204,13 +204,7 @@ FsioResult LECalculator::processElement(const LEElement *element DECLARE_ENGINE_
|
|||
return vCond != 0 ? vTrue : vFalse;
|
||||
}
|
||||
case LE_METHOD_FSIO_SETTING: {
|
||||
float humanIndex = pop(LE_METHOD_FSIO_SETTING);
|
||||
int index = (int) humanIndex - 1;
|
||||
if (index >= 0 && index < FSIO_COMMAND_COUNT) {
|
||||
return CONFIG(scriptSetting)[index];
|
||||
} else {
|
||||
return unexpected;
|
||||
}
|
||||
return unexpected;
|
||||
}
|
||||
case LE_METHOD_SCRIPT_TABLE_: {
|
||||
float i = pop(LE_METHOD_SCRIPT_TABLE_);
|
||||
|
|
|
@ -79,17 +79,6 @@ CCM_OPTIONAL LEElementPool sysPool(sysElements, SYS_ELEMENT_POOL_SIZE);
|
|||
|
||||
static LEElement userElements[UD_ELEMENT_POOL_SIZE] CCM_OPTIONAL;
|
||||
|
||||
class FsioPointers {
|
||||
public:
|
||||
FsioPointers();
|
||||
LEElement * fsioLogics[FSIO_COMMAND_COUNT];
|
||||
};
|
||||
|
||||
FsioPointers::FsioPointers() : fsioLogics() {
|
||||
}
|
||||
|
||||
static FsioPointers state;
|
||||
|
||||
static LEElement * fuelPumpLogic;
|
||||
static LEElement * starterRelayDisableLogic;
|
||||
|
||||
|
@ -219,24 +208,6 @@ static void setPinState(const char * msg, OutputPin *pin, LEElement *element DEC
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param out param! current and new value as long as element is not NULL
|
||||
* @return 'true' if value has changed
|
||||
*/
|
||||
static bool updateValueOrWarning(int humanIndex, const char *msg, float *value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
int fsioIndex = humanIndex - 1;
|
||||
LEElement * element = state.fsioLogics[fsioIndex];
|
||||
if (element == NULL) {
|
||||
warning(CUSTOM_FSIO_INVALID_EXPRESSION, "invalid expression for %s", msg);
|
||||
return false;
|
||||
} else {
|
||||
float beforeValue = *value;
|
||||
*value = calc.evaluate(msg, beforeValue, element PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
// floating '==' comparison without EPS seems fine here
|
||||
return (beforeValue != *value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this method should be invoked periodically to calculate FSIO and toggle corresponding FSIO outputs
|
||||
*/
|
||||
|
@ -268,21 +239,6 @@ void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
* open question if heater should be ON during cranking
|
||||
*/
|
||||
enginePins.o2heater.setValue(engine->rpmCalculator.isRunning());
|
||||
|
||||
#if EFI_ENABLE_ENGINE_WARNING
|
||||
if (engineConfiguration->useFSIO4ForSeriousEngineWarning) {
|
||||
updateValueOrWarning(MAGIC_OFFSET_FOR_ENGINE_WARNING, "eng warning", &ENGINE(fsioState.isEngineWarning) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
#endif /* EFI_ENABLE_ENGINE_WARNING */
|
||||
|
||||
#if EFI_ENABLE_CRITICAL_ENGINE_STOP
|
||||
if (engineConfiguration->useFSIO5ForCriticalIssueEngineStop) {
|
||||
bool changed = updateValueOrWarning(MAGIC_OFFSET_FOR_CRITICAL_ENGINE, "eng critical", &ENGINE(fsioState.isCriticalEngineCondition) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
if (changed && float2bool(ENGINE(fsioState.isCriticalEngineCondition))) {
|
||||
doScheduleStopEngine(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
}
|
||||
#endif /* EFI_ENABLE_CRITICAL_ENGINE_STOP */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -61,9 +61,6 @@ static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *ou
|
|||
warning(CUSTOM_OUT_OF_ORDER_COIL, "out-of-order coil off %s", output->getName());
|
||||
output->outOfOrder = true;
|
||||
}
|
||||
#if HW_CHECK_SPARK_FSIO
|
||||
enginePins.fsioOutputs[event->cylinderIndex].setValue(0);
|
||||
#endif // HW_CHECK_SPARK_FSIO
|
||||
output->setLow();
|
||||
}
|
||||
|
||||
|
@ -269,9 +266,6 @@ static void startDwellByTurningSparkPinHigh(IgnitionEvent *event, IgnitionOutput
|
|||
}
|
||||
}
|
||||
|
||||
#if HW_CHECK_SPARK_FSIO
|
||||
enginePins.fsioOutputs[event->cylinderIndex].setValue(1);
|
||||
#endif // HW_CHECK_SPARK_FSIO
|
||||
INJECT_ENGINE_REFERENCE(output);
|
||||
output->setHigh();
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ static P luaL_checkPwmIndex(lua_State* l, int pos) {
|
|||
auto channel = luaL_checkinteger(l, pos);
|
||||
|
||||
// Ensure channel is valid
|
||||
if (channel < 0 || channel >= FSIO_COMMAND_COUNT) {
|
||||
if (channel < 0 || channel >= LUA_PWM_COUNT) {
|
||||
luaL_error(l, "setPwmDuty invalid channel %d", channel);
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,6 @@ public:
|
|||
|
||||
RegisteredNamedOutputPin tachOut;
|
||||
|
||||
OutputPin fsioOutputs[FSIO_COMMAND_COUNT];
|
||||
RegisteredOutputPin triggerDecoderErrorPin;
|
||||
OutputPin sdCsPin;
|
||||
OutputPin accelerometerCs;
|
||||
|
|
Loading…
Reference in New Issue