summaryrefslogtreecommitdiff
path: root/supervisor/shared/micropython.c
diff options
context:
space:
mode:
authorBenjamin Shockley <benjaminshockley@hotmail.com>2021-01-03 10:41:16 -0600
committerGitHub <noreply@github.com>2021-01-03 10:41:16 -0600
commit8c8961ad0142a20793910363c8182c847b47bc58 (patch)
tree986358982921ccb6e887b0f0f5af39ec67709990 /supervisor/shared/micropython.c
parent0084f0af24e4e219bc040c52ee723959423de6e2 (diff)
parent80fa60d4ef6a054cc481318caba96ef8d77fc026 (diff)
Merge pull request #3 from adafruit/main
Rebase
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();