forked from M-Labs/artiq
firmware: migrate analyzer_proto to new libio.
This commit is contained in:
parent
2999756493
commit
976bb5e935
@ -11,5 +11,6 @@ path = "lib.rs"
|
|||||||
byteorder = { version = "1.0", default-features = false }
|
byteorder = { version = "1.0", default-features = false }
|
||||||
cslice = { version = "0.3" }
|
cslice = { version = "0.3" }
|
||||||
log = { version = "0.4", default-features = false, optional = true }
|
log = { version = "0.4", default-features = false, optional = true }
|
||||||
|
io = { path = "../libio", features = ["byteorder"] }
|
||||||
std_artiq = { path = "../libstd_artiq", features = ["alloc"] }
|
std_artiq = { path = "../libstd_artiq", features = ["alloc"] }
|
||||||
dyld = { path = "../libdyld" }
|
dyld = { path = "../libdyld" }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use std::io::{self, Write};
|
use io::{Write, Result};
|
||||||
use WriteExt;
|
use io::proto::{ProtoWrite};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Header {
|
pub struct Header {
|
||||||
@ -11,7 +11,7 @@ pub struct Header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Header {
|
impl Header {
|
||||||
pub fn write_to(&self, writer: &mut Write) -> io::Result<()> {
|
pub fn write_to<T: Write>(&self, writer: &mut T) -> Result<(), T::WriteError> {
|
||||||
writer.write_u32(self.sent_bytes)?;
|
writer.write_u32(self.sent_bytes)?;
|
||||||
writer.write_u64(self.total_byte_count)?;
|
writer.write_u64(self.total_byte_count)?;
|
||||||
writer.write_u8(self.overflow_occurred as u8)?;
|
writer.write_u8(self.overflow_occurred as u8)?;
|
||||||
|
@ -6,6 +6,7 @@ extern crate cslice;
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
|
extern crate io;
|
||||||
extern crate dyld;
|
extern crate dyld;
|
||||||
extern crate std_artiq as std;
|
extern crate std_artiq as std;
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ cslice = { version = "0.3" }
|
|||||||
log = { version = "0.4", default-features = false }
|
log = { version = "0.4", default-features = false }
|
||||||
managed = { version = "0.6", default-features = false, features = ["alloc", "map"] }
|
managed = { version = "0.6", default-features = false, features = ["alloc", "map"] }
|
||||||
unwind_backtrace = { path = "../libunwind_backtrace" }
|
unwind_backtrace = { path = "../libunwind_backtrace" }
|
||||||
|
io = { path = "../libio", features = ["std_artiq"] }
|
||||||
board = { path = "../libboard", features = ["uart_console", "smoltcp"] }
|
board = { path = "../libboard", features = ["uart_console", "smoltcp"] }
|
||||||
alloc_list = { path = "../liballoc_list" }
|
alloc_list = { path = "../liballoc_list" }
|
||||||
std_artiq = { path = "../libstd_artiq", features = ["alloc", "io_error_alloc"] }
|
std_artiq = { path = "../libstd_artiq", features = ["alloc", "io_error_alloc"] }
|
||||||
|
Loading…
Reference in New Issue
Block a user