diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index b5875658e7..bf909da2ed 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -196,6 +196,11 @@ void setEngineLoadAccelLen(int len) { accelInfo(); } +void updateAccelParameters() { + setEngineLoadAccelLen(engineConfiguration->engineLoadAccelLength); + setTpsAccelLen(engineConfiguration->tpsAccelLength); +} + void initAccelEnrichment(Logging *sharedLogger) { logger = sharedLogger; addConsoleActionI("set_tps_accel_len", setTpsAccelLen); @@ -211,10 +216,6 @@ void initAccelEnrichment(Logging *sharedLogger) { addConsoleActionF("set_engine_decel_multiplier", setDecelMult); addConsoleAction("accelinfo", accelInfo); - /** - * This would initialize data structures - */ - setEngineLoadAccelLen(engineConfiguration->engineLoadAccelLength); - setTpsAccelLen(engineConfiguration->tpsAccelLength); + updateAccelParameters(); } #endif /* ! EFI_UNIT_TEST */ diff --git a/firmware/controllers/algo/accel_enrichment.h b/firmware/controllers/algo/accel_enrichment.h index 0046073c4a..3340eaf124 100644 --- a/firmware/controllers/algo/accel_enrichment.h +++ b/firmware/controllers/algo/accel_enrichment.h @@ -61,6 +61,7 @@ void initAccelEnrichment(Logging *sharedLogger); void setEngineLoadAccelLen(int len); void setEngineLoadAccelThr(float value); void setEngineLoadAccelMult(float value); +void updateAccelParameters(); #endif /* ACC_ENRICHMENT_H_ */