fn manage_error_states(&mut self) -> Result<()> {
        let read_intflag = self.nvm.intflag.read();
        // Check ADDRE and LOCKE first as it is more specific than PROGE
        let state = if read_intflag.addre().bit_is_set() {
            Err(Error::Peripheral(PeripheralError::AddressError))
        } else if read_intflag.locke().bit_is_set() {
            Err(Error::Peripheral(PeripheralError::LockError))
        } else if read_intflag.proge().bit_is_set() {
            Err(Error::Peripheral(PeripheralError::ProgrammingError))
        } else {
            Ok(())
        };

        // Clear error flags
        self.nvm.intflag.write(|w| w.addre().set_bit());
        self.nvm.intflag.write(|w| w.locke().set_bit());
        self.nvm.intflag.write(|w| w.proge().set_bit());
        state
    }
/// Read the peripheral state to check error flags and clear the up
/// afterwards
Read the peripheral state to check error flags and clear the up
afterwards
Read the peripheral state to check error flags and clear the up afterwards
fn manage_error_states(&mut self) -> Result<()> {
        let read_intflag = self.nvm.intflag.read();
        // Check ADDRE and LOCKE first as it is more specific than PROGE
        let state = if read_intflag.addre().bit_is_set() {
            Err(Error::Peripheral(PeripheralError::AddressError))
        } else if read_intflag.locke().bit_is_set() {
            Err(Error::Peripheral(PeripheralError::LockError))
        } else if read_intflag.proge().bit_is_set() {
            Err(Error::Peripheral(PeripheralError::ProgrammingError))
        } else {
            Ok(())
        };
        // Clear error flags
        self.nvm.intflag.write(|w| w.addre().set_bit());
        self.nvm.intflag.write(|w| w.locke().set_bit());
        self.nvm.intflag.write(|w| w.proge().set_bit());
        state
    }
fn manage_error_states ( & mut self ) -> Result < ( ) > { let read_intflag = self . nvm . intflag . read ( ) ; // Check ADDRE and LOCKE first as it is more specific than PROGE let state = if read_intflag . addre ( ) . bit_is_set ( ) { Err ( Error :: Peripheral ( PeripheralError :: AddressError ) ) } else if read_intflag . locke ( ) . bit_is_set ( ) { Err ( Error :: Peripheral ( PeripheralError :: LockError ) ) } else if read_intflag . proge ( ) . bit_is_set ( ) { Err ( Error :: Peripheral ( PeripheralError :: ProgrammingError ) ) } else { Ok ( ( ) ) } ; // Clear error flags self . nvm . intflag . write ( | w | w . addre ( ) . set_bit ( ) ) ; self . nvm . intflag . write ( | w | w . locke ( ) . set_bit ( ) ) ; self . nvm . intflag . write ( | w | w . proge ( ) . set_bit ( ) ) ; state }
Read the peripheral state to check error flags and clear the up
afterwards
Read the peripheral state to check error flags and clear the up afterwards
&mut self
&mut self