summaryrefslogtreecommitdiff
path: root/supervisor/shared/micropython.c
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-08-26 18:50:26 -0400
committerLucian Copeland <hierophect@gmail.com>2020-08-26 18:50:26 -0400
commit8d2299e61e482f0edbf9f58bd20043761a30492a (patch)
tree9ee7c5402119e79795eb05d19ffbc9e50b49a4f8 /supervisor/shared/micropython.c
parentde9fd4a0fb26c1a62b97d6175c75568b68e50abd (diff)
parent58a7419b4ffcc99a7ea290f878f65b7e09acf027 (diff)
Merge remote-tracking branch 'upstream/main' into stm32-meowbit-fix
Diffstat (limited to 'supervisor/shared/micropython.c')
-rw-r--r--supervisor/shared/micropython.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/supervisor/shared/micropython.c b/supervisor/shared/micropython.c
index 245db11d4..bbc4807f9 100644
--- a/supervisor/shared/micropython.c
+++ b/supervisor/shared/micropython.c
@@ -29,14 +29,24 @@
#include "supervisor/serial.h"
#include "lib/oofatfs/ff.h"
#include "py/mpconfig.h"
+#include "py/mpstate.h"
+#include "py/runtime.h"
#include "supervisor/shared/status_leds.h"
+#if CIRCUITPY_WATCHDOG
+#include "shared-bindings/watchdog/__init__.h"
+#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception)
+#else
+#define WATCHDOG_EXCEPTION_CHECK() 0
+#endif
+
int mp_hal_stdin_rx_chr(void) {
for (;;) {
#ifdef MICROPY_VM_HOOK_LOOP
MICROPY_VM_HOOK_LOOP
#endif
+ mp_handle_pending();
if (serial_bytes_available()) {
toggle_rx_led();
return serial_read();