-
Notifications
You must be signed in to change notification settings - Fork 225
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
ctrl-c don't stop hardware timer #287
Comments
I change my system to use threads. |
Well, we really can't do any assumption on what to do with the hardware resources used by a thread when it is stopped. I think that one solution is to modify the Lua thread API to allow some type of callback when the thread is going to be stopped and write specific code to handle that situation. |
I think a callback function for a good solution. In most cases, the garbage collector will be able to release the orphan objects. Only he is just too late now. So in most cases it will suffice to call |
That sounds like calling the GC would be a good idea whenever a thread is stopped. |
@the0ne |
Another possibility would be the exception handling. ctrl-c and thread stop would trigger an exeption. But only if it occurs within a try. This would suppress an error message if there is no try. |
How do we continue here? |
I don't think that there's a timing defined currently for the process of stopping a thread. |
Next step is to create a patch, test it and submit it as a PR. |
@the0ne |
I have this main simulation loop with cyclic hardware based timer.
I use putty to connect to the esp. I press ctrl-c to stop my application.
The Lua prompt is now visible. With the next return the board hooks up completly.
If I use software timer everthing works fine.
startup.lua.txt
The text was updated successfully, but these errors were encountered: