diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index de650f5264..8307d6980b 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -292,6 +292,19 @@ void setMiataNA6_VAF_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * set engine_type 12 */ void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { + // CLT: "18 - AN temp 1" + // IAT: "23 - AN temp 2" + // MAF/VAF: "19 - AN volt 4" + engineConfiguration->mafAdcChannel = EFI_ADC_12; + + //boardConfiguration->triggerInputPins[0] = GPIOC_6; + boardConfiguration->triggerInputPins[1] = GPIOA_5; + engineConfiguration->camInputs[0] = GPIO_UNASSIGNED; + + // MIL check engine: + + // IAC: GPIOE_9: "7 - Lowside 1" + boardConfiguration->isHip9011Enabled = false; boardConfiguration->isSdCardEnabled = false; diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 59facaac5f..ef68ee14c5 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -812,6 +812,6 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20190805; + return 20190806; } #endif /* EFI_UNIT_TEST */ diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index e5abbf34ab..79a2d79613 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -502,6 +502,7 @@ extern int perSecondIrqCounter; #if EFI_PROD_CODE extern uint32_t maxPrecisionCallbackDuration; +extern bool hwTriggerInputEnabled; #endif /* EFI_PROD_CODE */ extern uint32_t maxSchedulingPrecisionLoss; @@ -537,9 +538,13 @@ void triggerInfo(void) { TriggerShape *ts = &engine->triggerCentral.triggerShape; #if HAL_USE_ICU == TRUE - scheduleMsg(logger, "trigger ICU hw: %d %d", icuWidthCallbackCounter, icuWidthPeriodCounter); + scheduleMsg(logger, "trigger ICU hw: %d %d %d", icuWidthCallbackCounter, icuWidthPeriodCounter, hwTriggerInputEnabled); #endif /* HAL_USE_ICU */ +#if HAL_TRIGGER_USE_PAL == TRUE + scheduleMsg(logger, "trigger PAL mode %d", hwTriggerInputEnabled); +#endif /* HAL_TRIGGER_USE_PAL */ + scheduleMsg(logger, "Template %s (%d) trigger %s (%d) useRiseEdge=%s onlyFront=%s useOnlyFirstChannel=%s tdcOffset=%.2f", getConfigurationName(engineConfiguration->engineType), engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->trigger.type), engineConfiguration->trigger.type, diff --git a/firmware/hw_layer/trigger_input.cpp b/firmware/hw_layer/trigger_input.cpp index 3dc74f8d78..1920094594 100644 --- a/firmware/hw_layer/trigger_input.cpp +++ b/firmware/hw_layer/trigger_input.cpp @@ -196,13 +196,15 @@ static ICUConfig cam_icucfg = { ICU_INPUT_ACTIVE_LOW, static int turnOnTriggerInputPin(const char *msg, brain_pin_e brainPin, bool is_shaft) { ICUConfig *icucfg; - if (brainPin == GPIO_UNASSIGNED) + if (brainPin == GPIO_UNASSIGNED) { return -1; + } - if (is_shaft) + if (is_shaft) { icucfg = &shaft_icucfg; - else + } else { icucfg = &cam_icucfg; + } // configure pin turnOnCapturePin(msg, brainPin);