From 7ee5cb570f0c0daeb2e6a9d5120fd96ee885025f Mon Sep 17 00:00:00 2001 From: James Munns Date: Mon, 24 Nov 2025 18:41:43 +0100 Subject: Remove the pac singleton function (#42) There will be a follow up PR that removes the unsafe `init` functions, but I wanted to squash this out first in case I don't get to it all today. --- src/lib.rs | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/lib.rs') 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!( WWDT0, ); -/// Get access to the PAC Peripherals for low-level register access. -/// This is a lazy-initialized singleton that can be called after init(). -#[allow(static_mut_refs)] -pub fn pac() -> &'static pac::Peripherals { - // SAFETY: We only call this after init(), and the PAC is a singleton. - // The embassy peripheral tokens ensure we don't have multiple mutable accesses. - unsafe { - static mut PAC_INSTANCE: Option = None; - if PAC_INSTANCE.is_none() { - PAC_INSTANCE = Some(pac::Peripherals::steal()); - } - PAC_INSTANCE.as_ref().unwrap() - } -} - // Use cortex-m-rt's #[interrupt] attribute directly; PAC does not re-export it. // Re-export interrupt traits and types -- cgit