diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index d530cde29d..50568aa393 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -121,6 +121,8 @@ case Force_4b_trigger_type: return "Force_4b_trigger_type"; case TT_HONDA_CBR_600: return "TT_HONDA_CBR_600"; +case TT_HONDA_CBR_600_CUSTOM: + return "TT_HONDA_CBR_600_CUSTOM"; case TT_DODGE_NEON_1995: return "TT_DODGE_NEON_1995"; case TT_GM_LS_24: diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 8e99857689..fbab18482c 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -183,7 +183,9 @@ typedef enum { TT_2JZ_1_12 = 29, - TT_UNUSED = 30, // this is used if we want to iterate over all trigger types + TT_HONDA_CBR_600_CUSTOM = 30, + + TT_UNUSED = 31, // this is used if we want to iterate over all trigger types Force_4b_trigger_type = ENUM_32_BITS, diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 9026ebbb04..fcebe9571b 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -512,6 +512,10 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET configureHondaCbr600(triggerShape PASS_ENGINE_PARAMETER); break; + case TT_HONDA_CBR_600_CUSTOM: + configureHondaCbr600custom(triggerShape PASS_ENGINE_PARAMETER); + break; + case TT_MITSU: initializeMitsubishi4g18(triggerShape); break; diff --git a/firmware/controllers/trigger/trigger_honda.cpp b/firmware/controllers/trigger/trigger_honda.cpp index 31d8b06512..974cbe4a27 100644 --- a/firmware/controllers/trigger/trigger_honda.cpp +++ b/firmware/controllers/trigger/trigger_honda.cpp @@ -169,4 +169,77 @@ void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) { } +void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) { + + float w = 720 / 2 / 24; +// s->initialize(FOUR_STROKE_CAM_SENSOR, false); + s->initialize(FOUR_STROKE_CAM_SENSOR, true); + + s->useOnlyPrimaryForSync = true; + s->isSynchronizationNeeded = true; + s->setTriggerSynchronizationGap2(0.7, 1); + + float a = 0; + + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + a += w; + s->addEvent(a - 1, T_SECONDARY, TV_FALL); // 30 + + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + s->addEvent(52.4, T_PRIMARY, TV_FALL); + a += w; + s->addEvent(a - 1, T_SECONDARY, TV_FALL); // 60 + + for (int i = 0;i<10;i++) { + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + a += w; + s->addEvent(a, T_SECONDARY, TV_FALL); + } + + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + + s->addEvent(381.34f, T_PRIMARY, TV_RISE); + + a += w; + s->addEvent(a - 1, T_SECONDARY, TV_FALL); + + for (int i = 0;i<1;i++) { + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + a += w; + s->addEvent(a, T_SECONDARY, TV_FALL); + } + + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + + + s->addEvent(449.1f, T_PRIMARY, TV_FALL); + + a += w; + s->addEvent(a, T_SECONDARY, TV_FALL); + + + for (int i = 0;i<8;i++) { + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + a += w; + s->addEvent(a, T_SECONDARY, TV_FALL); + } + + a += w; + s->addEvent(a, T_SECONDARY, TV_RISE); + a += w; + s->addEvent(a - 1, T_SECONDARY, TV_FALL); + + + s->addEvent(720.0f, T_PRIMARY, TV_RISE); + +} + + diff --git a/firmware/controllers/trigger/trigger_honda.h b/firmware/controllers/trigger/trigger_honda.h index e13e0bd1eb..bfcfa5bcb2 100644 --- a/firmware/controllers/trigger/trigger_honda.h +++ b/firmware/controllers/trigger/trigger_honda.h @@ -17,5 +17,6 @@ void configureHondaAccordCD(TriggerShape *s, bool withOneEventSignal, bool withF float d); void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_S); +void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_S); #endif /* CONTROLLERS_TRIGGER_TRIGGER_HONDA_H_ */