From 958e99ff3d39b23bfeef7ee12f2a976e51e2ea13 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Sun, 17 Oct 2010 00:30:13 -0400 Subject: [PATCH] psgroove should use the PORT1_NUM_CONFIGS to determine how many configs there is to send for port1 --- psgroove.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/psgroove.c b/psgroove.c index 470482e..6271982 100644 --- a/psgroove.c +++ b/psgroove.c @@ -468,7 +468,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, // 4 configurations are the same. // For the initial 8-byte request, we give a different // length response than in the full request. - if (DescriptorNumber < 4) { + if (DescriptorNumber < PORT1_NUM_CONFIGS) { if (wLength == 8) { Address = (void *) port1_short_config_descriptor; Size = sizeof(port1_short_config_descriptor); @@ -476,7 +476,8 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, Address = (void *) port1_config_descriptor; Size = PORT1_DESC_LEN; } - if (DescriptorNumber == 3 && wLength > 8) { + if (DescriptorNumber == (PORT1_NUM_CONFIGS - 1) && + wLength > 8) { state = p1_ready; expire = 10; }