Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8365

MicroPython • Re: interrupt Pico code started by mpremote

$
0
0
As with any tool there are many different use-cases, and any tool will need to cater for a balance between them all. In your case you're expectations are that the user doing a single thing will actually make mpremote and the micropython runtime on the board to multiple things in concert. Personally I don't think that that use case is so common that it should be the default, also as the workaround requires a user to use the the ubiquitous CTRL-X/CTRL-] command.

Having the ability to send Ctrl-Codes to a board though is something I have had a need for as well , but then I would not stop at just a only Ctrl-C, but add a few other common ones as well.

As with any tool, there are some. control sequences that you will need to remember such as CTRL-X/CTRL-] to exit. As I've shown in the sample with a few lines of exception handling the MPremote REPL will actually show you what characters to use if you want a better UX.
It might be that the fact that board remains in the raw-REPL state is a bug or not.

If you want to propose a change to mpremote, I'd suggest raising a feature request or PR with your proposed additions, or continue the conversation on the Discussion topic that Stewart started. ( link above)
I hope we then can find a solution that make sense not just for your use case , but also not complicate for other use cases.

Until such time , you can use Ctrl-C + Ctrl-X instead of just Ctrl-C.
I think that still better than restarting your board.

Statistics: Posted by josverl — Sun Apr 13, 2025 10:48 am



Viewing all articles
Browse latest Browse all 8365

Trending Articles