We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fd2472 commit 47425f2Copy full SHA for 47425f2
shared-module/time/__init__.c
@@ -27,6 +27,8 @@
27
#include "py/mphal.h"
28
#include "supervisor/port.h"
29
#include "supervisor/shared/tick.h"
30
+#include "py/obj.h"
31
+#include "py/mpstate.h"
32
33
uint64_t common_hal_time_monotonic(void) {
34
return supervisor_ticks_ms64();
@@ -42,4 +44,9 @@ uint64_t common_hal_time_monotonic_ns(void) {
42
44
43
45
void common_hal_time_delay_ms(uint32_t delay) {
46
mp_hal_delay_ms(delay);
47
+ // if the delay was cut short by a CTRL-C then clear the keyboard exception
48
+ if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)))
49
+ {
50
+ MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL;
51
+ }
52
}
0 commit comments