libboard_zynq: fully modified to work with core_io
This commit is contained in:
parent
581f6c6b4e
commit
59cf4bc689
@ -1,7 +1,7 @@
|
||||
use core::slice;
|
||||
use crc;
|
||||
|
||||
use core_io::Error as IoError;
|
||||
use core_io::{ErrorKind as IoErrorKind, Error as IoError};
|
||||
|
||||
use io::{proto::ProtoRead, proto::ProtoWrite, Cursor};
|
||||
use mem::mem::DRTIOAUX_MEM;
|
||||
@ -84,7 +84,7 @@ pub fn recv(linkno: u8) -> Result<Option<Packet>, Error> {
|
||||
|
||||
receive(linkno, |buffer| {
|
||||
if buffer.len() < 8 {
|
||||
return Err(IoError::UnexpectedEnd.into())
|
||||
return Err(IoError::new(IoErrorKind::UnexpectedEof, "Unexpected end").into())
|
||||
}
|
||||
|
||||
let mut reader = Cursor::new(buffer);
|
||||
|
@ -1,6 +1,6 @@
|
||||
use core_io::Error as IoError;
|
||||
use core_io::{Write, Read, Error as IoError};
|
||||
|
||||
use io::proto::{ProtoWrite as Write, ProtoRead as Read};
|
||||
use io::proto::{ProtoWrite, ProtoRead};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
@ -14,14 +14,6 @@ impl From<IoError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
/* Why does this not work?!
|
||||
impl From<Write::WriteError> for Error {
|
||||
fn from(value: Write::WriteError) -> Error {
|
||||
Error::Io(value)
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum Packet {
|
||||
EchoRequest,
|
||||
|
Loading…
Reference in New Issue
Block a user