We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ffe0e0e + e793406 commit c917270Copy full SHA for c917270
ports/atmel-samd/supervisor/port.c
@@ -69,6 +69,7 @@
69
#include "samd/events.h"
70
#include "samd/external_interrupts.h"
71
#include "samd/dma.h"
72
+#include "shared-bindings/microcontroller/__init__.h"
73
#include "shared-bindings/rtc/__init__.h"
74
#include "reset.h"
75
@@ -496,7 +497,12 @@ void port_sleep_until_interrupt(void) {
496
497
(void) __get_FPSCR();
498
}
499
#endif
- __WFI();
500
+ common_hal_mcu_disable_interrupts();
501
+ if (!tud_task_event_ready()) {
502
+ __DSB();
503
+ __WFI();
504
+ }
505
+ common_hal_mcu_enable_interrupts();
506
507
508
/**
0 commit comments