scientifichackers / ampy

MicroPython Tool - Utility to interact with a MicroPython board over a serial connection.
MIT License
718 stars 156 forks source link

Fixes enter_raw_repl failures #95

Closed kdschlosser closed 1 year ago

kdschlosser commented 4 years ago

This should a couple of problems that can occur when enter_raw_repl runs

The first issue is when you used ampy the first time after plugging in a device. The fix for this requires that the reset button be pressed after plugging in the device before ampy runs.

The second is the number of CTRL+C combinations needed to get a program to terminate properly. With threads being available it appears as tho a CTRL+C is needed for each thread that is running. This fix also handles using the correct number of CTRL+C combinations needed if a users main loop is in the boot.py file and not in main.py. It uses the same number of CTRL+C combinations initially used to terminate the program.

and I have found that is we do not first succeed to give it another try and it will usually work the second time. So if there is a failure the first time it will attempt a second.