From 9ef29ea2293dde7225360fe258224d22d3a68756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 6 Oct 2013 22:16:20 +0200 Subject: Extract interface numbers into enums. --- Projects/AVRISP-MKII/AVRISPDescriptors.c | 2 +- Projects/AVRISP-MKII/AVRISPDescriptors.h | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'Projects/AVRISP-MKII') diff --git a/Projects/AVRISP-MKII/AVRISPDescriptors.c b/Projects/AVRISP-MKII/AVRISPDescriptors.c index cb19051f4..c185cb9f4 100644 --- a/Projects/AVRISP-MKII/AVRISPDescriptors.c +++ b/Projects/AVRISP-MKII/AVRISPDescriptors.c @@ -101,7 +101,7 @@ AVRISP_USB_Descriptor_Configuration_t AVRISP_ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = 0, + .InterfaceNumber = INTERFACE_ID_AVRISP, .AlternateSetting = 0, .TotalEndpoints = 2, diff --git a/Projects/AVRISP-MKII/AVRISPDescriptors.h b/Projects/AVRISP-MKII/AVRISPDescriptors.h index 2f1192384..68bb10359 100644 --- a/Projects/AVRISP-MKII/AVRISPDescriptors.h +++ b/Projects/AVRISP-MKII/AVRISPDescriptors.h @@ -86,16 +86,25 @@ USB_Descriptor_Endpoint_t AVRISP_DataOutEndpoint; } AVRISP_USB_Descriptor_Configuration_t; + /** Enum for the device interface descriptor IDs within the device. Each interface descriptor + * should have a unique ID index associated with it, which can be used to refer to the + * interface from other descriptors. + */ + enum InterfaceDescriptors_t + { + INTERFACE_ID_AVRISP = 0, /**< AVRISP interface descriptor ID */ + }; + /** Enum for the device string descriptor IDs within the device. Each string descriptor should * have a unique ID index associated with it, which can be used to refer to the string from * other descriptors. */ enum AVRISP_StringDescriptors_t { - AVRISP_STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ - AVRISP_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ - AVRISP_STRING_ID_Product = 2, /**< Product string ID */ - AVRISP_STRING_ID_Serial = 3, /**< Serial number string ID */ + AVRISP_STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ + AVRISP_STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ + AVRISP_STRING_ID_Product = 2, /**< Product string ID */ + AVRISP_STRING_ID_Serial = 3, /**< Serial number string ID */ }; /* External Variables: */ -- cgit v1.2.3