aboutsummaryrefslogtreecommitdiff
path: root/embassy-hal-common/src/lib.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-07-29 13:44:51 +0200
committerDario Nieuwenhuis <[email protected]>2021-07-29 13:44:51 +0200
commit7bfb763e0990aac1b0bc4ad95dcc55df53cdb6d9 (patch)
treea7552da59a774d79a3cd73ad7c109b02b8bac921 /embassy-hal-common/src/lib.rs
parentc8a48d726a7cc92ef989a519fdf55ec1f9fffbcd (diff)
Rename embassy-extras to embassy-hal-common
Diffstat (limited to 'embassy-hal-common/src/lib.rs')
-rw-r--r--embassy-hal-common/src/lib.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/embassy-hal-common/src/lib.rs b/embassy-hal-common/src/lib.rs
new file mode 100644
index 000000000..7036986ef
--- /dev/null
+++ b/embassy-hal-common/src/lib.rs
@@ -0,0 +1,21 @@
1#![no_std]
2
3// This mod MUST go first, so that the others see its macros.
4pub(crate) mod fmt;
5
6pub mod interrupt;
7mod macros;
8pub mod peripheral;
9pub mod peripheral_shared;
10pub mod ring_buffer;
11pub mod usb;
12
13/// Low power blocking wait loop using WFE/SEV.
14pub fn low_power_wait_until(mut condition: impl FnMut() -> bool) {
15 while !condition() {
16 // WFE might "eat" an event that would have otherwise woken the executor.
17 cortex_m::asm::wfe();
18 }
19 // Retrigger an event to be transparent to the executor.
20 cortex_m::asm::sev();
21}