auto-sync

This commit is contained in:
rusEfi 2015-04-12 10:10:37 -05:00
parent fc07a0366c
commit 558b03ea69
2 changed files with 9 additions and 1 deletions

View File

@ -41,6 +41,10 @@ public:
* TODO: better data structure? better algorithm?
*/
uint8_t hasEvents[PWM_PHASE_MAX_COUNT];
/**
* How many trigger events have injection? This depends on fuel strategy & trigger shape
*/
int eventsCount;
private:
void clear();
void registerInjectionEvent(OutputSignalList *sourceList, NamedOutputPin *output, float angle, bool_t isSimultanious DECLARE_ENGINE_PARAMETER_S);

View File

@ -133,7 +133,10 @@ void FuelSchedule::registerInjectionEvent(OutputSignalList *sourceList, NamedOut
ev->actuator = actuator;
findTriggerPosition(&ev->position, angle PASS_ENGINE_PARAMETER);
hasEvents[ev->position.eventIndex] = true;
if(!hasEvents[ev->position.eventIndex]) {
hasEvents[ev->position.eventIndex] = true;
eventsCount++;
}
}
FuelSchedule::FuelSchedule() {
@ -141,6 +144,7 @@ FuelSchedule::FuelSchedule() {
void FuelSchedule::clear() {
memset(hasEvents, 0, sizeof(hasEvents));
eventsCount = 0;
}
void FuelSchedule::addFuelEvents(OutputSignalList *sourceList, injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {