fome-fw/firmware/controllers/trigger/trigger_chrysler.cpp

103 lines
3.2 KiB
C++
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
* @file trigger_chrysler.cpp
*
* @date Mar 24, 2014
2015-01-12 15:04:10 -08:00
* @author Andrey Belomutskiy, (c) 2012-2015
2014-08-29 07:52:33 -07:00
*/
#include "trigger_chrysler.h"
2015-01-13 05:04:00 -08:00
void configureNeon2003TriggerShape(TriggerShape *s) {
2015-02-02 21:04:02 -08:00
s->reset(FOUR_STROKE_CAM_SENSOR, true);
2014-10-01 16:03:00 -07:00
2014-10-01 17:02:58 -07:00
// voodoo magic - we always need 720 at the end
int base = 10;
2014-11-02 12:03:03 -08:00
s->useRiseEdge = true;
2014-11-03 11:03:05 -08:00
s->invertOnAdd = true;
2014-10-01 17:02:58 -07:00
2014-10-29 14:03:10 -07:00
s->gapBothDirections = true;
2014-12-16 18:05:03 -08:00
// are these non-default values really needed here now that the gap is finally precise?
2015-02-05 07:04:08 -08:00
s->setTriggerSynchronizationGap2(0.8 * CHRYSLER_NGC_GAP, 1.55 * CHRYSLER_NGC_GAP);
2014-10-01 17:02:58 -07:00
s->addEvent(base + 26, T_PRIMARY, TV_HIGH);
s->addEvent(base + 62, T_PRIMARY, TV_LOW);
s->addEvent(base + 98, T_PRIMARY, TV_HIGH);
s->addEvent(base + 134, T_PRIMARY, TV_LOW);
s->addEvent(base + 180, T_PRIMARY, TV_HIGH);
s->addEvent(base + 314, T_PRIMARY, TV_LOW);
s->addEvent(base + 350, T_PRIMARY, TV_HIGH);
s->addEvent(base + 386, T_PRIMARY, TV_LOW);
s->addEvent(base + 422, T_PRIMARY, TV_HIGH);
s->addEvent(base + 458, T_PRIMARY, TV_LOW);
s->addEvent(base + 494, T_PRIMARY, TV_HIGH);
s->addEvent(base + 530, T_PRIMARY, TV_LOW);
s->addEvent(base + 674, T_PRIMARY, TV_HIGH);
s->addEvent(base + 710, T_PRIMARY, TV_LOW);
2014-10-01 16:03:00 -07:00
}
2015-01-13 05:04:00 -08:00
void configureNeon1995TriggerShape(TriggerShape *s) {
2015-02-02 21:04:02 -08:00
s->reset(FOUR_STROKE_CAM_SENSOR, true);
2014-08-29 07:52:33 -07:00
2015-02-05 07:04:08 -08:00
s->setTriggerSynchronizationGap(0.72);
2014-08-29 07:52:33 -07:00
s->useRiseEdge = false;
// voodoo magic - we always need 720 at the end
int base = 720 - 560;
s->initialState[T_PRIMARY] = 1;
s->addEvent(base - 720 + 600, T_SECONDARY, TV_HIGH);
s->addEvent(base - 720 + 604, T_SECONDARY, TV_LOW);
s->addEvent(base - 720 + 616, T_SECONDARY, TV_HIGH);
s->addEvent(base - 720 + 620, T_SECONDARY, TV_LOW);
s->addEvent(base - 720 + 643, T_SECONDARY, TV_HIGH);
s->addEvent(base - 720 + 648, T_SECONDARY, TV_LOW);
s->addEvent(base - 720 + 671, T_SECONDARY, TV_HIGH);
s->addEvent(base - 720 + 676, T_SECONDARY, TV_LOW);
s->addEvent(base + 0, T_PRIMARY, TV_LOW);
s->addEvent(base + 20, T_SECONDARY, TV_HIGH);
s->addEvent(base + 60, T_SECONDARY, TV_LOW);
s->addEvent(base + 75, T_SECONDARY, TV_HIGH);
s->addEvent(base + 79, T_SECONDARY, TV_LOW);
s->addEvent(base + 101, T_SECONDARY, TV_HIGH);
s->addEvent(base + 106, T_SECONDARY, TV_LOW);
s->addEvent(base + 130, T_SECONDARY, TV_HIGH);
s->addEvent(base + 135, T_SECONDARY, TV_LOW);
s->addEvent(base + 200, T_PRIMARY, TV_HIGH); // width = 150
s->addEvent(base + 236, T_SECONDARY, TV_HIGH);
s->addEvent(base + 239, T_SECONDARY, TV_LOW);
s->addEvent(base + 250, T_SECONDARY, TV_HIGH);
s->addEvent(base + 255, T_SECONDARY, TV_LOW);
s->addEvent(base + 277, T_SECONDARY, TV_HIGH);
s->addEvent(base + 282, T_SECONDARY, TV_LOW);
s->addEvent(base + 305, T_SECONDARY, TV_HIGH);
s->addEvent(base + 310, T_SECONDARY, TV_LOW);
s->addEvent(base + 374, T_SECONDARY, TV_HIGH);
s->addEvent(base + 395, T_PRIMARY, TV_LOW); // width =
s->addEvent(base + 418, T_SECONDARY, TV_LOW);
s->addEvent(base + 436, T_SECONDARY, TV_HIGH);
s->addEvent(base + 441, T_SECONDARY, TV_LOW);
s->addEvent(base + 463, T_SECONDARY, TV_HIGH);
s->addEvent(base + 468, T_SECONDARY, TV_LOW);
s->addEvent(base + 492, T_SECONDARY, TV_HIGH);
s->addEvent(base + 497, T_SECONDARY, TV_LOW);
s->addEvent(base + 560, T_PRIMARY, TV_HIGH); // width =
}