◆ doLuaCanRx()
Definition at line 170 of file lua_can_rx.cpp.
170 {
172 int counter = 0;
173
175 counter++;
176 }
177 return counter;
178}
static bool doOneLuaCanRx(LuaHandle &ls)
Referenced by runOneLua().
◆ getLuaCanRxDropped()
◆ initLuaCanRx()
Definition at line 180 of file lua_can_rx.cpp.
180 {
181
182 for (size_t i = 0; i < LUA_canFrameCount; i++) {
184 }
185}
static CanFrameData canFrames[LUA_canFrameCount]
static chibios_rt::Mailbox< CanFrameData *, LUA_canFrameCount > freeBuffers
Referenced by startLua().
◆ processLuaCan()
Definition at line 38 of file lua_can_rx.cpp.
38 {
40
41
42 if (!filter) {
43 return;
44 }
45
46 CanFrameData* frameBuffer;
47 msg_t msg;
48
49 {
50
51 chibios_rt::CriticalSectionLocker csl;
53 }
54
55 if (msg != MSG_OK) {
56
58 return;
59 }
60
61
62 frameBuffer->BusIndex = busIndex;
63 frameBuffer->Frame = frame;
64 frameBuffer->Callback = filter->Callback;
65
66 {
67
68 chibios_rt::CriticalSectionLocker csl;
70 }
71}
CanFilter * getFilterForId(size_t busIndex, int Id)
static chibios_rt::Mailbox< CanFrameData *, LUA_canFrameCount > filledBuffers
Referenced by processCanRxMessage().
◆ startLua()
Definition at line 281 of file lua.cpp.
281 {
283
284#if EFI_CAN_SUPPORT
286#endif
287
290 });
291
293
296 return;
297 }
298
301
303 });
304
307 });
308
312 efiPrintf(
"rx total/recent/dropped %d %d %d",
totalRxCount,
316
318 });
319}
TunerStudioOutputChannels outputChannels
void addConsoleActionS(const char *token, VoidCharPtr callback)
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
void addConsoleActionII(const char *token, VoidIntInt callback)
Register a console command with two Integer parameters.
static EngineAccessor engine
static constexpr engine_configuration_s * engineConfiguration
static LuaThread luaThread
static char interactiveCmd[100]
static uint32_t maxLuaDuration
static bool interactivePending
size_t getLuaCanRxDropped()
script_setting_t scriptSetting[SCRIPT_SETTING_COUNT]
uint32_t luaLastCycleDuration
Referenced by commonEarlyInit().
◆ testLuaExecString()
void testLuaExecString |
( |
const char * |
script | ) |
|
Definition at line 394 of file lua.cpp.
394 {
396
397 if (!ls) {
398 throw std::logic_error("Call to setupLuaState failed, returned null");
399 }
400
402 throw std::logic_error("Call to loadScript failed");
403 }
404}
static bool loadScript(LuaHandle &ls, const char *scriptStr)
static LuaHandle setupLuaState(lua_Alloc alloc)
void * luaHeapAlloc(void *, void *optr, size_t osize, size_t nsize)
◆ testLuaReturnsInteger()
int testLuaReturnsInteger |
( |
const char * |
script | ) |
|
Definition at line 383 of file lua.cpp.
383 {
385
386
387 if (!lua_isinteger(ls, -1)) {
388 throw std::logic_error("Returned value is not an integer");
389 }
390
391 return lua_tointeger(ls, -1);
392}
static LuaHandle runScript(const char *script)
◆ testLuaReturnsNumber()
float testLuaReturnsNumber |
( |
const char * |
script | ) |
|
Definition at line 371 of file lua.cpp.
371 {
373
374
375 if (!lua_isnumber(ls, -1)) {
376 throw new std::logic_error("Returned value is not a number");
377 }
378
379
380 return lua_tonumber(ls, -1);
381}
◆ testLuaReturnsNumberOrNil()
expected< float > testLuaReturnsNumberOrNil |
( |
const char * |
script | ) |
|
Definition at line 354 of file lua.cpp.
354 {
356
357
358 if (lua_isnil(ls, -1)) {
359 return unexpected;
360 }
361
362
363 if (!lua_isnumber(ls, -1)) {
364 throw std::logic_error("Returned value is not a number");
365 }
366
367
368 return lua_tonumber(ls, -1);
369}
Go to the source code of this file.