lua & fsio cleanup (#3175)
This commit is contained in:
parent
7296018fd1
commit
559656bdc2
|
@ -72,14 +72,8 @@ static LENameOrdinalPair leFuelRate(LE_METHOD_FUEL_FLOW_RATE, "fuel_flow");
|
||||||
|
|
||||||
#include "fsio_names.def"
|
#include "fsio_names.def"
|
||||||
|
|
||||||
#define LE_EVAL_POOL_SIZE 32
|
#define SYS_ELEMENT_POOL_SIZE 24
|
||||||
|
#define UD_ELEMENT_POOL_SIZE 64
|
||||||
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
|
|
||||||
|
|
||||||
static LEElement sysElements[SYS_ELEMENT_POOL_SIZE] CCM_OPTIONAL;
|
static LEElement sysElements[SYS_ELEMENT_POOL_SIZE] CCM_OPTIONAL;
|
||||||
LEElementPool sysPool(sysElements, SYS_ELEMENT_POOL_SIZE);
|
LEElementPool sysPool(sysElements, SYS_ELEMENT_POOL_SIZE);
|
||||||
|
@ -602,21 +596,6 @@ void applyFsioExpression(const char *indexStr, const char *quotedLine DECLARE_EN
|
||||||
showFsioInfo();
|
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) {
|
ValueProvider3D *getFSIOTable(int index) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
default:
|
default:
|
||||||
|
@ -683,7 +662,6 @@ void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
addConsoleActionSS("set_rpn_expression", applyFsioExpression);
|
addConsoleActionSS("set_rpn_expression", applyFsioExpression);
|
||||||
addConsoleActionFF("set_fsio_setting", setFsioSetting);
|
addConsoleActionFF("set_fsio_setting", setFsioSetting);
|
||||||
addConsoleAction("fsioinfo", showFsioInfo);
|
addConsoleAction("fsioinfo", showFsioInfo);
|
||||||
addConsoleActionS("rpn_eval", (VoidCharPtr) rpnEval);
|
|
||||||
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
|
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
|
||||||
|
|
||||||
fsioTable1.init(config->fsioTable1, config->fsioTable1LoadBins,
|
fsioTable1.init(config->fsioTable1, config->fsioTable1LoadBins,
|
||||||
|
|
|
@ -11,9 +11,8 @@
|
||||||
#define TAG "LUA "
|
#define TAG "LUA "
|
||||||
|
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
#include "ch.h"
|
|
||||||
|
|
||||||
#define LUA_HEAP_SIZE 20000
|
#define LUA_HEAP_SIZE 20000
|
||||||
|
static char luaHeap[LUA_HEAP_SIZE];
|
||||||
|
|
||||||
static memory_heap_t heap;
|
static memory_heap_t heap;
|
||||||
|
|
||||||
|
@ -205,8 +204,6 @@ struct LuaThread : ThreadController<4096> {
|
||||||
void ThreadTask() override;
|
void ThreadTask() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
static char luaHeap[LUA_HEAP_SIZE];
|
|
||||||
|
|
||||||
static bool needsReset = false;
|
static bool needsReset = false;
|
||||||
|
|
||||||
// Each invocation of runOneLua will:
|
// Each invocation of runOneLua will:
|
||||||
|
|
Loading…
Reference in New Issue