From 0ad1f96068b51cdb8ef09f1b7c6f472e201a02cb Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 25 Nov 2022 10:13:57 -0500 Subject: [PATCH] Nissan: probably hardware issue but maybe we need firmware progress as well #4821 --- firmware/config/boards/hellen/hellen121nissan/board.mk | 3 +++ firmware/init/sensor/init_tps.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/firmware/config/boards/hellen/hellen121nissan/board.mk b/firmware/config/boards/hellen/hellen121nissan/board.mk index ac0b1bd897..1b34f2d910 100644 --- a/firmware/config/boards/hellen/hellen121nissan/board.mk +++ b/firmware/config/boards/hellen/hellen121nissan/board.mk @@ -18,6 +18,9 @@ DDEFS += -DTS_NO_PRIMARY=1 DDEFS += -DFIRMWARE_ID=\"hellen121nissan\" $(VAR_DEF_ENGINE_TYPE) DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE +# bad temporary solution of hardware issue https://github.com/rusefi/rusefi/issues/4821 +DDEFS += -DMAX_TPS_PPS_DISCREPANCY=10.0f + DDEFS += -DSHORT_BOARD_NAME=hellen121nissan include $(BOARDS_DIR)/hellen/hellen-common144.mk diff --git a/firmware/init/sensor/init_tps.cpp b/firmware/init/sensor/init_tps.cpp index 935d37a30c..5040290e64 100644 --- a/firmware/init/sensor/init_tps.cpp +++ b/firmware/init/sensor/init_tps.cpp @@ -8,6 +8,10 @@ #include "linear_func.h" #include "tps.h" +#ifndef MAX_TPS_PPS_DISCREPANCY +#define MAX_TPS_PPS_DISCREPANCY 5.0f +#endif + struct TpsConfig { adc_channel_e channel; float closed; @@ -118,7 +122,7 @@ public: fordTps->Register(); } else { // not ford TPS - m_redund.configure(5.0f, !hasSecond); + m_redund.configure(MAX_TPS_PPS_DISCREPANCY, !hasSecond); m_redund.Register(); } }