aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-10-08 09:37:21 -0400
committerBrian Cully <bjc@kublai.com>2019-10-08 09:37:21 -0400
commit22cda6d6b362e47fcd5e1f8589297b43fdcb8204 (patch)
treec81d918547ccdb4361a62c6c2983c02c44dba3a5 /src/lib.rs
parent6d6fd2617ab909987e5ddecfb36519f0667ecf57 (diff)
downloadatsamd-usb-host-22cda6d6b362e47fcd5e1f8589297b43fdcb8204.tar.gz
atsamd-usb-host-22cda6d6b362e47fcd5e1f8589297b43fdcb8204.zip
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`.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs5
1 files changed, 4 insertions, 1 deletions
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<PipeErr> 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),
}
}
}