From 864196c884ef3602aee44f1a68aceb5819a07f21 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 27 Jul 2009 23:19:17 +0000 Subject: State information for class drivers is now zeroed out during enumeration (both in device and host mode) to ensure sane values after each enumeration. User code should no longer explicitly set state information as this is no longer preserved. --- LUFA/Drivers/USB/Class/Host/CDC.c | 2 ++ LUFA/Drivers/USB/Class/Host/HID.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'LUFA/Drivers/USB/Class/Host') diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c index 4402f3386..9c59b5c2d 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.c +++ b/LUFA/Drivers/USB/Class/Host/CDC.c @@ -39,6 +39,8 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint { uint8_t FoundEndpoints = 0; + memset(&CDCInterfaceInfo->State, 0x00, sizeof(CDCInterfaceInfo->State)); + if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration) return CDC_ENUMERROR_InvalidConfigDescriptor; diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index 8639b4836..6652cdcbe 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -39,6 +39,8 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, uint { uint8_t FoundEndpoints = 0; + memset(&HIDInterfaceInfo->State, 0x00, sizeof(HIDInterfaceInfo->State)); + if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration) return HID_ENUMERROR_InvalidConfigDescriptor; -- cgit v1.2.3