aboutsummaryrefslogtreecommitdiffstats
path: root/usbh/src/pipe.rs
diff options
context:
space:
mode:
Diffstat (limited to 'usbh/src/pipe.rs')
-rw-r--r--usbh/src/pipe.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/usbh/src/pipe.rs b/usbh/src/pipe.rs
index 3dab629..388b518 100644
--- a/usbh/src/pipe.rs
+++ b/usbh/src/pipe.rs
@@ -21,14 +21,19 @@ use atsamd_hal::target_device::usb::{
use core::convert::TryInto;
use log::{debug, trace};
-// TODO: verify this timeout against §9.2.6.1 of USB 2.0 spec.
+// Maximum time to wait for a control request with data to finish. cf
+// §9.2.6.1 of USB 2.0.
const USB_TIMEOUT: usize = 5 * 1024; // 5 Seconds
// samd21 only supports 8 pipes.
const MAX_PIPES: usize = 8;
+// How many times to retry a transaction that has transient errors.
const NAK_LIMIT: usize = 15;
+// For use in control requests that do not require a data stage.
+pub(crate) const NO_DATA_STAGE: Option<&mut ()> = None;
+
#[derive(Copy, Clone, Debug, PartialEq)]
pub(crate) enum PipeErr {
ShortPacket,