LUA script size severely limited #7085

only:uaefi
This commit is contained in:
rusefillc 2024-11-19 18:03:55 -05:00
parent 0328c08f2b
commit 0d333248e3
2 changed files with 9 additions and 1 deletions

View File

@ -28,5 +28,8 @@ ONBOARD_MEMS_TYPE=LIS2DH12
include $(BOARDS_DIR)/hellen/hellen-common100.mk
# we do not have much Lua RAM, let's drop some fancy functions
DDEFS += -DWITH_LUA_CONSUMPTION=FALSE
DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)

View File

@ -700,7 +700,12 @@ void configureRusefiLuaHooks(lua_State* lState) {
lua_register(lState, "getSensor", lua_getSensorByName);
lua_register(lState, "getSensorRaw", lua_getSensorRaw);
lua_register(lState, "hasSensor", lua_hasSensor);
#if EFI_VEHICLE_SPEED
#ifndef WITH_LUA_CONSUMPTION
#define WITH_LUA_CONSUMPTION TRUE
#endif
#if EFI_VEHICLE_SPEED && WITH_LUA_CONSUMPTION
lua_register(lState, "getConsumedGrams", [](lua_State* l) {
lua_pushnumber(l, engine->module<TripOdometer>()->getConsumedGrams());
return 1;