auto-sync
This commit is contained in:
parent
bb93a390ba
commit
e8e8f1ad33
|
@ -152,7 +152,7 @@ void FuelSchedule::addFuelEvents(injection_mode_e mode DECLARE_ENGINE_PARAMETER_
|
||||||
;
|
;
|
||||||
list->reset();
|
list->reset();
|
||||||
|
|
||||||
float baseAngle = engineConfiguration->globalTriggerAngleOffset + engineConfiguration->injectionAngle;
|
float baseAngle = tdcPosition() + engineConfiguration->injectionAngle;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case IM_SEQUENTIAL:
|
case IM_SEQUENTIAL:
|
||||||
|
@ -251,7 +251,7 @@ static int findAngleIndex(float angleOffset DECLARE_ENGINE_PARAMETER_S) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void findTriggerPosition(event_trigger_position_s *position, angle_t angleOffset DECLARE_ENGINE_PARAMETER_S) {
|
void findTriggerPosition(event_trigger_position_s *position, angle_t angleOffset DECLARE_ENGINE_PARAMETER_S) {
|
||||||
angleOffset += CONFIG(globalTriggerAngleOffset);
|
angleOffset += tdcPosition();
|
||||||
fixAngle(angleOffset);
|
fixAngle(angleOffset);
|
||||||
|
|
||||||
int index = TRIGGER_SHAPE(triggerIndexByAngle[(int)angleOffset]);
|
int index = TRIGGER_SHAPE(triggerIndexByAngle[(int)angleOffset]);
|
||||||
|
|
|
@ -70,4 +70,7 @@ void setTimingLoadBin(engine_configuration_s *engineConfiguration, float l, floa
|
||||||
|
|
||||||
void setSingleCoilDwell(engine_configuration_s *engineConfiguration);
|
void setSingleCoilDwell(engine_configuration_s *engineConfiguration);
|
||||||
|
|
||||||
|
#define tdcPosition() \
|
||||||
|
(ENGINE(triggerShape.tdcPosition) + CONFIG(globalTriggerAngleOffset))
|
||||||
|
|
||||||
#endif /* ENGINE_MATH_H_ */
|
#endif /* ENGINE_MATH_H_ */
|
||||||
|
|
|
@ -200,7 +200,7 @@ static void tdcMarkCallback(trigger_event_e ckpSignalType, uint32_t index0 DECLA
|
||||||
int revIndex2 = engine->rpmCalculator.getRevolutionCounter() % 2;
|
int revIndex2 = engine->rpmCalculator.getRevolutionCounter() % 2;
|
||||||
int rpm = getRpm();
|
int rpm = getRpm();
|
||||||
// todo: use event-based scheduling, not just time-based scheduling
|
// todo: use event-based scheduling, not just time-based scheduling
|
||||||
scheduleByAngle(rpm, &tdcScheduler[revIndex2], engineConfiguration->globalTriggerAngleOffset,
|
scheduleByAngle(rpm, &tdcScheduler[revIndex2], tdcPosition(),
|
||||||
(schfunc_t) onTdcCallback, NULL);
|
(schfunc_t) onTdcCallback, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* that's the angle distance from trigger event #0 and actual engine TDC
|
* that's the angle distance from trigger event #0 and actual engine TDC
|
||||||
|
* see also globalTriggerAngleOffset
|
||||||
*/
|
*/
|
||||||
float tdcPosition;
|
float tdcPosition;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue