diff --git a/firmware/controllers/trigger/rpm_calculator.cpp b/firmware/controllers/trigger/rpm_calculator.cpp index 4f9fb7a5a9..1b49d78a33 100644 --- a/firmware/controllers/trigger/rpm_calculator.cpp +++ b/firmware/controllers/trigger/rpm_calculator.cpp @@ -194,6 +194,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, #endif return; } + // todo: wrap this with if (index == 0) statement this would make scAddData logic simpler bool hadRpmRecently = rpmState->isRunning(PASS_ENGINE_PARAMETER_F); @@ -217,6 +218,8 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, rpmState->onNewEngineCycle(); rpmState->lastRpmEventTimeNt = nowNt; #if EFI_SENSOR_CHART || defined(__DOXYGEN__) + // this 'index==0' case is here so that it happens after cycle callback so + // it goes into sniffer report into the first position if (ENGINE(sensorChartMode) == SC_TRIGGER) { scAddData(crankAngle, signal); } diff --git a/firmware/controllers/trigger/trigger_gm.cpp b/firmware/controllers/trigger/trigger_gm.cpp index d5cbc3f4e5..3ec04d3267 100644 --- a/firmware/controllers/trigger/trigger_gm.cpp +++ b/firmware/controllers/trigger/trigger_gm.cpp @@ -43,9 +43,65 @@ void configureGmTriggerShape(TriggerShape *s) { * */ void initGmLS24(TriggerShape *s) { + s->initialize(FOUR_STROKE_CRANK_SENSOR, false); + trigger_wheel_e ch = T_PRIMARY; - // todo: finish this - setToothedWheelConfiguration(s, 24, 0, FOUR_STROKE_CRANK_SENSOR); + /** + * based on http://rusefi.com/forum/viewtopic.php?f=3&t=936&start=30 logs + */ + s->addEvent(22.2733333333334, ch, TV_RISE); + s->addEvent(27.59333333333338, ch, TV_FALL); + s->addEvent(51.18333333333338, ch, TV_RISE); + s->addEvent(57.58333333333338, ch, TV_FALL); + s->addEvent(81.17333333333337, ch, TV_RISE); + s->addEvent(87.61333333333339, ch, TV_FALL); + s->addEvent(111.30666666666671, ch, TV_RISE); + s->addEvent(117.81000000000004, ch, TV_FALL); + s->addEvent(141.50000000000006, ch, TV_RISE); + s->addEvent(148.05666666666673, ch, TV_FALL); + s->addEvent(153.41333333333338, ch, TV_RISE); + s->addEvent(178.29333333333338, ch, TV_FALL); + s->addEvent(183.51000000000005, ch, TV_RISE); + s->addEvent(208.3266666666667, ch, TV_FALL); + s->addEvent(213.50000000000006, ch, TV_RISE); + s->addEvent(238.26000000000005, ch, TV_FALL); + s->addEvent(243.51000000000005, ch, TV_RISE); + s->addEvent(268.27000000000004, ch, TV_FALL); + s->addEvent(273.53666666666675, ch, TV_RISE); + s->addEvent(298.35, ch, TV_FALL); + s->addEvent(321.86333333333334, ch, TV_RISE); + s->addEvent(328.4966666666667, ch, TV_FALL); + s->addEvent(333.81000000000006, ch, TV_RISE); + s->addEvent(358.66, ch, TV_FALL); + s->addEvent(363.8633333333334, ch, TV_RISE); + s->addEvent(388.7033333333334, ch, TV_FALL); + s->addEvent(393.88000000000005, ch, TV_RISE); + s->addEvent(418.62000000000006, ch, TV_FALL); + s->addEvent(441.9566666666667, ch, TV_RISE); + s->addEvent(448.6700000000001, ch, TV_FALL); + s->addEvent(472.1000000000001, ch, TV_RISE); + s->addEvent(478.9333333333334, ch, TV_FALL); + s->addEvent(484.08000000000004, ch, TV_RISE); + s->addEvent(509.1333333333334, ch, TV_FALL); + s->addEvent(514.2666666666667, ch, TV_RISE); + s->addEvent(539.1733333333334, ch, TV_FALL); + s->addEvent(562.5166666666668, ch, TV_RISE); + s->addEvent(569.1133333333333, ch, TV_FALL); + s->addEvent(592.5400000000001, ch, TV_RISE); + s->addEvent(599.1433333333334, ch, TV_FALL); + s->addEvent(622.6300000000001, ch, TV_RISE); + s->addEvent(629.2633333333334, ch, TV_FALL); + s->addEvent(634.6, ch, TV_RISE); + s->addEvent(659.5, ch, TV_FALL); + s->addEvent(683.1133333333333, ch, TV_RISE); + s->addEvent(689.77, ch, TV_FALL); + s->addEvent(695.0666666666667, ch, TV_RISE); + s->addEvent(720.0, ch, TV_FALL); + s->useOnlyPrimaryForSync = true; + + s->setTriggerSynchronizationGap(1.6); + s->setSecondTriggerSynchronizationGap(1); + s->setThirdTriggerSynchronizationGap(2.5); } diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 2fc6676909..e94ac69b5d 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -298,5 +298,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 20160522; + return 20160528; }