c046b23ea2
Helps prevent the filesystem from getting formatted by mistake, among other things. For example, on a Pico board, entering Ctrl+D and Ctrl+C fast many times will eventually wipe the filesystem (without warning or notice). Further rationale: Ctrl+C is used a lot by automation scripts (eg mpremote) and UI's (eg Mu, Thonny) to get the board into a known state. If the board is not responding for a short time then it's not possible to know if it's just a slow start up (eg in _boot.py), or an infinite loop in the main application. The former should not be interrupted, but the latter should. The only way to distinguish these two cases would be to wait "long enough", and if there's nothing on the serial after "long enough" then assume it's running the application and Ctrl+C should break out of it. But defining "long enough" is impossible for all the different boards and their possible behaviour. The solution in this commit is to make it so that frozen start-up code cannot be interrupted by Ctrl+C. That code then effectively acts like normal C start-up code, which also cannot be interrupted. Note: on the stm32 port this was never seen as an issue because all start-up code is in C. But now other ports start to put more things in _boot.py and so this problem crops up. Signed-off-by: David Grayson <davidegrayson@gmail.com> |
||
---|---|---|
.. | ||
gchelper_generic.c | ||
gchelper_native.c | ||
gchelper_thumb1.s | ||
gchelper_thumb2.s | ||
gchelper.h | ||
interrupt_char.c | ||
interrupt_char.h | ||
mpirq.c | ||
mpirq.h | ||
pyexec.c | ||
pyexec.h | ||
semihosting.c | ||
semihosting.h | ||
softtimer.c | ||
softtimer.h | ||
stdout_helpers.c | ||
sys_stdio_mphal.c |