auto-sync
This commit is contained in:
parent
df11dc6ff5
commit
083790116d
|
@ -25,9 +25,9 @@ void setGy6139qmbDefaultEngineConfiguration(engine_configuration_s *engineConfig
|
|||
/**
|
||||
* We treat the trigger as 1/0 toothed wheel
|
||||
*/
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->triggerConfig.customTotalToothCount = 1;
|
||||
engineConfiguration->triggerConfig.customSkippedToothCount = 0;
|
||||
engineConfiguration->triggerConfig.customIsSynchronizationNeeded = false;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 1;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
|
||||
//todo engineConfiguration2->triggerShape.needSecondTriggerInput = false;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
#include "MiniCooperR50.h"
|
||||
|
||||
void setMiniCooperR50(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->triggerConfig.triggerType = TT_MINI_COOPER_R50;
|
||||
engineConfiguration->trigger.type = TT_MINI_COOPER_R50;
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ void setBmwE34(engine_configuration_s *engineConfiguration) {
|
|||
engineConfiguration->rpmHardLimit = 6000;
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->cylindersCount = 6;
|
||||
engineConfiguration->firingOrder = FO_1_THEN_5_THEN_3_THEN_6_THEN_2_THEN_4;
|
||||
engineConfiguration->injectionMode = IM_SIMULTANEOUS;
|
||||
|
|
|
@ -61,7 +61,7 @@ void setCitroenBerlingoTU3JPConfiguration(engine_configuration_s *engineConfigur
|
|||
* Base engine setting
|
||||
*/
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->globalTriggerAngleOffset = 114;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 1.360;
|
||||
|
|
|
@ -93,7 +93,7 @@ static float dodge_map_advance_table[16][16] = {
|
|||
void setDodgeNeon1995EngineConfiguration(engine_configuration_s *engineConfiguration,
|
||||
board_configuration_s *boardConfiguration) {
|
||||
|
||||
engineConfiguration->triggerConfig.triggerType = TT_DODGE_NEON_1995;
|
||||
engineConfiguration->trigger.type = TT_DODGE_NEON_1995;
|
||||
|
||||
engineConfiguration->algorithm = LM_ALPHA_N;
|
||||
|
||||
|
@ -183,7 +183,7 @@ void setDodgeNeon1995EngineConfiguration(engine_configuration_s *engineConfigura
|
|||
|
||||
void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfiguration,
|
||||
board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->triggerConfig.triggerType = TT_DODGE_NEON_2003;
|
||||
engineConfiguration->trigger.type = TT_DODGE_NEON_2003;
|
||||
setFrankenso_01_LCD(boardConfiguration);
|
||||
|
||||
// set_global_trigger_offset_angle 46
|
||||
|
|
|
@ -40,10 +40,10 @@ void setFordInline6(engine_configuration_s *engineConfiguration, board_configura
|
|||
/**
|
||||
* We treat the trigger as 6/0 toothed wheel
|
||||
*/
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->triggerConfig.customTotalToothCount = 6;
|
||||
engineConfiguration->triggerConfig.customSkippedToothCount = 0;
|
||||
engineConfiguration->triggerConfig.customIsSynchronizationNeeded = false;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.customTotalToothCount = 6;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
|
||||
|
||||
engineConfiguration->globalTriggerAngleOffset = 0;
|
||||
engineConfiguration->ignitionBaseAngle = 13;
|
||||
|
|
|
@ -113,7 +113,7 @@ void setFordAspireEngineConfiguration(engine_configuration_s *engineConfiguratio
|
|||
|
||||
setSingleCoilDwell(engineConfiguration);
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
engineConfiguration->triggerConfig.triggerType = TT_FORD_ASPIRE;
|
||||
engineConfiguration->trigger.type = TT_FORD_ASPIRE;
|
||||
|
||||
boardConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
|
||||
boardConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
|
||||
|
|
|
@ -20,7 +20,7 @@ void setFordFiestaDefaultEngineConfiguration(engine_configuration_s *engineConfi
|
|||
engineConfiguration->rpmHardLimit = 7000;
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_36_1;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
|
||||
|
|
|
@ -183,18 +183,18 @@ static void setHondaAccordConfigurationCommon(engine_configuration_s *engineConf
|
|||
|
||||
void setHondaAccordConfigurationTwoWires(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD_TWO_WIRES;
|
||||
engineConfiguration->triggerConfig.triggerType = TT_HONDA_ACCORD_CD_TWO_WIRES;
|
||||
engineConfiguration->trigger.type = TT_HONDA_ACCORD_CD_TWO_WIRES;
|
||||
setHondaAccordConfigurationCommon(engineConfiguration, boardConfiguration);
|
||||
}
|
||||
|
||||
void setHondaAccordConfigurationThreeWires(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD;
|
||||
engineConfiguration->triggerConfig.triggerType = TT_HONDA_ACCORD_CD;
|
||||
engineConfiguration->trigger.type = TT_HONDA_ACCORD_CD;
|
||||
setHondaAccordConfigurationCommon(engineConfiguration, boardConfiguration);
|
||||
}
|
||||
|
||||
void setHondaAccordConfigurationDip(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD_DIP;
|
||||
engineConfiguration->triggerConfig.triggerType = TT_HONDA_ACCORD_CD_DIP;
|
||||
engineConfiguration->trigger.type = TT_HONDA_ACCORD_CD_DIP;
|
||||
setHondaAccordConfigurationCommon(engineConfiguration, boardConfiguration);
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ static void setDefaultCrankingFuel(engine_configuration_s *engineConfiguration)
|
|||
}
|
||||
|
||||
static void commonMiataNa(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NA;
|
||||
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
|
||||
engineConfiguration->digitalChartSize = 100;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
|
@ -221,7 +221,7 @@ void setMiata1990(engine_configuration_s *engineConfiguration, board_configurati
|
|||
}
|
||||
|
||||
void setFordEscortGt(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->triggerConfig.triggerType = TT_FORD_ESCORT_GT;
|
||||
engineConfiguration->trigger.type = TT_FORD_ESCORT_GT;
|
||||
|
||||
common079721_2351(engineConfiguration, boardConfiguration);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ void setMazdaMiataNbEngineConfiguration(engine_configuration_s *engineConfigurat
|
|||
// set_rpm_hard_limit 3000
|
||||
engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now
|
||||
|
||||
engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NB;
|
||||
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NB;
|
||||
|
||||
engineConfiguration->globalTriggerAngleOffset = 276;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
void setMitsubishiConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
engineConfiguration->engineType = MITSU_4G93;
|
||||
|
||||
engineConfiguration->triggerConfig.triggerType = TT_MITSU;
|
||||
engineConfiguration->trigger.type = TT_MITSU;
|
||||
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 1.800;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "nissan_primera.h"
|
||||
|
||||
void setNissanPrimeraEngineConfiguration(engine_configuration_s *engineConfiguration) {
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
}
|
||||
|
||||
#endif /* EFI_SUPPORT_NISSAN_PRIMERA */
|
||||
|
|
|
@ -26,7 +26,7 @@ void setFrankenstein_01_LCD(board_configuration_s *boardConfiguration) {
|
|||
void setRoverv8(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_36_1;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1;
|
||||
|
||||
engineConfiguration->displacement = 3.528;
|
||||
engineConfiguration->cylindersCount = 8;
|
||||
|
|
|
@ -12,6 +12,5 @@
|
|||
#include "saturn_ion.h"
|
||||
|
||||
void setSaturnIonEngineConfiguration(engine_configuration_s *engineConfiguration) {
|
||||
engineConfiguration->triggerConfig.triggerType = TT_GM_7X;
|
||||
|
||||
engineConfiguration->trigger.type = TT_GM_7X;
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
#include "test_engine.h"
|
||||
|
||||
void setTestEngineConfiguration(engine_configuration_s *engineConfiguration) {
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||
|
||||
trigger_config_s *triggerConfig = &engineConfiguration->triggerConfig;
|
||||
trigger_config_s *triggerConfig = &engineConfiguration->trigger;
|
||||
triggerConfig->customIsSynchronizationNeeded = false;
|
||||
triggerConfig->customTotalToothCount = 60;
|
||||
triggerConfig->customSkippedToothCount = 0;
|
||||
|
|
|
@ -290,7 +290,7 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
|
|||
engineConfiguration->directSelfStimulation = false;
|
||||
|
||||
engineConfiguration->needSecondTriggerInput = true;
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
|
||||
engineConfiguration->HD44780width = 20;
|
||||
engineConfiguration->HD44780height = 4;
|
||||
|
|
|
@ -103,7 +103,7 @@ typedef struct {
|
|||
* @brief Trigger wheel(s) configuration
|
||||
*/
|
||||
typedef struct {
|
||||
trigger_type_e triggerType;
|
||||
trigger_type_e type;
|
||||
|
||||
int customIsSynchronizationNeeded;
|
||||
|
||||
|
@ -522,27 +522,46 @@ typedef struct {
|
|||
* offset 984
|
||||
*/
|
||||
firing_order_e firingOrder;
|
||||
|
||||
|
||||
/**
|
||||
* todo: refactor this, see operation_mode_e
|
||||
*/
|
||||
|
||||
* offset 988
|
||||
*/
|
||||
float rpmMultiplier;
|
||||
|
||||
/**
|
||||
* offset 992
|
||||
*/
|
||||
display_mode_e displayMode;
|
||||
|
||||
/**
|
||||
* offset 996
|
||||
*/
|
||||
log_format_e logFormat;
|
||||
|
||||
/**
|
||||
* offset 1000
|
||||
*/
|
||||
int firmwareVersion;
|
||||
/**
|
||||
* offset 1004
|
||||
*/
|
||||
int HD44780width;
|
||||
/**
|
||||
* offset 1008
|
||||
*/
|
||||
int HD44780height;
|
||||
|
||||
/**
|
||||
* offset 1012
|
||||
*/
|
||||
adc_channel_e tpsAdcChannel;
|
||||
/**
|
||||
* offset 1016
|
||||
*/
|
||||
int overrideCrankingIgnition;
|
||||
/**
|
||||
* offset 1020
|
||||
*/
|
||||
int analogChartFrequency;
|
||||
|
||||
trigger_config_s triggerConfig;
|
||||
|
||||
trigger_config_s trigger;
|
||||
|
||||
spi_device_e hip9011SpiDevice;
|
||||
adc_channel_e vbattAdcChannel;
|
||||
|
|
|
@ -168,7 +168,7 @@ const char* getConfigurationName(engine_type_e engineType) {
|
|||
void printConfiguration(engine_configuration_s *engineConfiguration) {
|
||||
|
||||
scheduleMsg(&logger, "Template %s/%d trigger %s/%s", getConfigurationName(engineConfiguration->engineType),
|
||||
engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->triggerConfig.triggerType),
|
||||
engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->trigger.type),
|
||||
getEngine_load_mode_e(engineConfiguration->algorithm));
|
||||
|
||||
scheduleMsg(&logger, "configurationVersion=%d", getGlobalConfigurationVersion());
|
||||
|
@ -468,7 +468,7 @@ static void setIgnitionMode(int value) {
|
|||
}
|
||||
|
||||
static void setTriggerType(int value) {
|
||||
engineConfiguration->triggerConfig.triggerType = (trigger_type_e) value;
|
||||
engineConfiguration->trigger.type = (trigger_type_e) value;
|
||||
incrementGlobalConfigurationVersion();
|
||||
doPrintConfiguration(engine);
|
||||
}
|
||||
|
|
|
@ -232,8 +232,8 @@ void triggerInfo(Engine *engine) {
|
|||
scheduleMsg(logger, "Template %s (%d) trigger %s (%d)",
|
||||
getConfigurationName(engineConfiguration->engineType),
|
||||
engineConfiguration->engineType,
|
||||
getTrigger_type_e(engineConfiguration->triggerConfig.triggerType),
|
||||
engineConfiguration->triggerConfig.triggerType);
|
||||
getTrigger_type_e(engineConfiguration->trigger.type),
|
||||
engineConfiguration->trigger.type);
|
||||
|
||||
scheduleMsg(logger, "trigger event counters %d/%d/%d/%d", triggerCentral.getHwEventCounter(0),
|
||||
triggerCentral.getHwEventCounter(1), triggerCentral.getHwEventCounter(2),
|
||||
|
@ -241,7 +241,7 @@ void triggerInfo(Engine *engine) {
|
|||
scheduleMsg(logger, "expected cycle events %d/%d/%d", ts->expectedEventCount[0],
|
||||
engine->triggerShape.expectedEventCount[1], ts->expectedEventCount[2]);
|
||||
|
||||
scheduleMsg(logger, "trigger type=%d/need2ndChannel=%s", engineConfiguration->triggerConfig.triggerType,
|
||||
scheduleMsg(logger, "trigger type=%d/need2ndChannel=%s", engineConfiguration->trigger.type,
|
||||
boolToString(engineConfiguration->needSecondTriggerInput));
|
||||
scheduleMsg(logger, "expected duty #0=%f/#1=%f", ts->dutyCycle[0], ts->dutyCycle[1]);
|
||||
|
||||
|
|
|
@ -262,18 +262,18 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin
|
|||
#if EFI_PROD_CODE
|
||||
scheduleMsg(logger, "initializeTriggerShape()");
|
||||
#endif
|
||||
const trigger_config_s *triggerConfig = &engineConfiguration->triggerConfig;
|
||||
const trigger_config_s *triggerConfig = &engineConfiguration->trigger;
|
||||
TriggerShape *triggerShape = &engine->triggerShape;
|
||||
|
||||
setTriggerSynchronizationGap(triggerShape, 2);
|
||||
triggerShape->useRiseEdge = true;
|
||||
|
||||
switch (triggerConfig->triggerType) {
|
||||
switch (triggerConfig->type) {
|
||||
|
||||
case TT_TOOTHED_WHEEL:
|
||||
// todo: move to into configuration definition engineConfiguration2->triggerShape.needSecondTriggerInput = false;
|
||||
|
||||
triggerShape->isSynchronizationNeeded = engineConfiguration->triggerConfig.customIsSynchronizationNeeded;
|
||||
triggerShape->isSynchronizationNeeded = engineConfiguration->trigger.customIsSynchronizationNeeded;
|
||||
|
||||
initializeSkippedToothTriggerShapeExt(triggerShape, triggerConfig->customTotalToothCount,
|
||||
triggerConfig->customSkippedToothCount, getOperationMode(engineConfiguration));
|
||||
|
@ -337,7 +337,7 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin
|
|||
break;
|
||||
|
||||
default:
|
||||
firmwareError("initializeTriggerShape() not implemented: %d", triggerConfig->triggerType);
|
||||
firmwareError("initializeTriggerShape() not implemented: %d", triggerConfig->type);
|
||||
;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ int TriggerShape::getTriggerShapeSynchPointIndex() {
|
|||
}
|
||||
|
||||
void TriggerShape::calculateTriggerSynchPoint(engine_configuration_s *engineConfiguration, Engine *engine) {
|
||||
trigger_config_s const*triggerConfig = &engineConfiguration->triggerConfig;
|
||||
trigger_config_s const*triggerConfig = &engineConfiguration->trigger;
|
||||
setTriggerShapeSynchPointIndex(engineConfiguration, findTriggerZeroEventIndex(this, triggerConfig PASS_ENGINE_PARAMETER), engine);
|
||||
}
|
||||
|
||||
|
|
|
@ -151,6 +151,29 @@ float vbattDividerCoeff;;"coef", 1, 0, 0.01, 20.0, 2
|
|||
float fanOnTemperature;Cooling fan turn-on temperature threshold, in Celsuis;"*C", 1, 0, 0, 1000.0, 2
|
||||
float fanOffTemperature;Cooling fan turn-off temperature threshold, in Celsuis;"*C", 1, 0, 0, 1000.0, 2
|
||||
|
||||
brain_pin_e vehicleSpeedSensorInputPin;
|
||||
float vehicleSpeedCoef;This coefficient translates vehicle speed input frequency (in Hz) into vehicle speed, km/h
|
||||
|
||||
bits canNbcType U32 [0:1], "BMW", "FIAT", "VAG" , "INVALID"
|
||||
can_nbc_e canNbcType;
|
||||
|
||||
int canSleepPeriod;;"RPM", 1, 0, 0, 1000.0, 2
|
||||
int cylindersCount;
|
||||
ignition_mode_e ignitionMode;
|
||||
firing_order_e firingOrder;
|
||||
float rpmMultiplier;todo: refactor this, see operation_mode_e
|
||||
display_mode_e displayMode;
|
||||
|
||||
log_format_e logFormat;
|
||||
int firmwareVersion;
|
||||
int HD44780width;
|
||||
int HD44780height;
|
||||
adc_channel_e tpsAdcChannel;
|
||||
int overrideCrankingIgnition;
|
||||
int analogChartFrequency;
|
||||
|
||||
struct trigger_config_s @brief Trigger wheel(s) configuration
|
||||
end_struct
|
||||
|
||||
!bits analog_chart_e S32 [0:1], "none", "trigger", "MAP", "INVALID"
|
||||
!analog_chart_e analogChartMode;
|
||||
|
|
|
@ -109,7 +109,7 @@ enable2ndByteCanID = false
|
|||
|
||||
|
||||
; canNbcType = bits, U32, 968, [0:1], "BMW", "FIAT", "VAG" , "INVALID"
|
||||
canSleepPeriod = scalar, F32, 972, "RPM", 1, 0, 0, 1000.0, 2 ; size 4
|
||||
canSleepPeriod = scalar, F32, 972, "RPM", 1, 0, 0, 1000.0, 2
|
||||
nCylinders = bits, U32, 976, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
|
||||
IgnitionMode = bits, U32, 980, [0:1], "One coil", "Individual Coils", "Wasted", "INVALID"
|
||||
FiringOrder = bits, U32, 984, [0:2], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "INVALID", "INVALID"
|
||||
|
|
Loading…
Reference in New Issue