aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6f3a63c94..95e6b3479 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -322,21 +322,6 @@ embassy_hal_internal::peripherals!(
322 WWDT0, 322 WWDT0,
323); 323);
324 324
325/// Get access to the PAC Peripherals for low-level register access.
326/// This is a lazy-initialized singleton that can be called after init().
327#[allow(static_mut_refs)]
328pub fn pac() -> &'static pac::Peripherals {
329 // SAFETY: We only call this after init(), and the PAC is a singleton.
330 // The embassy peripheral tokens ensure we don't have multiple mutable accesses.
331 unsafe {
332 static mut PAC_INSTANCE: Option<pac::Peripherals> = None;
333 if PAC_INSTANCE.is_none() {
334 PAC_INSTANCE = Some(pac::Peripherals::steal());
335 }
336 PAC_INSTANCE.as_ref().unwrap()
337 }
338}
339
340// Use cortex-m-rt's #[interrupt] attribute directly; PAC does not re-export it. 325// Use cortex-m-rt's #[interrupt] attribute directly; PAC does not re-export it.
341 326
342// Re-export interrupt traits and types 327// Re-export interrupt traits and types