auto-sync
This commit is contained in:
parent
021263dc8b
commit
b3c7fc0465
|
@ -33,8 +33,6 @@ void setGy6139qmbDefaultEngineConfiguration(
|
|||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 8;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 1;
|
||||
engineConfiguration->trigger.customIsSynchronizationNeeded = true;
|
||||
engineConfiguration->trigger.customNeedSecondTriggerInput = false;
|
||||
|
||||
boardConfiguration->injectionPins[0] = GPIOC_9;
|
||||
boardConfiguration->ignitionPins[0] = GPIOC_8;
|
||||
|
|
|
@ -44,7 +44,6 @@ void setFordInline6(engine_configuration_s *engineConfiguration, board_configura
|
|||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 6;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
|
||||
|
||||
engineConfiguration->globalTriggerAngleOffset = 0;
|
||||
engineConfiguration->ignitionBaseAngle = 13;
|
||||
|
|
|
@ -24,9 +24,6 @@ void setSachs(engine_configuration_s *engineConfiguration) {
|
|||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 1;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
|
||||
engineConfiguration->trigger.customNeedSecondTriggerInput = false;
|
||||
|
||||
|
||||
engineConfiguration->hasIatSensor = false;
|
||||
engineConfiguration->hasMapSensor = false;
|
||||
|
@ -34,7 +31,6 @@ void setSachs(engine_configuration_s *engineConfiguration) {
|
|||
engineConfiguration->hasAfrSensor = false;
|
||||
engineConfiguration->hasCltSensor = false;
|
||||
|
||||
|
||||
// Frankenstein analog input #1: PA1 adc1
|
||||
// Frankenstein analog input #2: PA3 adc3 TPS
|
||||
// Frankenstein analog input #3: PC3 adc13
|
||||
|
|
|
@ -18,4 +18,9 @@ void setSubaru2003Wrx(engine_configuration_s *engineConfiguration) {
|
|||
setFrankenso_01_LCD(boardConfiguration);
|
||||
setFrankenso0_1_joystick(engineConfiguration);
|
||||
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 5;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 1;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ void setTestEngineConfiguration(engine_configuration_s *engineConfiguration) {
|
|||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
|
||||
trigger_config_s *triggerConfig = &engineConfiguration->trigger;
|
||||
triggerConfig->customIsSynchronizationNeeded = false;
|
||||
triggerConfig->customTotalToothCount = 60;
|
||||
triggerConfig->customSkippedToothCount = 0;
|
||||
|
||||
|
|
|
@ -227,8 +227,16 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, uint64_t now
|
|||
toothed_previous_time = nowNt;
|
||||
}
|
||||
|
||||
static void initializeSkippedToothTriggerShape(TriggerShape *s, int totalTeethCount, int skippedCount,
|
||||
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount,
|
||||
operation_mode_e operationMode) {
|
||||
efiAssertVoid(totalTeethCount > 0, "totalTeethCount is zero");
|
||||
|
||||
s->totalToothCount = totalTeethCount;
|
||||
s->skippedToothCount = skippedCount;
|
||||
|
||||
s->setTriggerSynchronizationGap(skippedCount + 1);
|
||||
s->isSynchronizationNeeded = (skippedCount != 0);
|
||||
|
||||
efiAssertVoid(s != NULL, "TriggerShape is NULL");
|
||||
s->reset(operationMode, false);
|
||||
|
||||
|
@ -244,15 +252,7 @@ static void initializeSkippedToothTriggerShape(TriggerShape *s, int totalTeethCo
|
|||
float angleDown = 720.0 / totalTeethCount * (totalTeethCount - skippedCount - 1 + toothWidth);
|
||||
s->addEvent(angleDown, T_PRIMARY, TV_HIGH);
|
||||
s->addEvent(720, T_PRIMARY, TV_LOW);
|
||||
}
|
||||
|
||||
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount,
|
||||
operation_mode_e operationMode) {
|
||||
efiAssertVoid(totalTeethCount > 0, "totalTeethCount is zero");
|
||||
|
||||
s->totalToothCount = totalTeethCount;
|
||||
s->skippedToothCount = skippedCount;
|
||||
initializeSkippedToothTriggerShape(s, totalTeethCount, skippedCount, operationMode);
|
||||
}
|
||||
|
||||
static void configureOnePlusOne(TriggerShape *s) {
|
||||
|
@ -282,9 +282,6 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin
|
|||
switch (triggerConfig->type) {
|
||||
|
||||
case TT_TOOTHED_WHEEL:
|
||||
// todo: for toothed wheel isSynchronizationNeeded is a function of customSkippedToothCount I guess
|
||||
triggerShape->isSynchronizationNeeded = engineConfiguration->trigger.customIsSynchronizationNeeded;
|
||||
|
||||
initializeSkippedToothTriggerShapeExt(triggerShape, triggerConfig->customTotalToothCount,
|
||||
triggerConfig->customSkippedToothCount, getOperationMode(engineConfiguration));
|
||||
break;
|
||||
|
@ -331,8 +328,6 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin
|
|||
|
||||
case TT_TOOTHED_WHEEL_60_2:
|
||||
setToothedWheelConfiguration(triggerShape, 60, 2, engineConfiguration);
|
||||
// todo: gap ratio is a function of skipped tooth I guess?
|
||||
triggerShape->setTriggerSynchronizationGap(3);
|
||||
break;
|
||||
|
||||
case TT_TOOTHED_WHEEL_36_1:
|
||||
|
|
|
@ -280,15 +280,11 @@ void multi_wave_s::checkSwitchTimes(int size) {
|
|||
|
||||
void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped,
|
||||
engine_configuration_s const *engineConfiguration) {
|
||||
s->isSynchronizationNeeded = (skipped != 0);
|
||||
#if EFI_ENGINE_CONTROL
|
||||
|
||||
s->totalToothCount = total;
|
||||
s->skippedToothCount = skipped;
|
||||
// todo: move to into configuration definition s->needSecondTriggerInput = false;
|
||||
s->useRiseEdge = true;
|
||||
|
||||
#if EFI_ENGINE_CONTROL
|
||||
initializeSkippedToothTriggerShapeExt(s, s->totalToothCount, s->skippedToothCount,
|
||||
initializeSkippedToothTriggerShapeExt(s, total, skipped,
|
||||
getOperationMode(engineConfiguration));
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue