From ac0345a2687fa3529de1ea5ae73a20e26cf98e47 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Fri, 13 Oct 2023 15:51:39 +0200 Subject: [PATCH] Fixing an issue with windows device enumeration --- CHANGELOG.md | 3 +++ src/control_pipe.rs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ae5acc..8b00796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed +* Fixed a defect where enumeration may fail due to timing-related issues ([#128](https://github.com/rust-embedded-community/usb-device/issues/128)) + ### Added * New enums and allocators for Isochronous endpoints ([#60](https://github.com/rust-embedded-community/usb-device/pull/60)). * Ability to select USB revision ([#116](https://github.com/rust-embedded-community/usb-device/pull/116)). diff --git a/src/control_pipe.rs b/src/control_pipe.rs index 17d5ff3..ba1ba2b 100644 --- a/src/control_pipe.rs +++ b/src/control_pipe.rs @@ -191,6 +191,11 @@ impl ControlPipe<'_, B> { self.state = ControlState::Idle; return true; } + ControlState::Idle => { + // If we received a message on EP0 while sending the last portion of an IN + // transfer, we may have already transitioned to IDLE without getting the last + // IN-complete status. Just ignore this indication. + } _ => { // Unexpected IN packet self.set_error();