diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-07-29 13:44:51 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-07-29 13:44:51 +0200 |
| commit | 7bfb763e0990aac1b0bc4ad95dcc55df53cdb6d9 (patch) | |
| tree | a7552da59a774d79a3cd73ad7c109b02b8bac921 /embassy-hal-common/src/lib.rs | |
| parent | c8a48d726a7cc92ef989a519fdf55ec1f9fffbcd (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.rs | 21 |
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. | ||
| 4 | pub(crate) mod fmt; | ||
| 5 | |||
| 6 | pub mod interrupt; | ||
| 7 | mod macros; | ||
| 8 | pub mod peripheral; | ||
| 9 | pub mod peripheral_shared; | ||
| 10 | pub mod ring_buffer; | ||
| 11 | pub mod usb; | ||
| 12 | |||
| 13 | /// Low power blocking wait loop using WFE/SEV. | ||
| 14 | pub 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 | } | ||
