auto-sync

This commit is contained in:
rusEfi 2015-02-20 16:04:34 -06:00
parent 399323a363
commit 1ce18aed19
5 changed files with 22 additions and 12 deletions

View File

@ -25,11 +25,11 @@ static AccelEnrichmemnt instance;
void AccelEnrichmemnt::updateDiffEnrichment(engine_configuration_s *engineConfiguration, float engineLoad) {
for (int i = 3; i == 1; i--)
engineLoadD[i] = engineLoadD[i - 1];
array[i] = array[i - 1];
engineLoadD[0] = engineLoad;
array[0] = engineLoad;
diffEnrichment = ((3 * (engineLoadD[0] - engineLoadD[1]) + (engineLoadD[2] - engineLoadD[3])) / 4)
diffEnrichment = ((3 * (array[0] - array[1]) + (array[2] - array[3])) / 4)
* (engineConfiguration->diffLoadEnrichmentCoef);
}
@ -69,8 +69,8 @@ void AccelEnrichmemnt::onEngineCycle(DECLARE_ENGINE_PARAMETER_F) {
AccelEnrichmemnt::AccelEnrichmemnt() {
reset();
for (int i = 0; i < 4; i++)
engineLoadD[i] = 0;
for (int i = 0; i < MAX_ACCEL_ARRAY_SIZE; i++)
array[i] = 0;
diffEnrichment = 0;
}

View File

@ -12,6 +12,8 @@
#include "engine_configuration.h"
#define MAX_ACCEL_ARRAY_SIZE 64
class AccelEnrichmemnt {
public:
AccelEnrichmemnt();
@ -28,7 +30,7 @@ public:
float delta;
private:
float engineLoadD[4];
float array[MAX_ACCEL_ARRAY_SIZE];
float diffEnrichment;
};

View File

@ -1,4 +1,4 @@
// this section was generated by config_definition.jar on Thu Feb 19 20:24:50 EST 2015
// this section was generated by config_definition.jar on Fri Feb 20 16:22:15 EST 2015
// begin
#include "rusefi_types.h"
typedef struct {
@ -1068,7 +1068,11 @@ typedef struct {
/**
* offset 5204
*/
int unused3[145];
int unused3[144];
/**
* offset 5780
*/
int accelLength;
/**
* offset 5784
*/
@ -1180,4 +1184,4 @@ typedef struct {
} engine_configuration_s;
// end
// this section was generated by config_definition.jar on Thu Feb 19 20:24:50 EST 2015
// this section was generated by config_definition.jar on Fri Feb 20 16:22:15 EST 2015

View File

@ -469,7 +469,9 @@ bit hasMapSensor;@see isMapAveragingEnabled
custom pin_input_mode_e 4 scalar, F32, @OFFSET@, "ms", 1, 0, 0, 200, 1
pin_input_mode_e[LE_COMMAND_COUNT iterate] fsioInputModes;
int[145] unused3;
int[144] unused3;
int accelLength;;"len", 1, 0, 0, 200, 3
float deaccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3
float deaccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3

View File

@ -37,7 +37,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated by ConfigDefinition.jar on Thu Feb 19 20:24:53 EST 2015
; this section was generated by ConfigDefinition.jar on Fri Feb 20 16:22:16 EST 2015
pageSize = 15160
page = 1
@ -459,6 +459,7 @@ page = 1
fsioInputModes15 = scalar, F32, 5196, "ms", 1, 0, 0, 200, 1
fsioInputModes16 = scalar, F32, 5200, "ms", 1, 0, 0, 200, 1
;skipping unused3 offset 5204
accelLength = scalar, S32, 5780, "len", 1, 0, 0, 200, 3
deaccelEnrichmentThreshold = scalar, F32, 5784, "roc", 1, 0, 0, 200, 3
deaccelEnrichmentMultiplier = scalar, F32, 5788, "coeff", 1, 0, 0, 200, 3
accelEnrichmentThreshold = scalar, F32, 5792, "roc", 1, 0, 0, 200, 3
@ -744,7 +745,7 @@ fileVersion = { 20150216 }
VBattGauge = VBatt, "Battery Voltage", "V", 8, 21, 9, 10, 17, 19, 1, 1
tpsADCGauge = tpsADC, "tps ADC", "ADC", 0, 1024, 0, 0, 0, 0, 0, 0
atmPresCGauge = atmPres, "atmo pressu", "kPa", 0, 1024, 0, 0, 0, 0, 0, 0
mapGaugeValue = MAPValue, "MAP", "kPa", 0, 300, 0, 300, 300, 0, 0, 0
mapGaugeValue = MAPValue, "MAP", "kPa", 0, 300, 10, 10, 200, 200, 0, 0
pulseWidthGauge = pulseWidth, "Pulse Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
baseFuelGauge = baseFuel, "Base Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
crankingFuelGauge = crankingFuel, "crank Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
@ -907,6 +908,7 @@ fileVersion = { 20150216 }
field = "Timing Mode", timingMode
field = ""
field = "Global fuel correction", globalFuelCorrection
field = "accel length", accelLength
field = "Accel threshold", accelEnrichmentThreshold
field = "Accel Mult", accelEnrichmentMultiplier
; field = "RPM Multiplier", rpmMultiplier