From 1de497e3fe6b1d3869a4a776fc277d301a934d7b Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 12 Jun 2024 14:16:49 +0800 Subject: [PATCH] commit the todo --- libs/cramium-hal/src/usb/driver.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/cramium-hal/src/usb/driver.rs b/libs/cramium-hal/src/usb/driver.rs index 7198a5c0d..4af540f43 100644 --- a/libs/cramium-hal/src/usb/driver.rs +++ b/libs/cramium-hal/src/usb/driver.rs @@ -2082,6 +2082,14 @@ impl CorigineUsb { pub fn handle_set_stalled(&mut self, ep_num: u8, dir: bool, stalled: bool) { let pei = 2 * ep_num as usize + if dir { 1 } else { 0 }; + // Note: in this case, we don't differentiate EP0 PEI, because in and out + // stall is handled separately despite being one physical endpoint. + + // TODO: resolve the problem with stalls + // - figure out the actual protocol spec for this + // - figure out how corigine actually handles stalls + + // this works with linux, but not with windows. if stalled != self.stall_spec[pei].unwrap_or(false) { self.stall_spec[pei] = Some(stalled); self.ep0_enqueue_zlp(stalled, CRG_INT_TARGET);