diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index f5e4d840e2..75cc221a43 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -45,8 +45,8 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->injector.flow = 330; engineConfiguration->specs.displacement = 2.0; - // set_global_trigger_offset_angle 284 - engineConfiguration->globalTriggerAngleOffset = 284; + // set_global_trigger_offset_angle 106 + engineConfiguration->globalTriggerAngleOffset = 106; // set_ignition_mode 2 engineConfiguration->ignitionMode = IM_WASTED_SPARK; @@ -55,9 +55,9 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->crankingChargeAngle = 70; // set_cranking_fuel 9 - engineConfiguration->cranking.baseFuel = 9; + engineConfiguration->cranking.baseFuel = 2.5; - engineConfiguration->rpmHardLimit = 6000; + engineConfiguration->rpmHardLimit = 7400; engineConfiguration->tpsMin = 80; engineConfiguration->tpsMax = 764; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index f68092e661..37b2557049 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -346,6 +346,9 @@ extern uint32_t hwSetTimerTime; extern int maxHowFarOff; extern uint32_t *cyccnt; +extern int vvtEventRiseCounter; +extern int vvtEventFallCounter; + void triggerInfo(void) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) @@ -391,11 +394,11 @@ void triggerInfo(void) { #if EFI_PROD_CODE || defined(__DOXYGEN__) if (engineConfiguration->camInput != GPIO_UNASSIGNED) { - scheduleMsg(logger, "CAM input: %s", hwPortname(engineConfiguration->camInput)); + scheduleMsg(logger, "VVT input: %s", hwPortname(engineConfiguration->camInput)); + scheduleMsg(logger, "VVT event counters: %d/%d", vvtEventRiseCounter, vvtEventFallCounter); } - scheduleMsg(logger, "primary trigger input: %s", hwPortname(boardConfiguration->triggerInputPins[0])); scheduleMsg(logger, "primary trigger simulator: %s %s freq=%d", hwPortname(boardConfiguration->triggerSimulatorPins[0]), diff --git a/firmware/hw_layer/trigger_input.cpp b/firmware/hw_layer/trigger_input.cpp index da547fe199..8d8897f17b 100644 --- a/firmware/hw_layer/trigger_input.cpp +++ b/firmware/hw_layer/trigger_input.cpp @@ -27,11 +27,16 @@ EXTERN_ENGINE ; static Logging *logger; +int vvtEventRiseCounter = 0; +int vvtEventFallCounter = 0; + static void cam_icu_width_callback(ICUDriver *icup) { + vvtEventRiseCounter++; hwHandleVvtCamSignal(TV_RISE); } static void cam_icu_period_callback(ICUDriver *icup) { + vvtEventFallCounter++; hwHandleVvtCamSignal(TV_FALL); } diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index c43564d6df..4f416f33d2 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -293,5 +293,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20160915; + return 20160917; } diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 17fef18973..b890fde9c4 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1440,7 +1440,7 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" field = "#Cam is primary if you have cam sensor" field = "Primary input channel", triggerInputPins1 field = "Secondary channel", triggerInputPins2 - field = "CAM input", camInput + field = "VVT input", camInput field = "VVT mode", vvtMode, {trigger_type != 80} field = "VVT use rise front", vvtCamSensorUseRise, {trigger_type != 80} field = "Trigger error LED", triggerErrorPin