[code] Enable interrupting an infinite input() loop when clicking on home

This commit is contained in:
Émilie Feral
2018-06-12 16:46:08 +02:00
parent 8e72a0fee6
commit 317e1f0389
3 changed files with 7 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ extern "C" {
#include "py/repl.h"
#include "py/runtime.h"
#include "py/stackctrl.h"
#include "mphalport.h"
}
static MicroPython::ScriptProvider * sScriptProvider = nullptr;
@@ -84,6 +85,10 @@ void MicroPython::ExecutionEnvironment::runCode(const char * str) {
sCurrentExecutionEnvironment = nullptr;
}
void MicroPython::ExecutionEnvironment::interrupt() {
mp_keyboard_interrupt();
}
extern "C" {
extern const void * _stack_start;
extern const void * _stack_end;