improving API?
This commit is contained in:
parent
e8051c1807
commit
c5e60a7f93
|
@ -213,7 +213,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF
|
||||||
|
|
||||||
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(angle), "findAngle#3", false);
|
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(angle), "findAngle#3", false);
|
||||||
assertAngleRange(angle, "findAngle#a33", CUSTOM_ERR_6544);
|
assertAngleRange(angle, "findAngle#a33", CUSTOM_ERR_6544);
|
||||||
TRIGGER_SHAPE(findTriggerPosition(&ev->injectionStart, angle PASS_CONFIG_PARAM(engineConfiguration->globalTriggerAngleOffset)));
|
ev->injectionStart.setAngle(angle PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
#if EFI_UNIT_TEST
|
#if EFI_UNIT_TEST
|
||||||
printf("registerInjectionEvent angle=%.2f trgIndex=%d inj %d\r\n", angle, ev->injectionStart.triggerEventIndex, injectorIndex);
|
printf("registerInjectionEvent angle=%.2f trgIndex=%d inj %d\r\n", angle, ev->injectionStart.triggerEventIndex, injectorIndex);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -44,6 +44,11 @@
|
||||||
#include "engine_configuration.h"
|
#include "engine_configuration.h"
|
||||||
extern persistent_config_container_s persistentState;
|
extern persistent_config_container_s persistentState;
|
||||||
|
|
||||||
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
|
void event_trigger_position_s::setAngle(angle_t angle DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
TRIGGER_SHAPE(findTriggerPosition(this, angle PASS_CONFIG_PARAM(engineConfiguration->globalTriggerAngleOffset)));
|
||||||
|
}
|
||||||
|
|
||||||
trigger_shape_helper::trigger_shape_helper() {
|
trigger_shape_helper::trigger_shape_helper() {
|
||||||
memset(&pinStates, 0, sizeof(pinStates));
|
memset(&pinStates, 0, sizeof(pinStates));
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
uint32_t triggerEventIndex = 0;
|
uint32_t triggerEventIndex = 0;
|
||||||
|
|
||||||
angle_t angleOffsetFromTriggerEvent = 0;
|
angle_t angleOffsetFromTriggerEvent = 0;
|
||||||
|
|
||||||
|
void setAngle(angle_t angle DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TRIGGER_CHANNEL_COUNT 3
|
#define TRIGGER_CHANNEL_COUNT 3
|
||||||
|
|
|
@ -113,7 +113,7 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
|
||||||
angle_t dwellStartAngle = sparkAngle - dwellAngleDuration;
|
angle_t dwellStartAngle = sparkAngle - dwellAngleDuration;
|
||||||
efiAssertVoid(CUSTOM_ERR_6590, !cisnan(dwellStartAngle), "findAngle#5");
|
efiAssertVoid(CUSTOM_ERR_6590, !cisnan(dwellStartAngle), "findAngle#5");
|
||||||
assertAngleRange(dwellStartAngle, "findAngle#a6", CUSTOM_ERR_6550);
|
assertAngleRange(dwellStartAngle, "findAngle#a6", CUSTOM_ERR_6550);
|
||||||
TRIGGER_SHAPE(findTriggerPosition(&event->dwellPosition, dwellStartAngle PASS_CONFIG_PARAM(engineConfiguration->globalTriggerAngleOffset)));
|
event->dwellPosition.setAngle(dwellStartAngle PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
#if FUEL_MATH_EXTREME_LOGGING
|
#if FUEL_MATH_EXTREME_LOGGING
|
||||||
printf("addIgnitionEvent %s ind=%d\n", output->name, event->dwellPosition.triggerEventIndex);
|
printf("addIgnitionEvent %s ind=%d\n", output->name, event->dwellPosition.triggerEventIndex);
|
||||||
|
@ -225,7 +225,7 @@ static bool assertNotInIgnitionList(AngleBasedEvent *head, AngleBasedEvent *elem
|
||||||
* false if event was put into queue for scheduling at a later tooth
|
* false if event was put into queue for scheduling at a later tooth
|
||||||
*/
|
*/
|
||||||
static bool scheduleOrQueue(AngleBasedEvent *event, uint32_t trgEventIndex, angle_t angle, schfunc_t callback, void *param DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
static bool scheduleOrQueue(AngleBasedEvent *event, uint32_t trgEventIndex, angle_t angle, schfunc_t callback, void *param DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
TRIGGER_SHAPE(findTriggerPosition(&event->position, angle PASS_CONFIG_PARAM(engineConfiguration->globalTriggerAngleOffset)));
|
event->position.setAngle(angle PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* todo: extract a "scheduleForAngle" method with best implementation into a separate utility method
|
* todo: extract a "scheduleForAngle" method with best implementation into a separate utility method
|
||||||
|
|
Loading…
Reference in New Issue