libboard_zynq: fully modified to work with core_io

drtio_port
mwojcik 2021-08-27 15:16:13 +02:00
parent 581f6c6b4e
commit 59cf4bc689
2 changed files with 4 additions and 12 deletions

View File

@ -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);

View File

@ -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,