diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index f27c062b9e..2eb1d7ae6f 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -316,7 +316,9 @@ static systime_t timeOfPreviousPrintVersion = (systime_t) -1; #if EFI_PROD_CODE || defined(__DOXYGEN__) static void printOutPin(const char *pinName, brain_pin_e hwPin) { - appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName, hwPortname(hwPin), DELIMETER); + if (hwPin != GPIO_UNASSIGNED) { + appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName, hwPortname(hwPin), DELIMETER); + } } #endif /* EFI_PROD_CODE */ @@ -338,6 +340,9 @@ static void printInfo(systime_t nowSeconds) { printOutPin(CRANK1, boardConfiguration->triggerInputPins[0]); printOutPin(CRANK2, boardConfiguration->triggerInputPins[1]); printOutPin(VVT_NAME, engineConfiguration->camInput); + printOutPin(HIP_NAME, boardConfiguration->hip9011IntHoldPin); + printOutPin(TACH_NAME, boardConfiguration->tachOutputPin); + printOutPin(DIZZY_NAME, engineConfiguration->dizzySparkOutputPin); #if EFI_WAVE_ANALYZER || defined(__DOXYGEN__) printOutPin(WA_CHANNEL_1, boardConfiguration->logicAnalyzerPins[0]); printOutPin(WA_CHANNEL_2, boardConfiguration->logicAnalyzerPins[1]); diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 09bc70e042..595b78e674 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -14,6 +14,9 @@ #include "firing_order.h" #include "efifeatures.h" +#define HIP_NAME "HIP" +#define TACH_NAME "tach" +#define DIZZY_NAME "dizzy" #define ENUM_16_BITS 20000 diff --git a/firmware/controllers/map_averaging.cpp b/firmware/controllers/map_averaging.cpp index 648cd29fa4..9d2ddb75cd 100644 --- a/firmware/controllers/map_averaging.cpp +++ b/firmware/controllers/map_averaging.cpp @@ -41,6 +41,9 @@ #define FAST_MAP_CHART_SKIP_FACTOR 16 static Logging *logger; +/** + * this instance does not have a real physical pin - it's only used for engine sniffer + */ static NamedOutputPin mapAveragingPin("map"); /** diff --git a/firmware/controllers/system/efiGpio.cpp b/firmware/controllers/system/efiGpio.cpp index 9f0fb14d3b..1fdeeb7797 100644 --- a/firmware/controllers/system/efiGpio.cpp +++ b/firmware/controllers/system/efiGpio.cpp @@ -30,6 +30,10 @@ InjectorOutputPin::InjectorOutputPin() : NamedOutputPin() { reset(); } +engine_pins_s::engine_pins_s() { + dizzyOutput.name = DIZZY_NAME; +} + void InjectorOutputPin::reset() { overlappingScheduleOffTime = 0; cancelNextTurningInjectorOff = false; diff --git a/firmware/controllers/system/efiGpio.h b/firmware/controllers/system/efiGpio.h index 393c1208b8..1657e18f69 100644 --- a/firmware/controllers/system/efiGpio.h +++ b/firmware/controllers/system/efiGpio.h @@ -55,7 +55,9 @@ public: bool cancelNextTurningInjectorOff; }; -typedef struct { +class engine_pins_s { +public: + engine_pins_s(); OutputPin mainRelay; OutputPin fanRelay; OutputPin acRelay; @@ -66,8 +68,8 @@ typedef struct { InjectorOutputPin injectors[INJECTION_PIN_COUNT]; NamedOutputPin coils[IGNITION_PIN_COUNT]; - OutputPin dizzyOutput; -} engine_pins_s; + NamedOutputPin dizzyOutput; +}; /** * it's a macro to be sure that stack is not used diff --git a/firmware/controllers/tachometer.cpp b/firmware/controllers/tachometer.cpp index 13c397f613..8992c0b903 100644 --- a/firmware/controllers/tachometer.cpp +++ b/firmware/controllers/tachometer.cpp @@ -15,11 +15,11 @@ EXTERN_ENGINE; -static OutputPin tachOut; +static NamedOutputPin tachOut(TACH_NAME); static scheduling_s tachTurnSignalOff; static void turnTachPinLow(void) { - tachOut.setValue(false); + turnPinLow(&tachOut); } static void tachSignalCallback(trigger_event_e ckpSignalType, @@ -27,7 +27,7 @@ static void tachSignalCallback(trigger_event_e ckpSignalType, if (index != engineConfiguration->tachPulseTriggerIndex) { return; } - tachOut.setValue(true); + turnPinHigh(&tachOut); scheduleTask("tach off", &tachTurnSignalOff, (int)MS2US(engineConfiguration->tachPulseDuractionMs), (schfunc_t) &turnTachPinLow, NULL); } diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 8fd4c5e313..0f758cdb05 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -295,18 +295,18 @@ void turnSparkPinLow(NamedOutputPin *output) { turnPinLow(output); #if EFI_PROD_CODE || defined(__DOXYGEN__) if (CONFIG(dizzySparkOutputPin) != GPIO_UNASSIGNED) { - doSetOutputPinValue2(&enginePins.dizzyOutput, false); + turnPinLow(&enginePins.dizzyOutput); } -#endif +#endif /* EFI_PROD_CODE */ } void turnSparkPinHigh(NamedOutputPin *output) { turnPinHigh(output); #if EFI_PROD_CODE || defined(__DOXYGEN__) if (CONFIG(dizzySparkOutputPin) != GPIO_UNASSIGNED) { - doSetOutputPinValue2(&enginePins.dizzyOutput, true); + turnPinHigh(&enginePins.dizzyOutput); } -#endif +#endif /* EFI_PROD_CODE */ } static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, IgnitionEvent *iEvent, diff --git a/firmware/hw_layer/HIP9011.cpp b/firmware/hw_layer/HIP9011.cpp index eeb16ce93e..04756c8f98 100644 --- a/firmware/hw_layer/HIP9011.cpp +++ b/firmware/hw_layer/HIP9011.cpp @@ -39,7 +39,7 @@ #if EFI_HIP_9011 || defined(__DOXYGEN__) -static NamedOutputPin intHold("HIP"); +static NamedOutputPin intHold(HIP_NAME); static OutputPin hipCs; extern uint32_t lastExecutionCount; diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index e3d1015924..f48df63e11 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -309,5 +309,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 20160903; + return 20160906; }