From 22cda6d6b362e47fcd5e1f8589297b43fdcb8204 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 8 Oct 2019 09:37:21 -0400 Subject: Handle all known transfer/pipe errors. * Remove `PipeErr::Other`. * Add more variants to `PipeErr`. * Integrate `is_transfer_complete` into `dispatch_result` and simplify. * Cache volatile `intflag` on entry to `dispatch_result` to ensure consistent handling. * Clear fail/perr `intflag` bits in `dispatch_result`. --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 69b3fd3..5e8cc3c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -543,7 +543,10 @@ impl From for TransferError { PipeErr::PipeErr => Self::Permanent("pipe error"), PipeErr::HWTimeout => Self::Permanent("hardware timeout"), PipeErr::SWTimeout => Self::Permanent("software timeout"), - PipeErr::Other(s) => Self::Permanent(s), + PipeErr::PID => Self::Permanent("pid error"), + PipeErr::DataPID => Self::Permanent("data pid error"), + PipeErr::CRC16 => Self::Permanent("crc16 error"), + //PipeErr::Other(s) => Self::Permanent(s), } } } -- cgit v1.2.3