auto-sync

This commit is contained in:
rusEfi 2015-02-20 16:04:34 -06:00
parent b7d2096fe2
commit 1ca69ed21c
4 changed files with 18 additions and 10 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