esp8266: Support raising KeyboardInterrupt on Ctrl+C.
diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c
index cc0eb3e..c78b360 100644
--- a/esp8266/esp_mphal.c
+++ b/esp8266/esp_mphal.c
@@ -98,7 +98,11 @@
 }
 
 void mp_hal_set_interrupt_char(int c) {
-    // TODO
+    if (c != -1) {
+        mp_obj_exception_clear_traceback(MP_STATE_PORT(mp_kbd_exception));
+    }
+    extern int interrupt_char;
+    interrupt_char = c;
 }
 
 void __assert_func(const char *file, int line, const char *func, const char *expr) {