nrf: port: add memory barrier before wfi
ARM recommends issuing a DSB instruction propr to issuing WFI, as it is required on many parts suchas Cortex-M7. This is effectively a no-op on the Cortex-M4 used in most NRF parts, however it ensures that we won't be surprised when new parts come out. See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHICBGB.html for more information. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
77cf4dce8f
commit
fd4ef233c6
@ -273,8 +273,10 @@ void port_sleep_until_interrupt(void) {
|
||||
// available, even though the actual handler won't fire until
|
||||
// we re-enable interrupts.
|
||||
common_hal_mcu_disable_interrupts();
|
||||
if (!tud_task_event_ready())
|
||||
if (!tud_task_event_ready()) {
|
||||
__DSB();
|
||||
__WFI();
|
||||
}
|
||||
common_hal_mcu_enable_interrupts();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user