Hellen says merge #1772 main relay progress
This commit is contained in:
parent
eebded8caa
commit
ec366b68ee
|
@ -332,7 +332,9 @@ void Engine::OnTriggerStateProperState(efitick_t nowNt) {
|
|||
Engine *engine = this;
|
||||
EXPAND_Engine;
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
triggerCentral.triggerState.runtimeStatistics(&triggerCentral.triggerFormDetails, nowNt PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||
|
||||
rpmCalculator.setSpinningUp(nowNt);
|
||||
}
|
||||
|
@ -599,6 +601,8 @@ void doScheduleStopEngine(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
// let's close injectors or else if these happen to be open right now
|
||||
enginePins.stopPins();
|
||||
// todo: initiate stepper motor parking
|
||||
// make sure we have stored all the info
|
||||
backupRamFlush();
|
||||
}
|
||||
|
||||
void action_s::execute() {
|
||||
|
|
|
@ -133,8 +133,13 @@ float getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|||
return engine->triggerCentral.getVVTPosition();
|
||||
#endif
|
||||
case LE_METHOD_TIME_SINCE_BOOT:
|
||||
#if EFI_MAIN_RELAY_CONTROL
|
||||
// in main relay control mode, we return the number of seconds since the ignition is turned on
|
||||
// (or negative if the ignition key is switched off)
|
||||
return engine->getTimeIgnitionSeconds();
|
||||
#else
|
||||
return getTimeNowSeconds();
|
||||
|
||||
#endif /* EFI_MAIN_RELAY_CONTROL */
|
||||
case LE_METHOD_STARTUP_FUEL_PUMP_DURATION:
|
||||
return engineConfiguration->startUpFuelPumpDuration;
|
||||
|
||||
|
@ -454,6 +459,7 @@ void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
|
||||
#if EFI_MAIN_RELAY_CONTROL
|
||||
if (CONFIG(mainRelayPin) != GPIO_UNASSIGNED)
|
||||
// the MAIN_RELAY_LOGIC calls engine->isInShutdownMode()
|
||||
setPinState("main_relay", &enginePins.mainRelay, mainRelayLogic PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
#else /* EFI_MAIN_RELAY_CONTROL */
|
||||
/**
|
||||
|
@ -744,6 +750,12 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|||
|
||||
// "Limp-mode" implementation for some RAM-limited configs without FSIO
|
||||
void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
#if EFI_PROD_CODE
|
||||
if (isRunningBenchTest()) {
|
||||
return; // let's not mess with bench testing
|
||||
}
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
// see MAIN_RELAY_LOGIC
|
||||
if (CONFIG(mainRelayPin) != GPIO_UNASSIGNED) {
|
||||
enginePins.mainRelay.setValue((getTimeNowSeconds() < 2) || (getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE) > LOW_VBATT) || engine->isInShutdownMode());
|
||||
|
|
Loading…
Reference in New Issue