auto-sync

This commit is contained in:
rusEfi 2015-07-13 21:01:37 -04:00
parent b3bb926ee8
commit b0c21ac9a0
2 changed files with 10 additions and 37 deletions

View File

@ -26,41 +26,12 @@ void initDodgeRam(TriggerShape *s) {
void configureNeon2003TriggerShape(TriggerShape *s) {
s->reset(FOUR_STROKE_CAM_SENSOR, false);
// voodoo magic - we always need 720 at the end
int base = 10;
float b = 0;
s->useRiseEdge = true;
s->gapBothDirections = true;
// are these non-default values really needed here now that the gap is finally precise?
s->setTriggerSynchronizationGap2(0.5 * CHRYSLER_NGC_GAP, 1.5 * CHRYSLER_NGC_GAP);
/*
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);
*
*/
s->addEvent(143.0712499, T_PRIMARY, TV_HIGH);
s->addEvent(182.684791, T_PRIMARY, TV_LOW);

View File

@ -42,9 +42,6 @@
static NamedOutputPin intHold("HIP");
static OutputPin hipCs;
extern pin_output_mode_e DEFAULT_OUTPUT;
extern pin_output_mode_e OPENDRAIN_OUTPUT;
extern uint32_t lastExecutionCount;
uint32_t hipLastExecutionCount;
@ -169,15 +166,19 @@ void setHip9011FrankensoPinout(void) {
/**
* SPI on PB13/14/15
*/
// boardConfiguration->hip9011CsPin = GPIOD_0; // rev 0.1
boardConfiguration->isHip9011Enabled = true;
boardConfiguration->hip9011CsPin = GPIOD_0;
boardConfiguration->hip9011CsPin = GPIOB_0; // rev 0.4
boardConfiguration->hip9011CsPinMode = OM_OPENDRAIN;
engineConfiguration->hip9011PrescalerAndSDO = 6; // 8MHz chip
boardConfiguration->hip9011IntHoldPin = GPIOB_11;
boardConfiguration->hip9011IntHoldPinMode = OM_OPENDRAIN;
boardConfiguration->is_enabled_spi_2 = true;
engineConfiguration->spi2SckMode = PAL_STM32_OTYPE_OPENDRAIN;
engineConfiguration->spi2MosiMode = PAL_STM32_OTYPE_OPENDRAIN;
engineConfiguration->spi2MisoMode = PAL_STM32_PUDR_PULLUP;
// todo: convert this to rusEfi, hardware-independent enum
engineConfiguration->spi2SckMode = PAL_STM32_OTYPE_OPENDRAIN; // 4
engineConfiguration->spi2MosiMode = PAL_STM32_OTYPE_OPENDRAIN; // 4
engineConfiguration->spi2MisoMode = PAL_STM32_PUDR_PULLUP; // 32
boardConfiguration->hip9011Gain = 1;
engineConfiguration->knockVThreshold = 4;
@ -424,7 +425,8 @@ void initHip9011(Logging *sharedLogger) {
outputPinRegisterExt2("hip int/hold", &intHold, boardConfiguration->hip9011IntHoldPin,
&boardConfiguration->hip9011IntHoldPinMode);
outputPinRegisterExt2("hip CS", &hipCs, boardConfiguration->hip9011CsPin, &OPENDRAIN_OUTPUT);
outputPinRegisterExt2("hip CS", &hipCs, boardConfiguration->hip9011CsPin,
&boardConfiguration->hip9011CsPinMode);
scheduleMsg(logger, "Starting HIP9011/TPIC8101 driver");
spiStart(driver, &spicfg);