diff options
author | Brian Cully <bjc@kublai.com> | 2019-10-08 09:37:21 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2019-10-08 09:37:21 -0400 |
commit | 22cda6d6b362e47fcd5e1f8589297b43fdcb8204 (patch) | |
tree | c81d918547ccdb4361a62c6c2983c02c44dba3a5 /src/lib.rs | |
parent | 6d6fd2617ab909987e5ddecfb36519f0667ecf57 (diff) | |
download | atsamd-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.rs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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), } } } |