diff options
| author | Dan Halbert <halbert@halwitz.org> | 2020-08-30 14:39:03 -0400 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2020-08-30 14:39:03 -0400 |
| commit | 6dbd369272c4bedea4e00c1dca80d0b3ee2d6781 (patch) | |
| tree | 44707cefb3dd7535492987671a75ad281d84824a /supervisor/shared/micropython.c | |
| parent | 767f3d0feb1e145efc2def5048e91d910bbe2f9a (diff) | |
| parent | 0adccc50dcc9e9db9a054da563fe4f165e8d912e (diff) | |
merge from upstream
Diffstat (limited to 'supervisor/shared/micropython.c')
| -rw-r--r-- | supervisor/shared/micropython.c | 10 |
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(); |
