auto-sync
This commit is contained in:
parent
19c4f82dc6
commit
68a85acba0
|
@ -38,6 +38,7 @@
|
|||
// return interpolate(500, 0.5, 5000, 1.1, rpm);
|
||||
//}
|
||||
|
||||
|
||||
/**
|
||||
* @return number of milliseconds in one crankshaft revolution
|
||||
*/
|
||||
|
@ -101,8 +102,7 @@ int isCrankingRT(engine_configuration_s *engineConfiguration, int rpm) {
|
|||
return rpm > 0 && rpm < engineConfiguration->crankingSettings.crankingRpm;
|
||||
}
|
||||
|
||||
OutputSignalList injectonSignals CCM_OPTIONAL
|
||||
;
|
||||
OutputSignalList injectonSignals CCM_OPTIONAL;
|
||||
|
||||
static void registerSparkEvent(engine_configuration_s const *engineConfiguration, trigger_shape_s * s,
|
||||
IgnitionEventList *list, io_pin_e pin, float localAdvance, float dwell) {
|
||||
|
@ -131,8 +131,8 @@ void initializeIgnitionActions(float advance, float dwellAngle, engine_configura
|
|||
// todo: extract method
|
||||
float localAdvance = advance + 720.0f * i / engineConfiguration->cylindersCount;
|
||||
|
||||
registerSparkEvent(engineConfiguration, &engineConfiguration2->triggerShape, list, SPARKOUT_1_OUTPUT,
|
||||
localAdvance, dwellAngle);
|
||||
registerSparkEvent(engineConfiguration, &engineConfiguration2->triggerShape, list,
|
||||
SPARKOUT_1_OUTPUT, localAdvance, dwellAngle);
|
||||
}
|
||||
break;
|
||||
case IM_WASTED_SPARK:
|
||||
|
@ -144,8 +144,8 @@ void initializeIgnitionActions(float advance, float dwellAngle, engine_configura
|
|||
int id = getCylinderId(engineConfiguration->firingOrder, wastedIndex) - 1;
|
||||
io_pin_e ioPin = (io_pin_e) (SPARKOUT_1_OUTPUT + id);
|
||||
|
||||
registerSparkEvent(engineConfiguration, &engineConfiguration2->triggerShape, list, ioPin, localAdvance,
|
||||
dwellAngle);
|
||||
registerSparkEvent(engineConfiguration, &engineConfiguration2->triggerShape, list,
|
||||
ioPin, localAdvance, dwellAngle);
|
||||
|
||||
}
|
||||
|
||||
|
@ -155,8 +155,8 @@ void initializeIgnitionActions(float advance, float dwellAngle, engine_configura
|
|||
float localAdvance = advance + 720.0f * i / engineConfiguration->cylindersCount;
|
||||
|
||||
io_pin_e pin = (io_pin_e) ((int) SPARKOUT_1_OUTPUT + getCylinderId(engineConfiguration->firingOrder, i) - 1);
|
||||
registerSparkEvent(engineConfiguration, &engineConfiguration2->triggerShape, list, pin, localAdvance,
|
||||
dwellAngle);
|
||||
registerSparkEvent(engineConfiguration, &engineConfiguration2->triggerShape, list, pin,
|
||||
localAdvance, dwellAngle);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -165,8 +165,12 @@ void initializeIgnitionActions(float advance, float dwellAngle, engine_configura
|
|||
}
|
||||
}
|
||||
|
||||
static void registerInjectionEvent(engine_configuration_s const *e, trigger_shape_s *s, ActuatorEventList *list,
|
||||
io_pin_e pin, float angle) {
|
||||
static void registerInjectionEvent(engine_configuration_s const *e,
|
||||
trigger_shape_s *s,
|
||||
ActuatorEventList *list,
|
||||
io_pin_e pin,
|
||||
float angle
|
||||
) {
|
||||
registerActuatorEventExt(e, s, list->getNextActuatorEvent(), injectonSignals.add(pin), angle);
|
||||
}
|
||||
|
||||
|
@ -248,6 +252,8 @@ void findTriggerPosition(engine_configuration_s const *engineConfiguration, trig
|
|||
|
||||
int engineCycleEventCount = getEngineCycleEventCount(engineConfiguration, s);
|
||||
|
||||
efiAssertVoid(engineCycleEventCount > 0, "engineCycleEventCount");
|
||||
|
||||
uint32_t middle;
|
||||
uint32_t left = 0;
|
||||
uint32_t right = engineCycleEventCount - 1;
|
||||
|
@ -261,7 +267,7 @@ void findTriggerPosition(engine_configuration_s const *engineConfiguration, trig
|
|||
|
||||
if (middle == left) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (angleOffset < s->eventAngles[middle]) {
|
||||
right = middle;
|
||||
|
@ -290,9 +296,9 @@ void registerActuatorEventExt(engine_configuration_s const *engineConfiguration,
|
|||
efiAssertVoid(s->getSize() > 0, "uninitialized trigger_shape_s");
|
||||
|
||||
if (e == NULL) {
|
||||
// error already reported
|
||||
// error already reported
|
||||
return;
|
||||
}
|
||||
}
|
||||
e->actuator = actuator;
|
||||
|
||||
findTriggerPosition(engineConfiguration, s, &e->position, angleOffset);
|
||||
|
@ -302,7 +308,7 @@ static int order_1_THEN_3_THEN_4_THEN2[] = { 1, 3, 4, 2 };
|
|||
|
||||
static int order_1_THEN_5_THEN_3_THEN_6_THEN_2_THEN_4[] = { 1, 5, 3, 6, 2, 4 };
|
||||
|
||||
static int order_1_8_4_3_6_5_7_2[] = { 1, 8, 4, 3, 6, 5, 7, 2 };
|
||||
static int order_1_8_4_3_6_5_7_2[] = {1, 8, 4, 3, 6, 5, 7, 2};
|
||||
|
||||
/**
|
||||
* @param index from zero to cylindersCount - 1
|
||||
|
|
|
@ -118,7 +118,7 @@ static void handleFuel(Engine *engine, MainTriggerCallback *mainTriggerCallback,
|
|||
}
|
||||
}
|
||||
|
||||
static void handleSparkEvent(MainTriggerCallback *mainTriggerCallback, int eventIndex, IgnitionEvent *iEvent, int rpm) {
|
||||
static void handleSparkEvent(MainTriggerCallback *mainTriggerCallback, uint32_t eventIndex, IgnitionEvent *iEvent, int rpm) {
|
||||
engine_configuration_s *engineConfiguration = mainTriggerCallback->engineConfiguration;
|
||||
engine_configuration2_s *engineConfiguration2 = mainTriggerCallback->engineConfiguration2;
|
||||
|
||||
|
@ -182,7 +182,7 @@ static void handleSparkEvent(MainTriggerCallback *mainTriggerCallback, int event
|
|||
}
|
||||
}
|
||||
|
||||
static void handleSpark(MainTriggerCallback *mainTriggerCallback, int eventIndex, int rpm, IgnitionEventList *list) {
|
||||
static void handleSpark(MainTriggerCallback *mainTriggerCallback, uint32_t eventIndex, int rpm, IgnitionEventList *list) {
|
||||
if (!isValidRpm(rpm) || !mainTriggerCallback->engineConfiguration->isIgnitionEnabled)
|
||||
return; // this might happen for instance in case of a single trigger event after a pause
|
||||
|
||||
|
|
|
@ -55,8 +55,10 @@ public:
|
|||
* Total count of shaft events per CAM or CRANK shaft revolution.
|
||||
* TODO this should be migrated to CRANKshaft revolution, this would go together
|
||||
* TODO with eliminating RPM_MULT magic constant
|
||||
*
|
||||
* todo: somehow changing the type of this to uint32_t breaks unit tests? WHY?
|
||||
*/
|
||||
uint32_t shaftPositionEventCount;
|
||||
int shaftPositionEventCount;
|
||||
|
||||
/**
|
||||
* this one is per CRANKshaft revolution
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// This file was generated by Version2Header
|
||||
// Fri Sep 12 10:36:39 EDT 2014
|
||||
// Wed Sep 24 12:19:23 EDT 2014
|
||||
#ifndef VCS_VERSION
|
||||
#define VCS_VERSION "4660"
|
||||
#define VCS_VERSION "4756"
|
||||
#endif
|
||||
|
|
|
@ -49,7 +49,7 @@ float maxF(float i1, float i2) {
|
|||
return i1 > i2 ? i1 : i2;
|
||||
}
|
||||
|
||||
int efiStrlen(const char *param) {
|
||||
uint32_t efiStrlen(const char *param) {
|
||||
return strlen(param);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ extern "C"
|
|||
|
||||
const char * boolToString(bool value);
|
||||
|
||||
int efiStrlen(const char *param);
|
||||
uint32_t efiStrlen(const char *param);
|
||||
int indexOf(const char *string, char ch);
|
||||
float atoff(const char *string);
|
||||
int atoi(const char *string);
|
||||
|
|
Loading…
Reference in New Issue