@@ -96,7 +96,15 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result
9696 ///
9797 ///# Safety
9898 ///
99- ///Make sure that [`Peripherals::steal`] is already called
99+ /// Ensure that the new instance of the peripheral cannot be used in a way
100+ /// that may race with any existing instances, for example by only
101+ /// accessing read-only or write-only registers, or by consuming the
102+ /// original peripheral and using critical sections to coordinate
103+ /// access between multiple new instances.
104+ ///
105+ /// Additionally, other software such as HALs may rely on only one
106+ /// peripheral instance existing to ensure memory safety; ensure
107+ /// no stolen instances are passed to such software.
100108 pub unsafe fn steal( ) -> Self {
101109 Self { _marker: PhantomData }
102110 }
@@ -161,10 +169,18 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result
161169 }
162170
163171 ///Steal an instance of this peripheral
164- ///
165- ///# Safety
166- ///
167- ///Make sure that [`Peripherals::steal`] is already called
172+ ///
173+ ///# Safety
174+ ///
175+ /// Ensure that the new instance of the peripheral cannot be used in a way
176+ /// that may race with any existing instances, for example by only
177+ /// accessing read-only or write-only registers, or by consuming the
178+ /// original peripheral and using critical sections to coordinate
179+ /// access between multiple new instances.
180+ ///
181+ /// Additionally, other software such as HALs may rely on only one
182+ /// peripheral instance existing to ensure memory safety; ensure
183+ /// no stolen instances are passed to such software.
168184 pub unsafe fn steal( ) -> Self {
169185 Self { _marker: PhantomData }
170186 }
0 commit comments