diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-07-22 15:37:32 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-07-22 16:30:16 +0200 |
| commit | a77ff721977e6071feb7000059d7e6185965949f (patch) | |
| tree | 0b94237034708765c13a4baeb1d165401b449991 /embassy-hal-common | |
| parent | b916a912df37852a6d32bd4a994aedf09ee96490 (diff) | |
Remove unused std_peripherals.
Diffstat (limited to 'embassy-hal-common')
| -rw-r--r-- | embassy-hal-common/src/macros.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/embassy-hal-common/src/macros.rs b/embassy-hal-common/src/macros.rs index c054a87c4..51e4a5eea 100644 --- a/embassy-hal-common/src/macros.rs +++ b/embassy-hal-common/src/macros.rs | |||
| @@ -89,42 +89,3 @@ macro_rules! unsafe_impl_unborrow { | |||
| 89 | } | 89 | } |
| 90 | }; | 90 | }; |
| 91 | } | 91 | } |
| 92 | |||
| 93 | #[macro_export] | ||
| 94 | macro_rules! std_peripherals { | ||
| 95 | ($($(#[$cfg:meta])? $name:ident),*$(,)?) => { | ||
| 96 | #[doc = r"All the peripherals"] | ||
| 97 | #[allow(non_snake_case)] | ||
| 98 | pub struct Peripherals { | ||
| 99 | $( | ||
| 100 | $(#[$cfg])? | ||
| 101 | pub $name: pac::$name, | ||
| 102 | )+ | ||
| 103 | } | ||
| 104 | |||
| 105 | static mut GLOBAL_CLOCKS: Option<Clocks> = None; | ||
| 106 | |||
| 107 | impl Peripherals { | ||
| 108 | pub fn take() -> Option<(Peripherals, Clocks)> { | ||
| 109 | match unsafe {GLOBAL_CLOCKS.take()} { | ||
| 110 | Some(clocks) => { | ||
| 111 | let dp = unsafe { pac::Peripherals::steal() }; | ||
| 112 | let peripherals = Peripherals { | ||
| 113 | $( | ||
| 114 | $(#[$cfg])? | ||
| 115 | $name: dp.$name, | ||
| 116 | )+ | ||
| 117 | }; | ||
| 118 | |||
| 119 | Some((peripherals, clocks)) | ||
| 120 | }, | ||
| 121 | None => None, | ||
| 122 | } | ||
| 123 | } | ||
| 124 | |||
| 125 | pub unsafe fn set_peripherals(clocks: Clocks) { | ||
| 126 | GLOBAL_CLOCKS.replace(clocks); | ||
| 127 | } | ||
| 128 | } | ||
| 129 | }; | ||
| 130 | } | ||
