Something something Automatic Compression Release #3442

This commit is contained in:
Andrey 2021-11-11 21:38:49 -05:00
parent db6a1ae7e2
commit 31b50ff021
2 changed files with 18 additions and 0 deletions

View File

@ -533,6 +533,16 @@ void configureRusefiLuaHooks(lua_State* l) {
lua_register(l, "setFuelAdd", lua_setFuelAdd);
lua_register(l, "setFuelMult", lua_setFuelMult);
lua_register(l, "getTimeSinceTriggerEventMs", [](lua_State* l) {
#if EFI_UNIT_TEST
Engine *engine = engineForLuaUnitTests;
EXPAND_Engine;
#endif
int result = currentTimeMillis() - engine->triggerActivityMs;
lua_pushnumber(l, result);
return 1;
});
#if EFI_CAN_SUPPORT
lua_register(l, "canRxAdd", lua_canRxAdd);
#endif // EFI_CAN_SUPPORT

View File

@ -33,6 +33,14 @@ static int lua_interpolate(lua_State* l) {
void configureRusefiLuaUtilHooks(lua_State* l) {
lua_register(l, "print", lua_efi_print);
lua_register(l, "interpolate", lua_interpolate);
/*
* todo: shall we? same for milliseconds?
lua_register(l, "getNowSeconds", [](lua_State* l) -> int {
int result = getTimeNowSeconds();
lua_pushnumber(l, result);
return 1;
});
*/
}