one step sideways to fix build

This commit is contained in:
rusefillc 2022-04-16 21:23:37 -04:00
parent b271f54214
commit 82f608d558
3 changed files with 10 additions and 4 deletions

View File

@ -669,7 +669,7 @@ static EtbImpl<EtbController1> etb1;
static EtbImpl<EtbController2> etb2;
static_assert(ETB_COUNT == 2);
static EtbController* etbControllers[] = { &etb1, &etb2 };
EtbController* etbControllers[] = { &etb1, &etb2 };
struct EtbThread final : public PeriodicController<512> {
EtbThread() : PeriodicController("ETB", PRIO_ETB, ETB_LOOP_FREQUENCY) {}

View File

@ -40,7 +40,6 @@
#include "gear_detector.h"
#include "advance_map.h"
#include "fan_control.h"
#include "electronic_throttle_impl.h"
#ifndef EFI_UNIT_TEST
#error EFI_UNIT_TEST must be defined!
@ -167,7 +166,7 @@ public:
PinRepository pinRepository;
EtbController *etbControllers[ETB_COUNT] = {nullptr};
IEtbController *etbControllers[ETB_COUNT] = {nullptr};
IFuelComputer *fuelComputer = nullptr;
type_list<

View File

@ -23,6 +23,10 @@ using namespace luaaa;
// Some functions lean on existing FSIO implementation
#include "fsio_impl.h"
#if EFI_PROD_CODE
#include "electronic_throttle_impl.h"
#endif
static int lua_readpin(lua_State* l) {
auto msg = luaL_checkstring(l, 1);
#if EFI_PROD_CODE
@ -533,13 +537,16 @@ void configureRusefiLuaHooks(lua_State* l) {
engine->engineState.luaAdjustments.fuelMult = luaL_checknumber(l, 1);
return 0;
});
#if EFI_PROD_CODE
lua_register(l, "setEtbAdd", [](lua_State* l) {
auto luaAdjustment = luaL_checknumber(l, 1);
for (int i = 0 ; i < ETB_COUNT; i++) {
engine->etbControllers[i]->luaAdjustment = luaAdjustment;
extern EtbController* etbControllers[];
etbControllers[i]->luaAdjustment = luaAdjustment;
}
return 0;
});
#endif // EFI_PROD_CODE
lua_register(l, "setClutchUpState", [](lua_State* l) {
engine->engineState.luaAdjustments.clutchUpState = lua_toboolean(l, 1);