-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using software timer causes a reboot #258
Comments
I have to review it, maybe it's something related to coroutines inside timers. As far I can understand inside sim.cycle you only toggle gpio5, right? Also, remember that you can run Lua threads, mapped into FreeRTOS tasks using the Lua RTOS thread module. See: https://github.com/whitecatboard/Lua-RTOS-ESP32/wiki/Thread-Module |
@jolivepetrus |
@Mynogs I tried to reproduce your issue but obviously the 'sim' object is missing. Can you provide the missing object's source code? |
@Mynogs by the way, please check
maybe you mean to have this:
I would expect |
Sorry for the long delay!
is correct! sim.cycle is a kind of hook function. If sim.cycle is nil no hook function for the busy time measurement is set. |
As mentioned in #258 (comment)
A simplified version is fine, as long as that still triggers the error. |
@the0ne I can not reproduce the error on my current board. I think the mistake was that I used a floating point value as timing value. And lua_tointeger returns 0. Now I use math.floor to convert to integer, so the problem does not seem to occur anymore. I have not checked this in the source code of Lua-RTOS. I think we can close the case. Thank you for your help! |
I have tried to reproduce as well but didn't succeed. |
I have a very simple model for Lua board. I simply switch on and off GPIO5:
The main simulation loop looks like this:
Works fine!
I changed it to use a software timer:
Then I got this:
The debug print messages StepX shows, the fault occures in the second simulation step.
The text was updated successfully, but these errors were encountered: