From eabb1d60855600580ec95c178ed59fcb1b5cd4aa Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 7 Apr 2015 09:05:53 -0500 Subject: [PATCH] auto-sync --- firmware/controllers/algo/auto_generated_enums.cpp | 2 ++ firmware/controllers/algo/rusefi_enums.h | 1 + firmware/controllers/settings.cpp | 2 +- firmware/controllers/trigger/trigger_decoder.cpp | 8 ++++++-- firmware/controllers/trigger/trigger_structure.cpp | 4 ++-- firmware/controllers/trigger/trigger_structure.h | 2 +- firmware/integration/rusefi_config.txt | 2 +- firmware/tunerstudio/rusefi.ini | 2 +- 8 files changed, 15 insertions(+), 8 deletions(-) diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index 3706901faf..876e35caa2 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -117,6 +117,8 @@ case TT_TOOTHED_WHEEL_60_2: return "TT_TOOTHED_WHEEL_60_2"; case TT_ONE_PLUS_TOOTHED_WHEEL_60_2: return "TT_ONE_PLUS_TOOTHED_WHEEL_60_2"; +case TT_ONE: + return "TT_ONE"; } return NULL; } diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 71e4dd071f..1888c41223 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -128,6 +128,7 @@ typedef enum { TT_ONE_PLUS_ONE = 16, TT_ONE_PLUS_TOOTHED_WHEEL_60_2 = 17, + TT_ONE = 18, Force_4b_trigger_type = ENUM_32_BITS, } trigger_type_e; diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 1806fe9121..bd84caf5b5 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -495,7 +495,7 @@ static void setTriggerType(int value) { static void setToothedWheel(int total, int skipped) { scheduleMsg(&logger, "toothed: total=%d/skipped=%d", total, skipped); - setToothedWheelConfiguration(&engine->triggerShape, total, skipped, engineConfiguration); + setToothedWheelConfiguration(&engine->triggerShape, total, skipped, engineConfiguration->operationMode); // initializeTriggerShape(&logger, engineConfiguration, engineConfiguration2); incrementGlobalConfigurationVersion(); doPrintConfiguration(engine); diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 19a9b4c744..d0e6a48095 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -354,6 +354,10 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin configureOnePlus60_2(triggerShape, engineConfiguration->operationMode); break; + case TT_ONE: + setToothedWheelConfiguration(triggerShape, 1, 0, engineConfiguration->operationMode); + break; + case TT_MAZDA_SOHC_4: configureMazdaProtegeSOHC(triggerShape); break; @@ -363,11 +367,11 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin break; case TT_TOOTHED_WHEEL_60_2: - setToothedWheelConfiguration(triggerShape, 60, 2, engineConfiguration); + setToothedWheelConfiguration(triggerShape, 60, 2, engineConfiguration->operationMode); break; case TT_TOOTHED_WHEEL_36_1: - setToothedWheelConfiguration(triggerShape, 36, 1, engineConfiguration); + setToothedWheelConfiguration(triggerShape, 36, 1, engineConfiguration->operationMode); break; case TT_HONDA_ACCORD_CD_TWO_WIRES: diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index 4bbecb9e4d..c3a270c44c 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -296,13 +296,13 @@ void multi_wave_s::checkSwitchTimes(int size) { } void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, - engine_configuration_s const *engineConfiguration) { + operation_mode_e operationMode) { #if EFI_ENGINE_CONTROL s->useRiseEdge = true; initializeSkippedToothTriggerShapeExt(s, total, skipped, - engineConfiguration->operationMode); + operationMode); #endif } diff --git a/firmware/controllers/trigger/trigger_structure.h b/firmware/controllers/trigger/trigger_structure.h index 585eb1b338..d465e48d80 100644 --- a/firmware/controllers/trigger/trigger_structure.h +++ b/firmware/controllers/trigger/trigger_structure.h @@ -142,6 +142,6 @@ private: void setTriggerSynchronizationGap(TriggerShape *s, float synchGap); void setTriggerSynchronizationGap2(TriggerShape *s, float syncGapFrom, float syncRatioTo); -void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, engine_configuration_s const *engineConfiguration); +void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, operation_mode_e operationMode); #endif /* TRIGGER_STRUCTURE_H_ */ diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 28ff00499b..cd1ee36665 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -202,7 +202,7 @@ struct trigger_config_s @brief Trigger wheel(s) configuration custom bool32_t 4 bits, U32, @OFFSET@, [0:0], "false", "true" -custom trigger_type_e 4 bits, U32, @OFFSET@, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" +custom trigger_type_e 4 bits, U32, @OFFSET@, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" trigger_type_e type; bit customIsSynchronizationNeeded; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 146c897384..5e9b1ebbda 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -121,7 +121,7 @@ page = 1 tpsAdcChannel = bits, U32, 504, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5" ;skipping overrideCrankingIgnition offset 508 analogChartFrequency = scalar, S32, 512, "index", 1, 0, 0, 300, 0 ; size 4 - trigger_type = bits, U32, 516, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" + trigger_type = bits, U32, 516, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" trigger_customIsSynchronizationNeeded= bits, U32, 520, [0:0], "false", "true" trigger_customNeedSecondTriggerInput= bits, U32, 520, [1:1], "false", "true" trigger_customTotalToothCount = scalar, S32, 524, "number", 1, 0.0, 0, 1000.0, 2