brutal encapsulation
This commit is contained in:
parent
52869d63bb
commit
5962cbd5c2
|
@ -411,18 +411,4 @@ void PrimeController::onPrimeStart() {
|
||||||
getExecutorInterface()->scheduleByTimestampNt("prime", &m_end, endTime, { onPrimeEndAdapter, this });
|
getExecutorInterface()->scheduleByTimestampNt("prime", &m_end, endTime, { onPrimeEndAdapter, this });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void updatePrimeInjectionPulseState() {
|
|
||||||
static bool counterWasReset = false;
|
|
||||||
if (counterWasReset)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!getEngineRotationState()->isStopped()) {
|
|
||||||
#if EFI_PROD_CODE
|
|
||||||
backupRamSave(BACKUP_IGNITION_SWITCH_COUNTER, 0);
|
|
||||||
#endif /* EFI_PROD_CODE */
|
|
||||||
counterWasReset = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* EFI_ENGINE_CONTROL */
|
#endif /* EFI_ENGINE_CONTROL */
|
||||||
|
|
|
@ -17,9 +17,6 @@ void endSimultaneousInjection(InjectionEvent *event);
|
||||||
void turnInjectionPinHigh(InjectionEvent *event);
|
void turnInjectionPinHigh(InjectionEvent *event);
|
||||||
void turnInjectionPinLow(InjectionEvent *event);
|
void turnInjectionPinLow(InjectionEvent *event);
|
||||||
|
|
||||||
// reset injection switch counter if the engine started spinning
|
|
||||||
void updatePrimeInjectionPulseState();
|
|
||||||
|
|
||||||
// Internal use only - exposed for tests
|
// Internal use only - exposed for tests
|
||||||
void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
|
void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
|
||||||
int rpm, efitick_t nowNt);
|
int rpm, efitick_t nowNt);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "prime_injection.h"
|
#include "prime_injection.h"
|
||||||
#include "injection_gpio.h"
|
#include "injection_gpio.h"
|
||||||
#include "sensor.h"
|
#include "sensor.h"
|
||||||
|
#include "backup_ram.h"
|
||||||
|
|
||||||
void PrimeController::onPrimeEnd() {
|
void PrimeController::onPrimeEnd() {
|
||||||
endSimultaneousInjectionOnlyTogglePins();
|
endSimultaneousInjectionOnlyTogglePins();
|
||||||
|
@ -28,3 +28,17 @@ floatms_t PrimeController::getPrimeDuration() const {
|
||||||
|
|
||||||
return engine->module<InjectorModel>()->getInjectionDuration(primeMass);
|
return engine->module<InjectorModel>()->getInjectionDuration(primeMass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updatePrimeInjectionPulseState() {
|
||||||
|
static bool counterWasReset = false;
|
||||||
|
if (counterWasReset)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!getEngineRotationState()->isStopped()) {
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
backupRamSave(BACKUP_IGNITION_SWITCH_COUNTER, 0);
|
||||||
|
#endif /* EFI_PROD_CODE */
|
||||||
|
counterWasReset = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,3 +36,6 @@ private:
|
||||||
instance->onPrimeEnd();
|
instance->onPrimeEnd();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// reset injection switch counter if the engine started spinning
|
||||||
|
void updatePrimeInjectionPulseState();
|
||||||
|
|
|
@ -16,5 +16,3 @@ public:
|
||||||
void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override;
|
void scheduleForLater(const char *msg, scheduling_s *scheduling, int delayUs, action_s action) override;
|
||||||
void cancel(scheduling_s* s) override;
|
void cancel(scheduling_s* s) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
ExecutorInterface *getExecutorInterface();
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @file backup_ram.cpp
|
* @file backup_ram.h
|
||||||
* @brief Non-volatile backup-RAM registers support
|
* @brief Non-volatile backup-RAM registers support
|
||||||
*
|
*
|
||||||
* @date Dec 19, 2017
|
* @date Dec 19, 2017
|
||||||
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
|
||||||
#include "efi_gpio.h"
|
#include "efi_gpio.h"
|
||||||
|
|
||||||
#include "error_handling.h"
|
#include "error_handling.h"
|
||||||
|
|
Loading…
Reference in New Issue