From 559656bdc2c7333fc5ddbaca7c82d6774625043e Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 18 Aug 2021 12:25:46 -0700 Subject: [PATCH] lua & fsio cleanup (#3175) --- firmware/controllers/core/fsio_impl.cpp | 26 ++----------------------- firmware/controllers/lua/lua.cpp | 5 +---- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index fd49b844de..8c06e25950 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -72,14 +72,8 @@ static LENameOrdinalPair leFuelRate(LE_METHOD_FUEL_FLOW_RATE, "fuel_flow"); #include "fsio_names.def" -#define LE_EVAL_POOL_SIZE 32 - -static LECalculator evalCalc; -static LEElement evalPoolElements[LE_EVAL_POOL_SIZE]; -static LEElementPool evalPool(evalPoolElements, LE_EVAL_POOL_SIZE); - -#define SYS_ELEMENT_POOL_SIZE 128 -#define UD_ELEMENT_POOL_SIZE 128 +#define SYS_ELEMENT_POOL_SIZE 24 +#define UD_ELEMENT_POOL_SIZE 64 static LEElement sysElements[SYS_ELEMENT_POOL_SIZE] CCM_OPTIONAL; LEElementPool sysPool(sysElements, SYS_ELEMENT_POOL_SIZE); @@ -602,21 +596,6 @@ void applyFsioExpression(const char *indexStr, const char *quotedLine DECLARE_EN showFsioInfo(); } -static void rpnEval(char *line) { -#if EFI_PROD_CODE || EFI_SIMULATOR - line = unquote(line); - efiPrintf("Parsing [%s]", line); - evalPool.reset(); - LEElement * e = evalPool.parseExpression(line); - if (e == NULL) { - efiPrintf("parsing failed"); - } else { - float result = evalCalc.evaluate("eval", 0, e PASS_ENGINE_PARAMETER_SUFFIX); - efiPrintf("Evaluate result: %.2f", result); - } -#endif -} - ValueProvider3D *getFSIOTable(int index) { switch (index) { default: @@ -683,7 +662,6 @@ void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { addConsoleActionSS("set_rpn_expression", applyFsioExpression); addConsoleActionFF("set_fsio_setting", setFsioSetting); addConsoleAction("fsioinfo", showFsioInfo); - addConsoleActionS("rpn_eval", (VoidCharPtr) rpnEval); #endif /* EFI_PROD_CODE || EFI_SIMULATOR */ fsioTable1.init(config->fsioTable1, config->fsioTable1LoadBins, diff --git a/firmware/controllers/lua/lua.cpp b/firmware/controllers/lua/lua.cpp index 16a97cbfdd..45a70ce04c 100644 --- a/firmware/controllers/lua/lua.cpp +++ b/firmware/controllers/lua/lua.cpp @@ -11,9 +11,8 @@ #define TAG "LUA " #if EFI_PROD_CODE || EFI_SIMULATOR -#include "ch.h" - #define LUA_HEAP_SIZE 20000 +static char luaHeap[LUA_HEAP_SIZE]; static memory_heap_t heap; @@ -205,8 +204,6 @@ struct LuaThread : ThreadController<4096> { void ThreadTask() override; }; -static char luaHeap[LUA_HEAP_SIZE]; - static bool needsReset = false; // Each invocation of runOneLua will: