Merge pull request #2956 from hathach/fix-samd-wfi
fix racing issue for SAMD when executing WFI
This commit is contained in:
commit
c917270da7
@ -69,6 +69,7 @@
|
||||
#include "samd/events.h"
|
||||
#include "samd/external_interrupts.h"
|
||||
#include "samd/dma.h"
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
#include "shared-bindings/rtc/__init__.h"
|
||||
#include "reset.h"
|
||||
|
||||
@ -496,8 +497,13 @@ void port_sleep_until_interrupt(void) {
|
||||
(void) __get_FPSCR();
|
||||
}
|
||||
#endif
|
||||
common_hal_mcu_disable_interrupts();
|
||||
if (!tud_task_event_ready()) {
|
||||
__DSB();
|
||||
__WFI();
|
||||
}
|
||||
common_hal_mcu_enable_interrupts();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Default interrupt handler for unused IRQs.
|
||||
|
Loading…
Reference in New Issue
Block a user