Lua CAN relay performance #3911

This commit is contained in:
rusefi 2022-02-13 00:07:14 -05:00
parent 9a42afd435
commit 7bc130200d
1 changed files with 3 additions and 2 deletions

View File

@ -130,8 +130,9 @@ static int luaTickPeriodUs;
static int lua_setTickRate(lua_State* l) {
float freq = luaL_checknumber(l, 1);
// Limit to 1..100 hz
freq = clampF(1, freq, 100);
// For instance BMW does 100 CAN messages per second on some IDs, let's allow at least twice that speed
// Limit to 1..200 hz
freq = clampF(1, freq, 200);
luaTickPeriodUs = 1000000.0f / freq;
return 0;