auto-sync

This commit is contained in:
rusEfi 2016-01-31 13:03:08 -05:00
parent 7fc6885fd6
commit 5f2be6983d
5 changed files with 18 additions and 17 deletions

View File

@ -404,13 +404,13 @@ EXTRACT_ALL = YES
# be included in the documentation. # be included in the documentation.
# The default value is: NO. # The default value is: NO.
EXTRACT_PRIVATE = NO EXTRACT_PRIVATE = YES
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
# scope will be included in the documentation. # scope will be included in the documentation.
# The default value is: NO. # The default value is: NO.
EXTRACT_PACKAGE = NO EXTRACT_PACKAGE = YES
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be # If the EXTRACT_STATIC tag is set to YES all static members of a file will be
# included in the documentation. # included in the documentation.

View File

@ -610,7 +610,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->wallFuelAmount = wallFuel.getWallFuel(0); tsOutputChannels->wallFuelAmount = wallFuel.getWallFuel(0);
tsOutputChannels->wallFuelCorrection = engine->wallFuelCorrection; tsOutputChannels->wallFuelCorrection = engine->wallFuelCorrection;
// TPS acceleration // TPS acceleration
tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getDelta(); tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getMaxDelta();
tsOutputChannels->tpsAccelFuel = engine->engineState.tpsAccelEnrich; tsOutputChannels->tpsAccelFuel = engine->engineState.tpsAccelEnrich;
// engine load acceleration // engine load acceleration
tsOutputChannels->engineLoadAccelDelta = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap(); tsOutputChannels->engineLoadAccelDelta = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap();

View File

@ -65,7 +65,7 @@ floatms_t WallFuel::getWallFuel(int injectorIndex) {
return wallFuel[injectorIndex]; return wallFuel[injectorIndex];
} }
float AccelEnrichmemnt::getDelta() { float AccelEnrichmemnt::getMaxDelta() {
if (cb.getCount() == 0) if (cb.getCount() == 0)
return 0; // no recent data return 0; // no recent data
return cb.maxValue(cb.getSize()); return cb.maxValue(cb.getSize());
@ -73,7 +73,7 @@ float AccelEnrichmemnt::getDelta() {
// todo: eliminate code duplication between these two methods! Some pointer magic would help. // todo: eliminate code duplication between these two methods! Some pointer magic would help.
floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) { floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
float d = getDelta(); float d = getMaxDelta();
if (d > engineConfiguration->tpsAccelEnrichmentThreshold) { if (d > engineConfiguration->tpsAccelEnrichmentThreshold) {
return d * engineConfiguration->tpsAccelEnrichmentMultiplier; return d * engineConfiguration->tpsAccelEnrichmentMultiplier;
} }
@ -84,7 +84,7 @@ floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
} }
float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F) { float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F) {
float d = getDelta(); float d = getMaxDelta();
if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) { if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) {
return d * engineConfiguration->engineLoadAccelEnrichmentMultiplier; return d * engineConfiguration->engineLoadAccelEnrichmentMultiplier;
} }
@ -96,18 +96,20 @@ float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F) {
void AccelEnrichmemnt::reset() { void AccelEnrichmemnt::reset() {
cb.clear(); cb.clear();
delta = 0; previousValue = NAN;
currentValue = NAN;
} }
void AccelEnrichmemnt::onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S) { void AccelEnrichmemnt::onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S) {
if (!cisnan(this->currentValue)) { if (!cisnan(previousValue)) {
delta = currentValue - this->currentValue; /**
* this could be negative, zero or positive
*/
float delta = currentValue - previousValue;
FuelSchedule *fs = engine->engineConfiguration2->injectionEvents; FuelSchedule *fs = engine->engineConfiguration2->injectionEvents;
cb.add(delta * fs->eventsCount); cb.add(delta * fs->eventsCount);
} }
this->currentValue = currentValue; previousValue = currentValue;
} }
void AccelEnrichmemnt::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F) { void AccelEnrichmemnt::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F) {

View File

@ -27,17 +27,16 @@ public:
* @return Extra fuel squirt duration for TPS acceleration * @return Extra fuel squirt duration for TPS acceleration
*/ */
floatms_t getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F); floatms_t getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F);
float getDelta(); float getMaxDelta();
void onEngineCycle(DECLARE_ENGINE_PARAMETER_F); void onEngineCycle(DECLARE_ENGINE_PARAMETER_F);
void onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F); void onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F);
void reset(); void reset();
float delta;
cyclic_buffer<float> cb; cyclic_buffer<float> cb;
void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S);
private: private:
float currentValue; float previousValue;
void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S);
}; };
class WallFuel { class WallFuel {
@ -52,7 +51,7 @@ public:
void reset(); void reset();
private: private:
/** /**
* Amount of fuel on the wall, in injector open time scale, for specific injector. * Amount of fuel on the wall, in ms of injector open time, for specific injector.
*/ */
floatms_t wallFuel[INJECTION_PIN_COUNT]; floatms_t wallFuel[INJECTION_PIN_COUNT];
}; };

View File

@ -176,7 +176,7 @@ static ALWAYS_INLINE void handleFuel(bool limitedFuel, uint32_t eventIndex, int
if (!fs->hasEvents[eventIndex]) if (!fs->hasEvents[eventIndex])
return; return;
ENGINE(tpsAccelEnrichment.onEngineCycleTps(PASS_ENGINE_PARAMETER_F)); ENGINE(tpsAccelEnrichment.onNewValue(getTPS(PASS_ENGINE_PARAMETER_F) PASS_ENGINE_PARAMETER));
ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_F)); ENGINE(engineLoadAccelEnrichment.onEngineCycle(PASS_ENGINE_PARAMETER_F));
ENGINE(fuelMs) = getFuelMs(rpm PASS_ENGINE_PARAMETER) * CONFIG(globalFuelCorrection); ENGINE(fuelMs) = getFuelMs(rpm PASS_ENGINE_PARAMETER) * CONFIG(globalFuelCorrection);