diff --git a/firmware/controllers/actuators/main_relay.cpp b/firmware/controllers/actuators/main_relay.cpp index bd39f92158..d0188975e4 100644 --- a/firmware/controllers/actuators/main_relay.cpp +++ b/firmware/controllers/actuators/main_relay.cpp @@ -22,7 +22,7 @@ void MainRelayController::onSlowCallback() { mainRelayState = !isBenchTest; #endif - enginePins.mainRelay.setValue(mainRelayState); + enginePins.mainRelay.setValue("mr", mainRelayState); } bool MainRelayController::needsDelayedShutoff() { diff --git a/firmware/controllers/bench_test.cpp b/firmware/controllers/bench_test.cpp index 1b22f995da..e21c57404e 100644 --- a/firmware/controllers/bench_test.cpp +++ b/firmware/controllers/bench_test.cpp @@ -58,8 +58,10 @@ bool isRunningBenchTest(void) { static scheduling_s benchSchedStart; static scheduling_s benchSchedEnd; +#define BENCH_MSG "bench" + static void benchOn(OutputPin* output) { - output->setValue(true); + output->setValue(BENCH_MSG, true); } static char pin_error[64]; @@ -74,7 +76,7 @@ static void benchOff(OutputPin* output) { efiPrintf("Diag says %s", pin_error); } #endif // EFI_PROD_CODE - output->setValue(false); + output->setValue(BENCH_MSG, false); } static void runBench(brain_pin_e brainPin, OutputPin *output, float startDelayMs, float onTimeMs, float offTimeMs, diff --git a/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp b/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp index 93a171c0bb..444a092399 100644 --- a/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp +++ b/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp @@ -182,8 +182,10 @@ void HpfpController::onFastCallback() { } } +#define HPFP_CONTROLLER "hpfp" + void HpfpController::pinTurnOn(HpfpController *self) { - enginePins.hpfpValve.setHigh(); + enginePins.hpfpValve.setHigh(HPFP_CONTROLLER); // By scheduling the close after we already open, we don't have to worry if the engine // stops, the valve will be turned off in a certain amount of time regardless. @@ -194,7 +196,7 @@ void HpfpController::pinTurnOn(HpfpController *self) { } void HpfpController::pinTurnOff(HpfpController *self) { - enginePins.hpfpValve.setLow(); + enginePins.hpfpValve.setLow(HPFP_CONTROLLER); self->scheduleNextCycle(); } diff --git a/firmware/controllers/system/efi_gpio.cpp b/firmware/controllers/system/efi_gpio.cpp index 528e434b85..9f239c5f93 100644 --- a/firmware/controllers/system/efi_gpio.cpp +++ b/firmware/controllers/system/efi_gpio.cpp @@ -337,6 +337,10 @@ extern bool verboseMode; #endif // EFI_UNIT_TEST void NamedOutputPin::setHigh() { + setHigh(nullptr); +} + +void NamedOutputPin::setHigh(const char *msg) { #if EFI_UNIT_TEST if (verboseMode) { efiPrintf("pin %s goes high", name); @@ -355,6 +359,10 @@ void NamedOutputPin::setHigh() { } void NamedOutputPin::setLow() { + setLow(nullptr); +} + +void NamedOutputPin::setLow(const char *msg) { #if EFI_UNIT_TEST if (verboseMode) { efiPrintf("pin %s goes low", name); @@ -484,6 +492,10 @@ void OutputPin::setOnchipValue(int electricalValue) { } #endif // EFI_PROD_CODE +void OutputPin::setValue(const char *msg, int logicValue) { + setValue(logicValue); +} + void OutputPin::setValue(int logicValue) { #if ENABLE_PERF_TRACE // todo: https://github.com/rusefi/rusefi/issues/1638 diff --git a/firmware/controllers/system/efi_output.h b/firmware/controllers/system/efi_output.h index 2c0df3c731..946da49150 100644 --- a/firmware/controllers/system/efi_output.h +++ b/firmware/controllers/system/efi_output.h @@ -32,6 +32,7 @@ public: bool isInitialized(); bool getAndSet(int logicValue); + void setValue(const char *msg, int logicValue); TEST_VIRTUAL void setValue(int logicValue); void toggle(); bool getLogicValue() const; @@ -75,6 +76,8 @@ class NamedOutputPin : public virtual OutputPin { public: NamedOutputPin(); explicit NamedOutputPin(const char *name); + virtual void setHigh(const char *msg); + virtual void setLow(const char *msg); virtual void setHigh(); virtual void setLow(); const char *getName() const;