Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Peripherals {
- serial0: Option<Uart0>,
- serial1: Option<Uart1>,
- }
- struct Uart0;
- struct Uart1;
- impl Peripherals {
- fn take_serial0(&mut self) -> Uart0 {
- // let s = Option::replace(&mut self.serial0, None);
- let s = Option::replace(&mut self.serial0, None);
- s.unwrap()
- }
- }
- static S32G2XX_PERIFS: Peripherals = Peripherals{
- serial0: Some(Uart0),
- serial1: Some(Uart1),
- };
- fn main() {}
Add Comment
Please, Sign In to add comment