nrf5: Adding handling of CTRL+D to reset chip in main.c. Call to NVIC System Reset is issued.

This commit is contained in:
Glenn Ruben Bakke 2016-12-29 16:11:59 +01:00
parent 82746d4549
commit 342ffadc59

View File

@ -180,14 +180,21 @@ int main(int argc, char **argv) {
// Main script is finished, so now go into REPL mode.
// The REPL mode can change, or it can request a soft reset.
int ret_code = 0;
for (;;) {
if (pyexec_friendly_repl() != 0) {
ret_code = pyexec_friendly_repl();
if (ret_code != 0) {
break;
}
}
mp_deinit();
if (ret_code == PYEXEC_FORCED_EXIT) {
NVIC_SystemReset();
}
return 0;
}