pub fn handle_interrupt(&mut self) {
        // TODO: Use a cell type with get_mut() so we don't have to copy the state value around
        let mut state = self.state.take().unwrap_or(State::Reset);

        match state {
            State::Reset => panic!("Not reached"),
            State::Idle(_) => panic!("Not reached"),
            State::Active(ref mut mode) => match *mode {
                Mode::Device {
                    speed,
                    ref config,
                    ref mut state,
                } => self.handle_device_interrupt(speed, config, state),
                Mode::Host => panic!("Unimplemented"),
            },
        }

        self.state.replace(state);
    }
/// Handle an interrupt from the USBC
Handle an interrupt from the USBC
Handle an interrupt from the USBC
pub fn handle_interrupt(&mut self) {
        // TODO: Use a cell type with get_mut() so we don't have to copy the state value around
        let mut state = self.state.take().unwrap_or(State::Reset);
        match state {
            State::Reset => panic!("Not reached"),
            State::Idle(_) => panic!("Not reached"),
            State::Active(ref mut mode) => match *mode {
                Mode::Device {
                    speed,
                    ref config,
                    ref mut state,
                } => self.handle_device_interrupt(speed, config, state),
                Mode::Host => panic!("Unimplemented"),
            },
        }
        self.state.replace(state);
    }
pub fn handle_interrupt ( & mut self ) { // TODO: Use a cell type with get_mut() so we don't have to copy the state value around let mut state = self . state . take ( ) . unwrap_or ( State :: Reset ) ; match state { State :: Reset => panic ! ( " " ) , State :: Idle ( _ ) => panic ! ( " " ) , State :: Active ( ref mut mode ) => match * mode { Mode :: Device { speed , ref config , ref mut state , } => self . handle_device_interrupt ( speed , config , state ) , Mode :: Host => panic ! ( " " ) , } , } self . state . replace ( state ) ; }
Handle an interrupt from the USBC
Handle an interrupt from the USBC
&mut self
&mut self