File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 110110//! method.
111111//!
112112//! ```ignore
113- //! fn main() {
114- //! let mut peripherals = stm32f30x::Peripherals::take().unwrap();
115- //! peripherals.GPIOA.odr.write(|w| w.bits(1));
116- //! }
113+ //! let mut peripherals = stm32f30x::Peripherals::take().unwrap();
114+ //! peripherals.GPIOA.odr.write(|w| w.bits(1));
117115//! ```
118116//!
119117//! This method can only be successfully called *once* -- that's why the method returns an `Option`.
120118//! Subsequent calls to the method will result in a `None` value being returned.
121119//!
122120//! ```ignore
123- //! fn main() {
124- //! let ok = stm32f30x::Peripherals::take().unwrap();
125- //! let panics = stm32f30x::Peripherals::take().unwrap();
126- //! }
121+ //! let ok = stm32f30x::Peripherals::take().unwrap();
122+ //! let panics = stm32f30x::Peripherals::take().unwrap();
127123//! ```
128124//!
129125//! The singleton property can be *unsafely* bypassed using the `ptr` static method which is
You can’t perform that action at this time.
0 commit comments