aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders/DFU
diff options
context:
space:
mode:
authorLászló Monda <laci@monda.hu>2013-10-06 22:16:20 +0200
committerLászló Monda <laci@monda.hu>2013-10-06 22:16:20 +0200
commit9ef29ea2293dde7225360fe258224d22d3a68756 (patch)
tree8b97bebc31be97f73384a605ccc2f41b2a04d492 /Bootloaders/DFU
parentcd3aae87daa243413413ab9fc4e32c225c3bea03 (diff)
downloadlufa-9ef29ea2293dde7225360fe258224d22d3a68756.tar.gz
lufa-9ef29ea2293dde7225360fe258224d22d3a68756.tar.bz2
lufa-9ef29ea2293dde7225360fe258224d22d3a68756.zip
Extract interface numbers into enums.
Diffstat (limited to 'Bootloaders/DFU')
-rw-r--r--Bootloaders/DFU/BootloaderDFU.h4
-rw-r--r--Bootloaders/DFU/Descriptors.c2
-rw-r--r--Bootloaders/DFU/Descriptors.h15
3 files changed, 15 insertions, 6 deletions
diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h
index 3d6d90649..949f7e8a5 100644
--- a/Bootloaders/DFU/BootloaderDFU.h
+++ b/Bootloaders/DFU/BootloaderDFU.h
@@ -170,7 +170,7 @@
dfuMANIFEST = 7,
dfuMANIFEST_WAIT_RESET = 8,
dfuUPLOAD_IDLE = 9,
- dfuERROR = 10
+ dfuERROR = 10
};
/** DFU command status error codes. Refer to the DFU class specification for information on each error code. */
@@ -191,7 +191,7 @@
errUSBR = 12,
errPOR = 13,
errUNKNOWN = 14,
- errSTALLEDPKT = 15
+ errSTALLEDPKT = 15
};
/* Function Prototypes: */
diff --git a/Bootloaders/DFU/Descriptors.c b/Bootloaders/DFU/Descriptors.c
index 5901dad12..9cd74cfd2 100644
--- a/Bootloaders/DFU/Descriptors.c
+++ b/Bootloaders/DFU/Descriptors.c
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
- .InterfaceNumber = 0,
+ .InterfaceNumber = INTERFACE_ID_DFU,
.AlternateSetting = 0,
.TotalEndpoints = 0,
diff --git a/Bootloaders/DFU/Descriptors.h b/Bootloaders/DFU/Descriptors.h
index c33e388c0..8bd46793e 100644
--- a/Bootloaders/DFU/Descriptors.h
+++ b/Bootloaders/DFU/Descriptors.h
@@ -164,15 +164,24 @@
USB_Descriptor_DFU_Functional_t DFU_Functional;
} 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_DFU = 0, /**< DFU 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 StringDescriptors_t
{
- STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
- STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
- STRING_ID_Product = 2, /**< Product string ID */
+ STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
+ STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
+ STRING_ID_Product = 2, /**< Product string ID */
};
/* Function Prototypes: */