diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index bf6a0b1b75..17237b3f3a 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -263,6 +263,10 @@ static const void * getStructAddr(live_data_e structId) { return static_cast(&engine->tpsAccelEnrichment); case LDS_MAIN_RELAY: return static_cast(&engine->module().unmock()); +#if EFI_BOOST_CONTROL + case LDS_BOOST_CONTROL: + return static_cast(&engine->boostController); +#endif // EFI_BOOST_CONTROL default: return nullptr; } diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index 76707fa8bb..6fc7565e30 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -160,12 +160,11 @@ void BoostController::update() { ClosedLoopController::update(); } -static BoostController boostController; static bool hasInitBoost = false; void updateBoostControl() { if (hasInitBoost) { - boostController.update(); + engine->boostController.update(); } } @@ -214,7 +213,7 @@ void startBoostPin() { } void onConfigurationChangeBoostCallback(engine_configuration_s *previousConfiguration) { - boostController.onConfigurationChange(&previousConfiguration->boostPid); + engine->boostController.onConfigurationChange(&previousConfiguration->boostPid); } void initBoostCtrl() { @@ -240,7 +239,7 @@ void initBoostCtrl() { boostMapClosed.init(config->boostTableClosedLoop, config->boostTpsBins, config->boostRpmBins); // Set up boost controller instance - boostController.init(&boostPwmControl, &boostMapOpen, &boostMapClosed, &engineConfiguration->boostPid); + engine->boostController.init(&boostPwmControl, &boostMapOpen, &boostMapClosed, &engineConfiguration->boostPid); #if !EFI_UNIT_TEST startBoostPin(); diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 4a4bf757f0..b55834cee6 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -32,6 +32,7 @@ #include "fuel_pump.h" #include "main_relay.h" #include "type_list.h" +#include "boost_control.h" #ifndef EFI_UNIT_TEST #error EFI_UNIT_TEST must be defined! @@ -154,6 +155,10 @@ public: LaunchControlBase launchController; SoftSparkLimiter softSparkLimiter; +#if EFI_BOOST_CONTROL + BoostController boostController; +#endif // EFI_BOOST_CONTROL + efitick_t mostRecentSparkEvent; efitick_t mostRecentTimeBetweenSparkEvents; efitick_t mostRecentIgnitionEvent; diff --git a/firmware/controllers/algo/live_data_ids.h b/firmware/controllers/algo/live_data_ids.h index b56a4f1713..2a214f9223 100644 --- a/firmware/controllers/algo/live_data_ids.h +++ b/firmware/controllers/algo/live_data_ids.h @@ -23,4 +23,5 @@ LDS_FUEL_PUMP, LDS_IDLE, LDS_TPS_ACCEL, LDS_MAIN_RELAY, +LDS_BOOST_CONTROL, } live_data_e; diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 61156de81e..4af86f260e 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -128,7 +128,7 @@ void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfigura (void)previousConfiguration; } -static LECalculator calc CCM_OPTIONAL; +static LECalculator calc; static const char * action2String(le_action_e action) { static char buffer[_MAX_FILLER]; diff --git a/firmware/controllers/gauges/malfunction_indicator.cpp b/firmware/controllers/gauges/malfunction_indicator.cpp index 4e7c24a8fa..cdeb775149 100644 --- a/firmware/controllers/gauges/malfunction_indicator.cpp +++ b/firmware/controllers/gauges/malfunction_indicator.cpp @@ -103,7 +103,7 @@ private: } }; -static MILController instance CCM_OPTIONAL; +static MILController instance; #if TEST_MIL_CODE static void testMil() {