bug fix of usb_prop.c

This commit is contained in:
NIIBE Yutaka
2011-01-29 00:00:47 +09:00
parent 6893a0bc64
commit 1180a22d66
3 changed files with 51 additions and 26 deletions

View File

@@ -203,12 +203,18 @@ gnuk_device_GetStringDescriptor (uint16_t Length)
(PONE_DESCRIPTOR)&String_Descriptor[wValue0]);
}
#ifdef ENABLE_VIRTUAL_COM_PORT
#define NUM_INTERFACES 3 /* two for CDC, one for CCID */
#define
#define NUM_INTERFACES 1 /* CCID only */
#endif
static RESULT
gnuk_device_Get_Interface_Setting (uint8_t Interface, uint8_t AlternateSetting)
{
if (AlternateSetting > 0)
if (AlternateSetting > 0) /* Any interface, we have no alternate */
return USB_UNSUPPORT;
else if (Interface > 1)
else if (Interface > NUM_INTERFACES)
return USB_UNSUPPORT;
return USB_SUCCESS;