forked from M-Labs/artiq
1
0
Fork 0

drtio: report get FIFO space timeouts to log

This commit is contained in:
Sebastien Bourdeauducq 2017-01-10 16:12:46 -06:00
parent 98598df78e
commit d3d23d0d3b
1 changed files with 12 additions and 14 deletions

View File

@ -110,25 +110,23 @@ mod drtio {
} }
} }
fn packet_error_present() -> bool { fn poll_errors() -> bool {
unsafe { unsafe {
csr::drtio::packet_err_present_read() != 0 if csr::drtio::packet_err_present_read() != 0 {
error!("packet error {}", csr::drtio::packet_err_code_read());
csr::drtio::packet_err_present_write(1)
}
if csr::drtio::o_fifo_space_timeout_read() != 0 {
error!("timeout attempting to get remote FIFO space");
csr::drtio::o_fifo_space_timeout_write(1)
} }
} }
false
fn get_packet_error() -> u8 {
unsafe {
let err = csr::drtio::packet_err_code_read();
csr::drtio::packet_err_present_write(1);
err
}
} }
pub fn error_thread(waiter: Waiter, _spawner: Spawner) { pub fn error_thread(waiter: Waiter, _spawner: Spawner) {
loop { // HACK
waiter.until(packet_error_present).unwrap(); waiter.until(poll_errors).unwrap();
error!("DRTIO packet error {}", get_packet_error());
}
} }
} }