diff --git a/firmware/console/binary/tunerstudio.h b/firmware/console/binary/tunerstudio.h index 939dd5b229..3c52c03598 100644 --- a/firmware/console/binary/tunerstudio.h +++ b/firmware/console/binary/tunerstudio.h @@ -9,6 +9,7 @@ #include "global.h" #include "tunerstudio_io.h" #include "electronic_throttle_generated.h" +#include "knock_controller_generated.h" #include "FragmentEntry.h" typedef struct { diff --git a/firmware/controllers/engine_cycle/knock_controller.txt b/firmware/controllers/engine_cycle/knock_controller.txt index 88571c795b..38791ba2d9 100644 --- a/firmware/controllers/engine_cycle/knock_controller.txt +++ b/firmware/controllers/engine_cycle/knock_controller.txt @@ -1,5 +1,5 @@ struct_no_prefix knock_controller_s -angle_t m_requested_pump;Degrees retarded: larger number = more retard +angle_t m_knockRetard;Degrees retarded: larger number = more retard end_struct diff --git a/firmware/controllers/engine_cycle/knock_controller_generated.h b/firmware/controllers/engine_cycle/knock_controller_generated.h index 6234935266..1487e96165 100644 --- a/firmware/controllers/engine_cycle/knock_controller_generated.h +++ b/firmware/controllers/engine_cycle/knock_controller_generated.h @@ -9,7 +9,7 @@ struct knock_controller_s { * Degrees retarded: larger number = more retard * offset 0 */ - angle_t m_requested_pump = (angle_t)0; + angle_t m_knockRetard = (angle_t)0; }; static_assert(sizeof(knock_controller_s) == 4); diff --git a/firmware/controllers/engine_cycle/knock_logic.h b/firmware/controllers/engine_cycle/knock_logic.h index 0e58aec978..00dada3fcd 100644 --- a/firmware/controllers/engine_cycle/knock_logic.h +++ b/firmware/controllers/engine_cycle/knock_logic.h @@ -8,10 +8,11 @@ #pragma once #include "peak_detect.h" +#include "knock_controller_generated.h" int getCylinderKnockBank(uint8_t cylinderNumber); -class KnockController : public EngineModule { +class KnockController : public EngineModule, public knock_controller_s { public: // EngineModule implementation void onFastCallback() override; @@ -28,9 +29,6 @@ private: // start with threshold higher than any possible knock to avoid recording spurious knocks float m_knockThreshold = 100; - // Degrees retarded: larger number = more retard - float m_knockRetard = 0; - uint32_t m_knockCount = 0; using PD = PeakDetect;