Thank you very much Bezobiuk
I was able to implement a small lua code
working as you suggest by coroutines. But it works inside
lua code. What I meant is a little bit different. I try to
explain better.
Suppose I’m working on platform STM32 using
Lua embedded in STM32F1xx CPU. Suppose also my main.c
file, after the initialization routines, starts by the
while(true) cycle, something like the following (take it
as a logical description of the code):
Main()
{
Init_system();
…
…
while(true)
{
lua app_script() à ( lua_State* L = lua_open(),
luaL_openlibs(L), … … and so on )
C_function1();
…
C_functionN();
}
}
This is the situation I mean. I don’t know if
coroutines method could be applicable to a such situation,
to interrupt a while(true) inside the lua app_script. On
other words, I don’t think I can insert the resume/yield
of a coroutine inside a pure C_functionX() running in my
main.c file. Isn’t it?
By the way, do you have any answer about
point 1) and 2), regarding the usage of lua over uCLinux,
FreeRTOS, or some other RTOSs?
Regards
Bob