-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add a way to do a reload from code #184
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
Comments
@deshipu I don't know if these are the kind of solutions you're looking for, but MicroPython has a |
This would be super-useful in a few of the examples that I am planning for #345 |
You mean to reload the program right? A reset would do a fully reinitialization of the microcontroller and stop USB when available. |
I mean the same thing that ctrl+d does in REPL. |
OK, I call that reload. The tricky part here is that we want to exit the existing code and immediately re-run it. Normally, we'd go into our wait state with the status led fading in and out. |
It'd also be useful if a file to run on reset could be specified. This would let people use this in main.py to specify a different file to run and eliminate the need to rename. Or it could be used in a more complex way like a menu system to allow selecting one of the other .py files to be run programmatically. |
So here is a stupid idea, but maybe it has something useful in it. A lot of people have problems with how the CircuitPython starts and what gets run when and so on — there is a lot of hidden stuff with the We could auto-create the |
@deshipu thats a great idea! Mind filing a separate issue for it? |
I'm going to have a look at this. |
Sometimes the code might need to do a reset, for example, as a way of recovering from an unexpected exception in a long-running program, or as a way of clearing the state of the device to load a new subprogram.
The text was updated successfully, but these errors were encountered: