parent
04c4623fd4
commit
e2c2980335
|
@ -13,13 +13,15 @@
|
|||
#if EFI_HD_ACR
|
||||
|
||||
static bool getAcrState() {
|
||||
bool engineMovedRecently = getTriggerCentral()->engineMovedRecently();
|
||||
engine->engineState.acrEngineMovedRecently = engineMovedRecently;
|
||||
auto currentPhase = getTriggerCentral()->getCurrentEnginePhase(getTimeNowNt());
|
||||
if (!currentPhase) {
|
||||
return false;
|
||||
return engineMovedRecently;
|
||||
}
|
||||
|
||||
// Turn off the valve if the engine isn't moving - no sense wasting power on a stopped engine
|
||||
if (!getTriggerCentral()->engineMovedRecently()) {
|
||||
if (!engineMovedRecently) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -58,6 +60,10 @@ void HarleyAcr::onSlowCallback() {
|
|||
m_active = acrState;
|
||||
}
|
||||
|
||||
void HarleyAcr::updateAcr() {
|
||||
onSlowCallback();
|
||||
}
|
||||
|
||||
bool HarleyAcr::isActive() const {
|
||||
return m_active;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class HarleyAcr : public EngineModule {
|
||||
public:
|
||||
void updateAcr();
|
||||
void onSlowCallback() override;
|
||||
|
||||
bool isActive() const;
|
||||
|
|
|
@ -40,6 +40,7 @@ struct_no_prefix engine_state_s
|
|||
int8_t startStopState
|
||||
bit startStopPhysicalState
|
||||
bit acrStateDup
|
||||
bit acrEngineMovedRecently
|
||||
uint32_t startStopStateToggleCounter
|
||||
|
||||
float egtValue1
|
||||
|
|
|
@ -766,7 +766,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
|
|||
if (firstEventInAWhile) {
|
||||
#if EFI_HD_ACR
|
||||
// let's open that valve on first sign of movement
|
||||
engine->module<HarleyAcr>()->onSlowCallback();
|
||||
engine->module<HarleyAcr>()->updateAcr();
|
||||
#endif // EFI_HD_ACR
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue