OSDN Git Service

USB/usb_const.h: CDC class; USB/usb_descriptor.h: __attribute__ (( packed ))
[stock/stock.osdn.git] / USB / usb_descriptor.h
index 3841c2b..4c3fdab 100644 (file)
@@ -71,7 +71,11 @@ struct usb_dscr_device_t {
    uint8_t  iProduct; // Product String Index
    uint8_t  iSerialNumber; // Serial Number String Index
    uint8_t  bNumConfigurations; // Number of Configurations in this Interface
-};
+}
+#ifdef __GNUC__
+__attribute__ (( packed ))
+#endif
+;
 
 struct usb_dscr_device_qualifier_t {
    uint8_t  bLength; // Length of this Descriptor = 10 bytes
@@ -83,7 +87,11 @@ struct usb_dscr_device_qualifier_t {
    uint8_t  bMaxPacketSize0; // Maximum Packet Size for EP0
    uint8_t  bNumConfigurations; // Number of Configurations in this Interface
    uint8_t  bReserved;
-};
+}
+#ifdef __GNUC__
+__attribute__ (( packed ))
+#endif
+;
 
 struct usb_dscr_configuration_t {
    uint8_t  bLength; // Length of this Descriptor = 9 bytes
@@ -94,7 +102,11 @@ struct usb_dscr_configuration_t {
    uint8_t  iConfiguration; // Configuration String Index
    uint8_t  bmAttributes; // Attributes
    uint8_t  MaxPower; // Maximum Power
-};
+}
+#ifdef __GNUC__
+__attribute__ (( packed ))
+#endif
+;
 
 struct usb_dscr_interface_t {
    uint8_t  bLength; // Length of this Descriptor = 9 bytes
@@ -106,7 +118,11 @@ struct usb_dscr_interface_t {
    uint8_t  bDeviceSubClass;
    uint8_t  bDeviceProtocol;
    uint8_t  iInterface; // Interface String Index
-};
+}
+#ifdef __GNUC__
+__attribute__ (( packed ))
+#endif
+;
 
 struct usb_dscr_endpoint_t {
    uint8_t  bLength; // Length of this Descriptor = 7 bytes
@@ -115,14 +131,22 @@ struct usb_dscr_endpoint_t {
    uint8_t  bmAttributes;   // Attributes
    uint16_t wMaxPacketSize; // Maximum Packet Size
    uint8_t  bInterval; // Polling Interval in Milliseconds
-};
+}
+#ifdef __GNUC__
+__attribute__ (( packed ))
+#endif
+;
 
 // USB1.0 Endpoint descriptor
 struct usb_dscr_endpoint_10_t {
    struct usb_dscr_endpoint_t ep;
    uint8_t  bRefresh; // new sync value is available every 2^bRefresh frames
    uint8_t  bSynchAddress; // associated synch Endpoint (or 0)
-};
+}
+#ifdef __GNUC__
+__attribute__ (( packed ))
+#endif
+;
 
 
 struct usb_dscr_hdr_t {