tool: Move read_debug
to trait so generic code can use it
Returns error for backends that don't support it.
This commit is contained in:
committed by
Jeremy Soller
parent
0c1584385c
commit
504284bf72
@@ -130,12 +130,6 @@ impl AccessLpcLinux {
|
||||
Ok(self.cmd.write(addr as u16, data)?)
|
||||
}
|
||||
|
||||
/// Read from the debug space
|
||||
//TODO: better public interface
|
||||
pub unsafe fn read_debug(&mut self, addr: u8) -> Result<u8, Error> {
|
||||
Ok(self.dbg.read(addr as u16)?)
|
||||
}
|
||||
|
||||
/// Returns Ok if a command can be sent
|
||||
unsafe fn command_check(&mut self) -> Result<(), Error> {
|
||||
if self.read_cmd(SMFI_CMD_CMD)? == 0 {
|
||||
@@ -180,4 +174,8 @@ impl Access for AccessLpcLinux {
|
||||
fn data_size(&self) -> usize {
|
||||
SMFI_CMD_SIZE - SMFI_CMD_DATA as usize
|
||||
}
|
||||
|
||||
unsafe fn read_debug(&mut self, addr: u8) -> Result<u8, Error> {
|
||||
Ok(self.dbg.read(addr as u16)?)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user