From 19927a8e7044fd769c00590f318558b9d0cbeba3 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 18 Feb 2015 16:04:15 -0600 Subject: [PATCH] auto-sync --- .../controllers/algo/accel_enrichment.cpp | 42 ++++++++++--------- firmware/controllers/algo/accel_enrichment.h | 3 ++ firmware/controllers/algo/engine.h | 3 ++ 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index f47548073c..0d0181da36 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -16,9 +16,9 @@ EXTERN_ENGINE; -#if EFI_PROD_CODE -static THD_WORKING_AREA(aeThreadStack, UTILITY_THREAD_STACK_SIZE); -#endif +//#if EFI_PROD_CODE +//static THD_WORKING_AREA(aeThreadStack, UTILITY_THREAD_STACK_SIZE); +//#endif static AccelEnrichmemnt instance; @@ -36,6 +36,10 @@ float AccelEnrichmemnt::getDiffEnrichment() { return diffEnrichment; } +void AccelEnrichmemnt::onEngineCycle(DECLARE_ENGINE_PARAMETER_F) { + +} + AccelEnrichmemnt::AccelEnrichmemnt() { for (int i = 0; i < 4; i++) engineLoadD[i] = 0; @@ -46,22 +50,22 @@ float getAccelEnrichment(void) { return instance.getDiffEnrichment(); } -#if EFI_PROD_CODE +//#if EFI_PROD_CODE +// +//static msg_t DiffEnrichmentThread(int param) { +// chRegSetThreadName("Diff Enrichment"); +// while (TRUE) { +// instance.updateDiffEnrichment(engineConfiguration, getEngineLoadT(PASS_ENGINE_PARAMETER)); +// chThdSleepMilliseconds(100); +// } +//#if defined __GNUC__ +// return -1; +//#endif +//} -static msg_t DiffEnrichmentThread(int param) { - chRegSetThreadName("Diff Enrichment"); - while (TRUE) { - instance.updateDiffEnrichment(engineConfiguration, getEngineLoadT(PASS_ENGINE_PARAMETER)); - chThdSleepMilliseconds(100); - } -#if defined __GNUC__ - return -1; -#endif -} +//void initDiffEnrichment(void) { +// chThdCreateStatic(aeThreadStack, sizeof(aeThreadStack), LOWPRIO, (tfunc_t) DiffEnrichmentThread, NULL); +//} -void initDiffEnrichment(void) { - chThdCreateStatic(aeThreadStack, sizeof(aeThreadStack), LOWPRIO, (tfunc_t) DiffEnrichmentThread, NULL); -} - -#endif +//#endif diff --git a/firmware/controllers/algo/accel_enrichment.h b/firmware/controllers/algo/accel_enrichment.h index 554eb336b1..7415bfdc02 100644 --- a/firmware/controllers/algo/accel_enrichment.h +++ b/firmware/controllers/algo/accel_enrichment.h @@ -18,6 +18,9 @@ public: void updateDiffEnrichment(engine_configuration_s *engineConfiguration, float engineLoad); float getDiffEnrichment(void); + + void onEngineCycle(DECLARE_ENGINE_PARAMETER_F); + private: float engineLoadD[4]; float diffEnrichment; diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index ebd2193d69..0c24ce4e3f 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -17,6 +17,7 @@ #include "trigger_structure.h" #include "table_helper.h" #include "listener_array.h" +#include "accel_enrichment.h" #define OUTPUT_SIGNAL_MAX_SIZE 45 @@ -131,6 +132,8 @@ public: Thermistor iat; Thermistor clt; + AccelEnrichmemnt accelEnrichment; + /** * Fuel injection duration for current engine cycle */