2022-09-07 13:25:50 -07:00
|
|
|
/*
|
|
|
|
* @file prime_injection.h
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "engine_module.h"
|
|
|
|
#include "rusefi_types.h"
|
|
|
|
#include "scheduler.h"
|
|
|
|
|
|
|
|
class PrimeController : public EngineModule {
|
|
|
|
public:
|
|
|
|
void onIgnitionStateChanged(bool ignitionOn) override;
|
2022-09-28 04:53:12 -07:00
|
|
|
void onSlowCallback() override;
|
2022-09-07 13:25:50 -07:00
|
|
|
|
|
|
|
floatms_t getPrimeDuration() const;
|
|
|
|
|
|
|
|
void onPrimeStart();
|
|
|
|
void onPrimeEnd();
|
|
|
|
|
|
|
|
bool isPriming() const {
|
|
|
|
return m_isPriming;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_isPriming = false;
|
|
|
|
|
|
|
|
static void onPrimeStartAdapter(PrimeController* instance) {
|
|
|
|
instance->onPrimeStart();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void onPrimeEndAdapter(PrimeController* instance) {
|
|
|
|
instance->onPrimeEnd();
|
|
|
|
}
|
2022-09-07 17:31:04 -07:00
|
|
|
|
2022-09-28 04:53:12 -07:00
|
|
|
uint32_t getKeyCycleCounter() const;
|
|
|
|
void setKeyCycleCounter(uint32_t count);
|
|
|
|
};
|