Lua to read tsOutputs #3376

This commit is contained in:
rusefillc 2021-12-13 19:46:41 -05:00
parent c5323d4aef
commit cae5ae5ce4
2 changed files with 17 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include "fuel_math.h"
#include "airmass.h"
#include "lua_airmass.h"
#include "value_lookup.h"
#if EFI_CAN_SUPPORT || EFI_UNIT_TEST
#include "can_msg_tx.h"
#endif // EFI_CAN_SUPPORT
@ -558,6 +559,13 @@ void configureRusefiLuaHooks(lua_State* l) {
return 1;
});
lua_register(l, "getCalibration", [](lua_State* l) {
auto propertyName = luaL_checklstring(l, 1, nullptr);
auto result = getConfigValueByName(propertyName);
lua_pushnumber(l, result);
return 1;
});
#if EFI_CAN_SUPPORT
lua_register(l, "canRxAdd", [](lua_State* l) {
auto eid = luaL_checkinteger(l, 1);

View File

@ -0,0 +1,9 @@
/*
* @file value_lookup.h
*
* @date Dec 13, 2021
* @author Andrey Belomutskiy, (c) 2012-2021
*/
#pragma once
float getConfigValueByName(const char *name);