From 853e0120777ea74438e776d6db22f6e0e93e624d Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 1 May 2023 13:38:17 -0400 Subject: [PATCH] only:hellen-honda-k wow sweet progress --- firmware/hw_layer/kline.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/hw_layer/kline.cpp b/firmware/hw_layer/kline.cpp index d15840f3b6..5e4bb74b16 100644 --- a/firmware/hw_layer/kline.cpp +++ b/firmware/hw_layer/kline.cpp @@ -109,6 +109,12 @@ void kLineThread(void*) { if (engineConfiguration->verboseKLine) { efiPrintf("kline doSend"); } + int positiveCltWithHighishValueInCaseOfSensorIssue = maxI(1, Sensor::get(SensorType::Clt).value_or(140)); + // 125 about horizontal + // 162 points at red mark, looks like gauge has hysteresis? + // value 200 way above red mark + kvalues[3] = positiveCltWithHighishValueInCaseOfSensorIssue; + chnWrite(klDriver, (const uint8_t *)kvalues, OUT_SIZE); uint8_t crc = crc_hondak_calc(kvalues, OUT_SIZE); chnWrite(klDriver, (const uint8_t *)&crc, 1); @@ -176,7 +182,6 @@ void initKLine() { memset(kvalues, 0, sizeof(kvalues)); kvalues[0] = 0x2; - kvalues[3] = 0x50; chThdCreateStatic(klThreadStack, sizeof(klThreadStack), NORMALPRIO + 1, kLineThread, nullptr); addConsoleAction("kline", [](){