auto-sync

This commit is contained in:
rusEfi 2015-01-28 19:06:25 -06:00
parent 505050fe52
commit ed2652cecc
13 changed files with 51 additions and 44 deletions

View File

@ -175,7 +175,7 @@ void setCitroenBerlingoTU3JPConfiguration(engine_configuration_s *engineConfigur
/**
* WBO Innovate LC-1
*/
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_12;
engineConfiguration->afr.hwChannel = EFI_ADC_12;
/**
* Other
*/

View File

@ -241,7 +241,7 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat
/**
* PA4 Wideband O2 Sensor
*/
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_4;
engineConfiguration->afr.hwChannel = EFI_ADC_4;
commonFrankensoAnalogInputs(engineConfiguration);
engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;

View File

@ -78,7 +78,7 @@ void setFordInline6(engine_configuration_s *engineConfiguration, board_configura
engineConfiguration->tpsAdcChannel = EFI_ADC_4;
engineConfiguration->iatAdcChannel = EFI_ADC_2;
engineConfiguration->cltAdcChannel = EFI_ADC_1;
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_11;
engineConfiguration->afr.hwChannel = EFI_ADC_11;
engineConfiguration->map.sensor.type = MT_MPX4250;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_15;

View File

@ -108,7 +108,7 @@ static void setHondaAccordConfigurationCommon(engine_configuration_s *engineConf
/**
* D14/W10 O2 Sensor
*/
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_13;
engineConfiguration->afr.hwChannel = EFI_ADC_13;
/**
* VBatt
@ -116,7 +116,7 @@ static void setHondaAccordConfigurationCommon(engine_configuration_s *engineConf
engineConfiguration->vbattAdcChannel = EFI_ADC_14;
engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;
// todo engineConfiguration->afrSensor.afrAdcChannel = 14;
// todo engineConfiguration->afr.hwChannel = 14;
/**

View File

@ -374,8 +374,8 @@ void setMiata1994_s(engine_configuration_s *engineConfiguration, board_configura
engineConfiguration->acSwitchAdc = EFI_ADC_1; // PA1, W50 on Frankenso
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_3;
initEgoSensor(&engineConfiguration->afrSensor, ES_Innovate_MTX_L);
engineConfiguration->afr.hwChannel = EFI_ADC_3;
initEgoSensor(&engineConfiguration->afr, ES_Innovate_MTX_L);
/**
* This board has PE0<>PD5 & PE1<>PD3 rewired in order to avoid Discovery issue

View File

@ -40,7 +40,7 @@ void setMazdaMiataNbEngineConfiguration(engine_configuration_s *engineConfigurat
engineConfiguration->mafAdcChannel = EFI_ADC_1;
engineConfiguration->cltAdcChannel = EFI_ADC_11;
engineConfiguration->iatAdcChannel = EFI_ADC_13;
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_2;
engineConfiguration->afr.hwChannel = EFI_ADC_2;
boardConfiguration->idleValvePin = GPIOE_0;
boardConfiguration->idleValvePinMode = OM_DEFAULT;

View File

@ -83,7 +83,7 @@ void setMitsubishiConfiguration(engine_configuration_s *engineConfiguration, boa
engineConfiguration->HD44780width = 20;
engineConfiguration->HD44780height = 4;
initEgoSensor(&engineConfiguration->afrSensor, ES_Innovate_MTX_L);
initEgoSensor(&engineConfiguration->afr, ES_Innovate_MTX_L);
#if EFI_FSIO || defined(__DOXYGEN__)
setFsio(engineConfiguration, 0, GPIOD_11, "rpm 5500 >");
#endif

View File

@ -301,11 +301,11 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
engineConfiguration->cltAdcChannel = EFI_ADC_6;
engineConfiguration->iatAdcChannel = EFI_ADC_7;
engineConfiguration->mafAdcChannel = EFI_ADC_0;
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_14;
engineConfiguration->afr.hwChannel = EFI_ADC_14;
engineConfiguration->cylinderBore = 87.5;
initEgoSensor(&engineConfiguration->afrSensor, ES_BPSX_D1);
initEgoSensor(&engineConfiguration->afr, ES_BPSX_D1);
engineConfiguration->globalFuelCorrection = 1;

View File

@ -1,4 +1,4 @@
// this section was generated by config_definition.jar on Wed Jan 28 18:53:51 EST 2015
// this section was generated by config_definition.jar on Wed Jan 28 19:47:23 EST 2015
// begin
#include "rusefi_types.h"
typedef struct {
@ -133,7 +133,7 @@ typedef struct {
/**
* offset 4
*/
int customIsSynchronizationNeeded;
bool32_t customIsSynchronizationNeeded;
/**
* offset 8
*/
@ -153,7 +153,7 @@ typedef struct {
/**
* offset 24
*/
int customUseRiseEdge;
bool32_t customUseRiseEdge;
/** total size 28*/
} trigger_config_s;
@ -161,7 +161,7 @@ typedef struct {
/**
* offset 0
*/
adc_channel_e afrAdcChannel;
adc_channel_e hwChannel;
/**
* offset 4
*/
@ -839,7 +839,7 @@ typedef struct {
* @see hasAfrSensor
* offset 1076
*/
afr_sensor_s afrSensor;
afr_sensor_s afr;
/**
* this is about deciding when the injector starts it's squirt
* offset 1096
@ -1109,4 +1109,4 @@ typedef struct {
} engine_configuration_s;
// end
// this section was generated by config_definition.jar on Wed Jan 28 18:53:51 EST 2015
// this section was generated by config_definition.jar on Wed Jan 28 19:47:23 EST 2015

View File

@ -85,4 +85,6 @@ typedef struct {
typedef int cylinders_count_t;
typedef int32_t bool32_t;
#endif /* CONTROLLERS_ALGO_RUSEFI_TYPES_H_ */

View File

@ -261,7 +261,7 @@ static void printAnalogInfo(void) {
printAnalogChannelInfo("IAT", engineConfiguration->iatAdcChannel);
}
printAnalogChannelInfo("MAF", engineConfiguration->mafAdcChannel);
printAnalogChannelInfo("AFR", engineConfiguration->afrSensor.afrAdcChannel);
printAnalogChannelInfo("AFR", engineConfiguration->afr.hwChannel);
printAnalogChannelInfo("MAP", engineConfiguration->map.sensor.hwChannel);
if (engineConfiguration->hasBaroSensor) {
printAnalogChannelInfo("BARO", engineConfiguration->baroSensor.hwChannel);

View File

@ -7,9 +7,9 @@
EXTERN_ENGINE;
float getAfr(DECLARE_ENGINE_PARAMETER_F) {
afr_sensor_s * sensor = &engineConfiguration->afrSensor;
afr_sensor_s * sensor = &engineConfiguration->afr;
float volts = getVoltageDivided(sensor->afrAdcChannel);
float volts = getVoltageDivided(sensor->hwChannel);
return interpolate(sensor->v1, sensor->value1, sensor->v2, sensor->value2, volts);
}

View File

@ -154,24 +154,26 @@ float fanOffTemperature;Cooling fan turn-off temperature threshold, in Celsuis;"
brain_pin_e vehicleSpeedSensorInputPin;
float vehicleSpeedCoef;This coefficient translates vehicle speed input frequency (in Hz) into vehicle speed, km/h
custom canNbcType 4 bits, U32, @OFFSET@, [0:1], "BMW", "FIAT", "VAG" , "INVALID"
custom can_nbc_e 4 bits, U32, @OFFSET@, [0:1], "BMW", "FIAT", "VAG" , "INVALID"
can_nbc_e canNbcType;
int canSleepPeriod;;"ms", 1, 0, 0, 1000.0, 2
int cylindersCount;
custom ignition_mode_e 4 bits, U32, %OFFSET%, [0:1], "One coil", "Individual Coils", "Wasted", "INVALID"
custom cylinders_count_t 4 bits, U32, @OFFSET@, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
cylinders_count_t cylindersCount;
custom ignition_mode_e 4 bits, U32, @OFFSET@, [0:1], "One coil", "Individual Coils", "Wasted", "INVALID"
ignition_mode_e ignitionMode;
custom firing_order_e 4 bits, U32, %OFFSET%, [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"
custom firing_order_e 4 bits, U32, @OFFSET@, [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"
firing_order_e firingOrder;
float rpmMultiplier;todo: refactor this, see operation_mode_e
custom display_mode_e 4 bits, U32, %OFFSET%, [0:1], "none", "hd44780", "hd44780 over pcf8574", "INVALID"
custom display_mode_e 4 bits, U32, @OFFSET@, [0:1], "none", "hd44780", "hd44780 over pcf8574", "INVALID"
display_mode_e displayMode;
custom log_format_e 4 bits, U32, %OFFSET%, [0:0], "native", "Mega Log Viewer"
custom log_format_e 4 bits, U32, @OFFSET@, [0:0], "native", "Mega Log Viewer"
log_format_e logFormat;
int firmwareVersion;;"index", 1, 0, 0, 300, 0
int HD44780width;;"index", 1, 0, 0, 300, 0
@ -179,14 +181,17 @@ log_format_e logFormat;
adc_channel_e tpsAdcChannel;
int overrideCrankingIgnition;
int analogChartFrequency;
int analogChartFrequency;;"index", 1, 0, 0, 300, 0 ; size 4
struct trigger_config_s @brief Trigger wheel(s) configuration
custom trigger_type_e 4 bits, U32, %OFFSET%, [0:3], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Escort GT", "60/2", "36/1", "Accord CD", "MITSU", "INVALID", "INVALID", "INVALID", "INVALID"
custom bool32_t 4 bits, U32, @OFFSET@, [0:0], "false", "true"
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:3], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Escort GT", "60/2", "36/1", "Accord CD", "MITSU", "INVALID", "INVALID", "INVALID", "INVALID"
trigger_type_e type;
int customIsSynchronizationNeeded;
bool32_t customIsSynchronizationNeeded;
int customTotalToothCount;;"number", 1, 0.0, 0, 1000.0, 2
int customSkippedToothCount;;"number", 1, 0.0, 0, 1000.0, 2
@ -194,17 +199,17 @@ custom trigger_type_e 4 bits, U32, %OFFSET%, [0:3], "custom toothed wheel",
float customSyncRatioFrom;;"number", 1, 0.0, 0, 1000.0, 2
float customSyncRatioTo;;"number", 1, 0.0, 0, 1000.0, 2
int customUseRiseEdge;
bool32_t customUseRiseEdge;
end_struct
trigger_config_s trigger;
!custom spi_device_e
custom spi_device_e 4 bits,U32, @OFFSET@, [0:1], "Off", "SPI1", "SPI2", "SPI3"
spi_device_e hip9011SpiDevice;
adc_channel_e vbattAdcChannel;
float globalFuelCorrection;
float globalFuelCorrection;;"coef", 1, 0.0, 0, 1000.0, 2
adc_channel_e cltAdcChannel;todo: merge with channel settings, use full-scale Thermistor!
@ -212,25 +217,25 @@ float globalFuelCorrection;
adc_channel_e mafAdcChannel;
struct afr_sensor_s
adc_channel_e afrAdcChannel;
float v1;
float value1;
float v2;
float value2;
adc_channel_e hwChannel;
float v1;; "volts", 1, 0.0, 0, 10.0, 2
float value1;; "AFR", 1, 0.0, 0, 1000.0, 2
float v2;; "volts", 1, 0.0, 0, 10.0, 2
float value2;; "AFR", 1, 0.0, 0, 1000.0, 2
end_struct
afr_sensor_s afrSensor;@see hasAfrSensor
float injectionAngle;this is about deciding when the injector starts it's squirt
float crankingTimingAngle;
afr_sensor_s afr;@see hasAfrSensor
float injectionAngle;this is about deciding when the injector starts it's squirt;"deg", 1, 0.0, 0, 1000.0, 2
float crankingTimingAngle;; "deg", 1, 0.0, -360, 360, 2
float diffLoadEnrichmentCoef;
air_pressure_sensor_config_s baroSensor;@see hasBaroSensor
float[FUEL_LOAD_COUNT] veLoadBins;
float[FUEL_RPM_COUNT] veRpmBins;
float[FUEL_LOAD_COUNT] afrLoadBins;
float[FUEL_RPM_COUNT] afrRpmBins;
float[FUEL_LOAD_COUNT] veLoadBins;;1, 0.0, 0, 300.0, 2
float[FUEL_RPM_COUNT] veRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
float[FUEL_LOAD_COUNT] afrLoadBins;;1, 0.0, 0, 300.0, 2
float[FUEL_RPM_COUNT] afrRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
custom fuel_table_t 1024 TODO
custom ignition_table_t 1024 TODO