16 auto const hasStage2Injection{ taggedPointer.getFlag() };
18 for (
auto const& output:
event->outputs) {
24 if (hasStage2Injection) {
25 for (
auto const& output:
event->outputsStage2) {
34 for (
int cylinderIndex = 0; cylinderIndex < MAX_CYLINDER_COUNT; cylinderIndex++) {
63 angle_t injectionDurationAngle = MS2US(fuelMs) / oneDegreeUs;
69 return injectionDurationAngle * 0.5f;
72 return injectionDurationAngle;
80 if (std::isnan(oneDegreeUs)) {
87 if (std::isnan(fuelMs)) {
153 if (mode == IM_SIMULTANEOUS || mode == IM_SINGLE_POINT) {
156 }
else if (mode == IM_SEQUENTIAL || mode == IM_BATCH) {
167 if (mode == IM_BATCH) {
179 secondOutput =
nullptr;
180 secondOutputStage2 =
nullptr;
TunerStudioOutputChannels outputChannels
InjectorOutputPin injectorsStage2[MAX_CYLINDER_COUNT]
InjectorOutputPin injectors[MAX_CYLINDER_COUNT]
virtual floatus_t getOneDegreeUs()=0
floatms_t injectionDuration
InjectionEvent elements[MAX_CYLINDER_COUNT]
void onTriggerTooth(efitick_t nowNt, float currentPhase, float nextPhase)
static void resetOverlapping()
InjectorOutputPin * outputsStage2[MAX_WIRES_COUNT]
expected< float > computeInjectionAngle() const
void setIndex(uint8_t index)
void onTriggerTooth(efitick_t nowNt, float currentPhase, float nextPhase)
bool updateInjectionAngle()
InjectorOutputPin * outputs[MAX_WIRES_COUNT]
float injectionStartAngle
const char * getName() const
bool isInitialized() const
injection_mode_e getCurrentInjectionMode()
EngineRotationState * getEngineRotationState()
EngineState * getEngineState()
static EngineAccessor engine
static constexpr engine_configuration_s * engineConfiguration
angle_t getPerCylinderFiringOrderOffset(uint8_t cylinderIndex, uint8_t cylinderNumber)
bool warning(ObdCode code, const char *fmt,...)
void firmwareError(ObdCode code, const char *fmt,...)
size_t getCylinderNumberAtIndex(size_t cylinderIndex)
void turnInjectionPinHigh(scheduler_arg_t const arg)
static float getInjectionAngleCorrection(float fuelMs, float oneDegreeUs)
@ CUSTOM_OBD_INJECTION_NO_PIN_ASSIGNED
@ CUSTOM_OBD_UNEXPECTED_INJECTION_MODE
uintptr_t scheduler_arg_t
injectionOffset("Fuel: Injection timing SOI", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 56, 1.0, 0.0, 0.0, "deg")
constexpr T * getOriginalPointer() const
static constexpr TaggedPointer fromRaw(scheduler_arg_t raw)
InjectionTimingMode injectionTimingMode
uint8_t currentInjectionMode
void wrapAngle(angle_t &angle, const char *msg, ObdCode code)
TunerStudioOutputChannels * getTunerStudioOutputChannels()