live data for wastegate #3588

This commit is contained in:
rusefillc 2021-11-24 12:59:57 -05:00
parent 615b9e5933
commit 3077f795c4
6 changed files with 15 additions and 6 deletions

View File

@ -263,6 +263,10 @@ static const void * getStructAddr(live_data_e structId) {
return static_cast<tps_accel_state_s*>(&engine->tpsAccelEnrichment);
case LDS_MAIN_RELAY:
return static_cast<main_relay_s*>(&engine->module<MainRelayController>().unmock());
#if EFI_BOOST_CONTROL
case LDS_BOOST_CONTROL:
return static_cast<boost_control_s*>(&engine->boostController);
#endif // EFI_BOOST_CONTROL
default:
return nullptr;
}

View File

@ -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();

View File

@ -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;

View File

@ -23,4 +23,5 @@ LDS_FUEL_PUMP,
LDS_IDLE,
LDS_TPS_ACCEL,
LDS_MAIN_RELAY,
LDS_BOOST_CONTROL,
} live_data_e;

View File

@ -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];

View File

@ -103,7 +103,7 @@ private:
}
};
static MILController instance CCM_OPTIONAL;
static MILController instance;
#if TEST_MIL_CODE
static void testMil() {