auto-sync
This commit is contained in:
parent
15d66ea45e
commit
3de8376079
|
@ -399,6 +399,9 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
engineConfiguration->canReadEnabled = false;
|
||||
engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
|
||||
// engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
|
||||
|
||||
|
||||
engineConfiguration->accelLength = 12;
|
||||
}
|
||||
|
||||
#endif /* EFI_SUPPORT_DODGE_NEON */
|
||||
|
|
|
@ -22,29 +22,52 @@ EXTERN_ENGINE
|
|||
//#endif
|
||||
|
||||
static AccelEnrichmemnt instance;
|
||||
static Logging *logger;
|
||||
|
||||
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||
|
||||
static void accelInfo() {
|
||||
scheduleMsg(logger, "accel length=%d", instance.cb.getSize());
|
||||
scheduleMsg(logger, "accel th=%f/mult=%f", engineConfiguration->accelEnrichmentThreshold, engineConfiguration->accelEnrichmentMultiplier);
|
||||
scheduleMsg(logger, "decel th=%f/mult=%f", engineConfiguration->decelEnrichmentThreshold, engineConfiguration->decelEnrichmentMultiplier);
|
||||
}
|
||||
|
||||
static void setAccelThr(float value) {
|
||||
engineConfiguration->accelEnrichmentThreshold = value;
|
||||
accelInfo();
|
||||
}
|
||||
|
||||
static void setAccelMult(float value) {
|
||||
engineConfiguration->accelEnrichmentMultiplier = value;
|
||||
accelInfo();
|
||||
}
|
||||
|
||||
static void setDecelThr(float value) {
|
||||
engineConfiguration->deaccelEnrichmentThreshold = value;
|
||||
engineConfiguration->decelEnrichmentThreshold = value;
|
||||
accelInfo();
|
||||
}
|
||||
|
||||
static void setDecelMult(float value) {
|
||||
engineConfiguration->deaccelEnrichmentMultiplier = value;
|
||||
engineConfiguration->decelEnrichmentMultiplier = value;
|
||||
accelInfo();
|
||||
}
|
||||
|
||||
void initAccelEnrichment(void) {
|
||||
static void setAccelLen(int len) {
|
||||
instance.cb.setSize(len);
|
||||
accelInfo();
|
||||
}
|
||||
|
||||
void initAccelEnrichment(Logging *sharedLogger) {
|
||||
logger = sharedLogger;
|
||||
addConsoleActionF("set_accel_th", setAccelThr);
|
||||
addConsoleActionF("set_accel_mult", setAccelMult);
|
||||
addConsoleActionF("set_decel_th", setDecelThr);
|
||||
addConsoleActionF("set_decel_mult", setDecelMult);
|
||||
addConsoleActionI("set_accel_len", setAccelLen);
|
||||
addConsoleAction("accelinfo", accelInfo);
|
||||
|
||||
setAccelLen(engineConfiguration->accelLength);
|
||||
|
||||
}
|
||||
#endif /* ! EFI_UNIT_TEST */
|
||||
|
||||
|
@ -63,13 +86,13 @@ void AccelEnrichmemnt::updateDiffEnrichment(engine_configuration_s *engineConfig
|
|||
//}
|
||||
|
||||
float AccelEnrichmemnt::getEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float d = delta;
|
||||
float d = cb.maxValue(cb.getSize());
|
||||
if (d > engineConfiguration->accelEnrichmentThreshold) {
|
||||
return d * engineConfiguration->accelEnrichmentMultiplier;
|
||||
}
|
||||
if (d < engineConfiguration->deaccelEnrichmentThreshold) {
|
||||
return d * engineConfiguration->deaccelEnrichmentMultiplier;
|
||||
}
|
||||
// if (d < engineConfiguration->deaccelEnrichmentThreshold) {
|
||||
// return d * engineConfiguration->deaccelEnrichmentMultiplier;
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -85,6 +108,7 @@ void AccelEnrichmemnt::onEngineCycle(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
if (!cisnan(this->currentEngineLoad)) {
|
||||
delta = currentEngineLoad - this->currentEngineLoad;
|
||||
cb.add(delta);
|
||||
maxDelta = maxF(maxDelta, delta);
|
||||
minDelta = minF(minDelta, delta);
|
||||
}
|
||||
|
|
|
@ -29,14 +29,14 @@ public:
|
|||
float maxDelta;
|
||||
float minDelta;
|
||||
float delta;
|
||||
cyclic_buffer<float> cb;
|
||||
|
||||
private:
|
||||
// float array[MAX_ACCEL_ARRAY_SIZE];
|
||||
float diffEnrichment;
|
||||
cyclic_buffer<float> cb;
|
||||
};
|
||||
|
||||
void initAccelEnrichment(void);
|
||||
void initAccelEnrichment(Logging *sharedLogger);
|
||||
float getAccelEnrichment(void);
|
||||
|
||||
#endif /* ACC_ENRICHMENT_H_ */
|
||||
|
|
|
@ -545,7 +545,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
boardConfiguration->isFastAdcEnabled = true;
|
||||
boardConfiguration->isEngineControlEnabled = true;
|
||||
|
||||
boardConfiguration->isVerboseAlternator = true;
|
||||
boardConfiguration->isVerboseAlternator = false;
|
||||
|
||||
boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// this section was generated by config_definition.jar on Sun Mar 22 19:43:37 EDT 2015
|
||||
// this section was generated by config_definition.jar on Sat Mar 28 17:28:27 EDT 2015
|
||||
// begin
|
||||
#include "rusefi_types.h"
|
||||
typedef struct {
|
||||
|
@ -1100,11 +1100,11 @@ typedef struct {
|
|||
/**
|
||||
* offset 5784
|
||||
*/
|
||||
float deaccelEnrichmentThreshold;
|
||||
float decelEnrichmentThreshold;
|
||||
/**
|
||||
* offset 5788
|
||||
*/
|
||||
float deaccelEnrichmentMultiplier;
|
||||
float decelEnrichmentMultiplier;
|
||||
/**
|
||||
* offset 5792
|
||||
*/
|
||||
|
@ -1196,4 +1196,4 @@ typedef struct {
|
|||
} engine_configuration_s;
|
||||
|
||||
// end
|
||||
// this section was generated by config_definition.jar on Sun Mar 22 19:43:37 EDT 2015
|
||||
// this section was generated by config_definition.jar on Sat Mar 28 17:28:27 EDT 2015
|
||||
|
|
|
@ -516,6 +516,8 @@ void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
|||
|
||||
addConsoleAction("analoginfo", printAnalogInfo);
|
||||
|
||||
initAccelEnrichment(sharedLogger);
|
||||
|
||||
initConfigActions();
|
||||
#if EFI_PROD_CODE
|
||||
addConsoleAction("reset_accel", resetAccel);
|
||||
|
|
Loading…
Reference in New Issue