auto-sync

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

View File

@ -404,13 +404,13 @@ EXTRACT_ALL = YES
# be included in the documentation.
# 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
# scope will be included in the documentation.
# 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
# included in the documentation.

View File

@ -610,7 +610,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->wallFuelAmount = wallFuel.getWallFuel(0);
tsOutputChannels->wallFuelCorrection = engine->wallFuelCorrection;
// TPS acceleration
tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getDelta();
tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getMaxDelta();
tsOutputChannels->tpsAccelFuel = engine->engineState.tpsAccelEnrich;
// engine load acceleration
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];
}
float AccelEnrichmemnt::getDelta() {
float AccelEnrichmemnt::getMaxDelta() {
if (cb.getCount() == 0)
return 0; // no recent data
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.
floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
float d = getDelta();
float d = getMaxDelta();
if (d > engineConfiguration->tpsAccelEnrichmentThreshold) {
return d * engineConfiguration->tpsAccelEnrichmentMultiplier;
}
@ -84,7 +84,7 @@ floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
}
float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F) {
float d = getDelta();
float d = getMaxDelta();
if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) {
return d * engineConfiguration->engineLoadAccelEnrichmentMultiplier;
}
@ -96,18 +96,20 @@ float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F) {
void AccelEnrichmemnt::reset() {
cb.clear();
delta = 0;
currentValue = NAN;
previousValue = NAN;
}
void AccelEnrichmemnt::onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S) {
if (!cisnan(this->currentValue)) {
delta = currentValue - this->currentValue;
if (!cisnan(previousValue)) {
/**
* this could be negative, zero or positive
*/
float delta = currentValue - previousValue;
FuelSchedule *fs = engine->engineConfiguration2->injectionEvents;
cb.add(delta * fs->eventsCount);
}
this->currentValue = currentValue;
previousValue = currentValue;
}
void AccelEnrichmemnt::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F) {

View File

@ -27,17 +27,16 @@ public:
* @return Extra fuel squirt duration for TPS acceleration
*/
floatms_t getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F);
float getDelta();
float getMaxDelta();
void onEngineCycle(DECLARE_ENGINE_PARAMETER_F);
void onEngineCycleTps(DECLARE_ENGINE_PARAMETER_F);
void reset();
float delta;
cyclic_buffer<float> cb;
void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S);
private:
float currentValue;
void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_S);
float previousValue;
};
class WallFuel {
@ -52,7 +51,7 @@ public:
void reset();
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];
};

View File

@ -176,7 +176,7 @@ static ALWAYS_INLINE void handleFuel(bool limitedFuel, uint32_t eventIndex, int
if (!fs->hasEvents[eventIndex])
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(fuelMs) = getFuelMs(rpm PASS_ENGINE_PARAMETER) * CONFIG(globalFuelCorrection);