lua & fsio cleanup (#3175)

This commit is contained in:
Matthew Kennedy 2021-08-18 12:25:46 -07:00 committed by GitHub
parent 8f43f72912
commit a02c8dc7c3
2 changed files with 3 additions and 28 deletions

View File

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

View File

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