auto-sync

This commit is contained in:
rusEfi 2014-08-31 16:04:19 -05:00
parent e0db131319
commit b6d642fb79
4 changed files with 56 additions and 22 deletions

View File

@ -108,9 +108,7 @@ void setFordInline6(engine_configuration_s *engineConfiguration, board_configura
boardConfiguration->triggerInputPins[0] = GPIOA_8;
boardConfiguration->triggerInputPins[1] = GPIOA_5;
boardConfiguration->logicAnalyzerPins[0] = GPIOC_6;
boardConfiguration->logicAnalyzerPins[1] = GPIOE_7;
boardConfiguration->logicAnalyzerPins[1] = GPIOE_5;
}
#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */

View File

@ -27,6 +27,30 @@ static void setDefaultCrankingFuel(engine_configuration_s *engineConfiguration)
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
}
static void commonMiataNa(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NA;
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// Frankenstein: high side #1 is PE8
// Frankenstein: high side #2 is PE10
// Frankenstein: high side #3 is PE12
// Frankenstein: high side #4 is PE14
// Frankenstein: high side #5 is PC9
// Frankenstein: high side #6 is PC7
boardConfiguration->ignitionPins[0] = GPIOE_12; // Frankenstein: high side #3
boardConfiguration->ignitionPins[1] = GPIOE_14; // Frankenstein: high side #4
boardConfiguration->ignitionPins[2] = GPIO_NONE;
boardConfiguration->ignitionPins[3] = GPIO_NONE;
boardConfiguration->ignitionPinMode = OM_DEFAULT;
setDefaultCrankingFuel(engineConfiguration);
boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;
}
static void common079721_2351(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->digitalChartSize = 150;
@ -59,23 +83,10 @@ static void common079721_2351(engine_configuration_s *engineConfiguration, board
}
void setMiata1990(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NA;
common079721_2351(engineConfiguration, boardConfiguration);
commonMiataNa(engineConfiguration, boardConfiguration);
// Frankenstein: high side #1 is PE8
// Frankenstein: high side #2 is PE10
// Frankenstein: high side #3 is PE12
// Frankenstein: high side #4 is PE14
// Frankenstein: high side #5 is PC9
// Frankenstein: high side #6 is PC7
boardConfiguration->ignitionPins[0] = GPIOE_12; // Frankenstein: high side #3
boardConfiguration->ignitionPins[1] = GPIOE_14; // Frankenstein: high side #4
boardConfiguration->ignitionPins[2] = GPIO_NONE;
boardConfiguration->ignitionPins[3] = GPIO_NONE;
boardConfiguration->ignitionPinMode = OM_DEFAULT;
// Frankenstein: low side - inj #1: PC14
// Frankenstein: low side - inj #2: PC15
@ -143,7 +154,9 @@ void setFordEscortGt(engine_configuration_s *engineConfiguration, board_configur
* set_engine_type 20
*/
void setMiata1994(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NA;
commonMiataNa(engineConfiguration, boardConfiguration);
engineConfiguration->displacement = 1.839;
boardConfiguration->triggerSimulatorPins[0] = GPIOD_2; // 2G - YEL/BLU
@ -158,11 +171,10 @@ void setMiata1994(engine_configuration_s *engineConfiguration, board_configurati
boardConfiguration->is_enabled_spi_2 = false;
boardConfiguration->is_enabled_spi_3 = false;
setDefaultCrankingFuel(engineConfiguration);
}
void setMiata1996(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
commonMiataNa(engineConfiguration, boardConfiguration);
setDefaultCrankingFuel(engineConfiguration);
}

View File

@ -334,7 +334,7 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
boardConfiguration->triggerInputPins[0] = GPIOC_6;
boardConfiguration->triggerInputPins[1] = GPIOA_5;
boardConfiguration->logicAnalyzerPins[0] = GPIOA_8;
boardConfiguration->logicAnalyzerPins[1] = GPIOE_7;
boardConfiguration->logicAnalyzerPins[1] = GPIOE_7; // todo: E7 is not timer input, that's a bug!
boardConfiguration->idleThreadPeriod = 100;
boardConfiguration->consoleLoopPeriod = 200;

View File

@ -88,11 +88,35 @@ static uint32_t getAlternateFunctions(ICUDriver *driver) {
return 0xffffffff;
}
icuchannel_t getInputCaptureChannel(brain_pin_e hwPin) {
switch (hwPin) {
case GPIOA_5:
case GPIOA_8:
case GPIOC_6:
case GPIOE_5:
case GPIOE_9:
return ICU_CHANNEL_1;
case GPIOE_6:
case GPIOE_11:
return ICU_CHANNEL_2;
default:
firmwareError("Unexpected hw pin in getInputCaptureChannel %d", hwPin);
return ICU_CHANNEL_1;
}
}
ICUDriver * getInputCaptureDriver(brain_pin_e hwPin) {
#if STM32_ICU_USE_TIM1
if (hwPin == GPIOA_8) {
return &ICUD1;
}
if (hwPin == GPIOE_9) {
return &ICUD1;
}
if (hwPin == GPIOE_11) {
return &ICUD1;
}
#endif
#if STM32_ICU_USE_TIM2
if (hwPin == GPIOA_5) {
@ -105,7 +129,7 @@ ICUDriver * getInputCaptureDriver(brain_pin_e hwPin) {
}
#endif
#if STM32_ICU_USE_TIM9
if (hwPin == GPIOE_7) {
if (hwPin == GPIOE_5) {
return &ICUD9;
}
#endif