summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--atmel-samd/mphalport.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/atmel-samd/mphalport.c b/atmel-samd/mphalport.c
index d442fe8a8..01a964753 100644
--- a/atmel-samd/mphalport.c
+++ b/atmel-samd/mphalport.c
@@ -236,6 +236,10 @@ void mp_hal_delay_ms(mp_uint_t delay) {
uint32_t duration = 0;
while (duration < delay) {
udi_msc_process_trans();
+ // Check to see if we've been CTRL-Ced by autoreset or the user.
+ if(MP_STATE_VM(mp_pending_exception) == MP_STATE_PORT(mp_kbd_exception)) {
+ break;
+ }
duration = (mp_hal_ticks_ms() - start_tick) & MP_SMALL_INT_POSITIVE_MASK;
}
} else {