From 31c91dff4162d6903e86fa4c44dc822562159948 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 19 Sep 2024 12:56:31 -0400 Subject: [PATCH] only:isHwQcMode API --- firmware/controllers/can/can_bench_test.cpp | 9 +++++++-- firmware/controllers/settings.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/can/can_bench_test.cpp b/firmware/controllers/can/can_bench_test.cpp index 71d6f59801..6147613365 100644 --- a/firmware/controllers/can/can_bench_test.cpp +++ b/firmware/controllers/can/can_bench_test.cpp @@ -21,7 +21,14 @@ extern PinRepository pinRepository; * quite different from bench testing user functionality: QC direct should never be engaged on a real vehicle * Once QC direct control mode is activated the only way out is to reboot the unit! */ +// that one could be set by rusEFI console bool qcDirectPinControlMode = false; +// todo: how is this flag different from the one above? shall we merge? +/*board public API*/bool withHwQcActivity = false; + +bool isHwQcMode() { + return withHwQcActivity || qcDirectPinControlMode; +} #if EFI_CAN_SUPPORT @@ -244,8 +251,6 @@ static void resetPinStats(bench_mode_e benchModePinIdx) { #endif // EFI_SIMULATOR } -/*board public API*/bool withHwQcActivity = false; - void processCanQcBenchTest(const CANRxFrame& frame) { if (CAN_EID(frame) != (int)bench_test_packet_ids_e::IO_CONTROL) { return; diff --git a/firmware/controllers/settings.h b/firmware/controllers/settings.h index 1769690e29..f0604f7a34 100644 --- a/firmware/controllers/settings.h +++ b/firmware/controllers/settings.h @@ -13,6 +13,8 @@ void printSpiState(); void printConfiguration(); void scheduleStopEngine(); +bool isHwQcMode(); + void setEngineTypeAndSave(int value); void setEngineType(int value, bool isWriteToFlash = true); void readPin(const char *pinName);