/// Reads a byte from a given address in the ATSAM's memory.
Reads a byte from a given address in the ATSAM's memory.
Reads a byte from a given address in the ATSAM ' s memory .
fn read_byte(&mut self, address: u32) -> Result<u8, Error> {
        let command = CString::new(format!("o{:08X},#", address)).unwrap();
        self.bus.write(command.as_bytes())?;
        let mut buffer = [0];
        self.bus.read_exact(&mut buffer)
            .map_err(|_| FdfuError::SamBaRead(format!("a byte from {:08X}", address)))?;
        Ok(buffer[0])
    }
fn read_byte ( & mut self , address : u32 ) -> Result < u8 , Error > { let command = CString :: new ( format ! ( " " address ) ) . unwrap ( ) ; self . bus . write ( command . as_bytes ( ) ) ? ; let mut buffer = [ 0 ] ; self . bus . read_exact ( & mut buffer ) . map_err ( | _ | FdfuError :: SamBaRead ( format ! ( " " address ) ) ) ? ; Ok ( buffer [ 0 ] ) }
Reads a byte from a given address in the ATSAM's memory.
Reads a byte from a given address in the ATSAM ' s memory .
&mut self
address
u32