replace ATTR_PACKED_STRUCT by simply ATTR_PACKED (drop IAR support)
remove "primitive_types.h" by simply include stdbool.h, stdint.h
This commit is contained in:
@@ -217,7 +217,7 @@ typedef enum {
|
||||
// FUNCTIONAL DESCRIPTOR (COMMUNICATION INTERFACE)
|
||||
//--------------------------------------------------------------------+
|
||||
/// Header Functional Descriptor (Communication Interface)
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -225,7 +225,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
}cdc_desc_func_header_t;
|
||||
|
||||
/// Union Functional Descriptor (Communication Interface)
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -234,7 +234,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
}cdc_desc_func_union_t;
|
||||
|
||||
#define cdc_desc_func_union_n_t(no_slave)\
|
||||
ATTR_PACKED_STRUCT(struct) { \
|
||||
struct ATTR_PACKED { \
|
||||
uint8_t bLength ;\
|
||||
uint8_t bDescriptorType ;\
|
||||
uint8_t bDescriptorSubType ;\
|
||||
@@ -243,7 +243,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
}
|
||||
|
||||
/// Country Selection Functional Descriptor (Communication Interface)
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -252,7 +252,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
}cdc_desc_func_country_selection_t;
|
||||
|
||||
#define cdc_desc_func_country_selection_n_t(no_country) \
|
||||
ATTR_PACKED_STRUCT(struct) {\
|
||||
struct ATTR_PACKED {\
|
||||
uint8_t bLength ;\
|
||||
uint8_t bDescriptorType ;\
|
||||
uint8_t bDescriptorSubType ;\
|
||||
@@ -266,7 +266,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
|
||||
/// \brief Call Management Functional Descriptor
|
||||
/// \details This functional descriptor describes the processing of calls for the Communications Class interface.
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -281,7 +281,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
}cdc_desc_func_call_management_t;
|
||||
|
||||
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t support_comm_request : 1; ///< Device supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature.
|
||||
uint8_t support_line_request : 1; ///< Device supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State.
|
||||
uint8_t support_send_break : 1; ///< Device supports the request Send_Break
|
||||
@@ -293,7 +293,7 @@ STATIC_ASSERT(sizeof(cdc_acm_capability_t) == 1, "mostly problem with compiler")
|
||||
|
||||
/// \brief Abstract Control Management Functional Descriptor
|
||||
/// \details This functional descriptor describes the commands supported by by the Communications Class interface with SubClass code of \ref CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -302,7 +302,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
|
||||
/// \brief Direct Line Management Functional Descriptor
|
||||
/// \details This functional descriptor describes the commands supported by the Communications Class interface with SubClass code of \ref CDC_FUNC_DESC_DIRECT_LINE_MANAGEMENT
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -317,7 +317,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
/// \brief Telephone Ringer Functional Descriptor
|
||||
/// \details The Telephone Ringer functional descriptor describes the ringer capabilities supported by the Communications Class interface,
|
||||
/// with the SubClass code of \ref CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -328,7 +328,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
/// \brief Telephone Operational Modes Functional Descriptor
|
||||
/// \details The Telephone Operational Modes functional descriptor describes the operational modes supported by
|
||||
/// the Communications Class interface, with the SubClass code of \ref CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -343,7 +343,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
/// \brief Telephone Call and Line State Reporting Capabilities Descriptor
|
||||
/// \details The Telephone Call and Line State Reporting Capabilities functional descriptor describes the abilities of a
|
||||
/// telephone device to report optional call and line states.
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength ; ///< Size of this descriptor in bytes.
|
||||
uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific
|
||||
uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_
|
||||
@@ -367,7 +367,7 @@ static inline uint8_t cdc_functional_desc_typeof(uint8_t const * p_desc)
|
||||
//--------------------------------------------------------------------+
|
||||
// Requests
|
||||
//--------------------------------------------------------------------+
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint32_t bit_rate;
|
||||
uint8_t stop_bits; ///< 0: 1 stop bit - 1: 1.5 stop bits - 2: 2 stop bits
|
||||
uint8_t parity; ///< 0: None - 1: Odd - 2: Even - 3: Mark - 4: Space
|
||||
@@ -376,7 +376,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
|
||||
STATIC_ASSERT(sizeof(cdc_line_coding_t) == 7, "size is not correct");
|
||||
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint16_t dte_is_present : 1; ///< Indicates to DCE if DTE is presentor not. This signal corresponds to V.24 signal 108/2 and RS-232 signal DTR.
|
||||
uint16_t half_duplex_carrier_control : 1;
|
||||
uint16_t : 14;
|
||||
|
@@ -93,7 +93,7 @@ typedef enum {
|
||||
}hid_request_type_t;
|
||||
|
||||
/// USB HID Descriptor
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t bLength; /**< Numeric expression that is the total size of the HID descriptor */
|
||||
uint8_t bDescriptorType; /**< Constant name specifying type of HID descriptor. */
|
||||
|
||||
@@ -155,7 +155,7 @@ typedef enum
|
||||
* @{ */
|
||||
|
||||
/// Standard HID Boot Protocol Mouse Report.
|
||||
typedef ATTR_PACKED_STRUCT(struct)
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
uint8_t buttons; /**< buttons mask for currently pressed buttons in the mouse. */
|
||||
int8_t x; /**< Current delta x movement of the mouse. */
|
||||
@@ -179,7 +179,7 @@ typedef enum {
|
||||
* @{ */
|
||||
|
||||
/// Standard HID Boot Protocol Keyboard Report.
|
||||
typedef ATTR_PACKED_STRUCT(struct)
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
uint8_t modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (a combination of HID_KEYBOARD_MODIFER_* masks). */
|
||||
uint8_t reserved; /**< Reserved for OEM use, always set to 0. */
|
||||
|
@@ -94,7 +94,7 @@ typedef enum {
|
||||
}msc_csw_status_t;
|
||||
|
||||
/// Command Block Wrapper
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint32_t signature ; ///< Signature that helps identify this data packet as a CBW. The signature field shall contain the value 43425355h (little endian), indicating a CBW.
|
||||
uint32_t tag ; ///< Tag sent by the host. The device shall echo the contents of this field back to the host in the dCSWTagfield of the associated CSW. The dCSWTagpositively associates a CSW with the corresponding CBW.
|
||||
uint32_t xfer_bytes ; ///< The number of bytes of data that the host expects to transfer on the Bulk-In or Bulk-Out endpoint (as indicated by the Directionbit) during the execution of this command. If this field is zero, the device and the host shall transfer no data between the CBW and the associated CSW, and the device shall ignore the value of the Directionbit in bmCBWFlags.
|
||||
@@ -107,7 +107,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
STATIC_ASSERT(sizeof(msc_cmd_block_wrapper_t) == 31, "size is not correct");
|
||||
|
||||
/// Command Status Wrapper
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint32_t signature ; ///< Signature that helps identify this data packet as a CSW. The signature field shall contain the value 53425355h (little endian), indicating CSW.
|
||||
uint32_t tag ; ///< The device shall set this field to the value received in the dCBWTag of the associated CBW.
|
||||
uint32_t data_residue ; ///< For Data-Out the device shall report in the dCSWDataResiduethe difference between the amount of data expected as stated in the dCBWDataTransferLength, and the actual amount of data processed by the device. For Data-In the device shall report in the dCSWDataResiduethe difference between the amount of data expected as stated in the dCBWDataTransferLengthand the actual amount of relevant data sent by the device
|
||||
@@ -156,7 +156,7 @@ typedef enum {
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
/// SCSI Test Unit Ready Command
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_TEST_UNIT_READY
|
||||
uint8_t lun ; ///< Logical Unit
|
||||
uint8_t reserved[3] ;
|
||||
@@ -166,7 +166,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
STATIC_ASSERT(sizeof(scsi_test_unit_ready_t) == 6, "size is not correct");
|
||||
|
||||
/// SCSI Inquiry Command
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_INQUIRY
|
||||
uint8_t reserved1 ;
|
||||
uint8_t page_code ;
|
||||
@@ -178,7 +178,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
STATIC_ASSERT(sizeof(scsi_inquiry_t) == 6, "size is not correct");
|
||||
|
||||
/// SCSI Inquiry Response Data
|
||||
typedef ATTR_PACKED_STRUCT(struct)
|
||||
typedef struct ATTR_PACKED
|
||||
{
|
||||
uint8_t peripheral_device_type : 5;
|
||||
uint8_t peripheral_qualifier : 3;
|
||||
@@ -224,7 +224,7 @@ typedef ATTR_PACKED_STRUCT(struct)
|
||||
STATIC_ASSERT(sizeof(scsi_inquiry_data_t) == 36, "size is not correct");
|
||||
|
||||
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t response_code : 7; ///< 70h - current errors, Fixed Format 71h - deferred errors, Fixed Format
|
||||
uint8_t valid : 1;
|
||||
|
||||
@@ -249,7 +249,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
|
||||
STATIC_ASSERT(sizeof(scsi_sense_fixed_data_t) == 18, "size is not correct");
|
||||
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_MODE_SENSE_6
|
||||
|
||||
uint8_t : 3;
|
||||
@@ -266,7 +266,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
|
||||
STATIC_ASSERT( sizeof(scsi_mode_sense_6_t) == 6, "size is not correct");
|
||||
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t mode_data_length;
|
||||
uint8_t medium_type;
|
||||
uint8_t device_specific_para;
|
||||
@@ -275,7 +275,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
|
||||
STATIC_ASSERT( sizeof(scsi_mode_parameters_t) == 4, "size is not correct");
|
||||
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t cmd_code; ///< SCSI OpCode for \ref SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL
|
||||
uint8_t reserved[3];
|
||||
uint8_t prohibit_removal;
|
||||
@@ -288,7 +288,7 @@ STATIC_ASSERT( sizeof(scsi_prevent_allow_medium_removal_t) == 6, "size is not co
|
||||
// SCSI MMC
|
||||
//--------------------------------------------------------------------+
|
||||
/// SCSI Read Format Capacity: Write Capacity
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t cmd_code;
|
||||
uint8_t reserved[6];
|
||||
uint16_t alloc_length;
|
||||
@@ -297,7 +297,7 @@ typedef ATTR_PACKED_STRUCT(struct) {
|
||||
|
||||
STATIC_ASSERT( sizeof(scsi_read_format_capacity_t) == 10, "size is not correct");
|
||||
|
||||
typedef ATTR_PACKED_STRUCT(struct){
|
||||
typedef struct ATTR_PACKED{
|
||||
uint8_t reserved[3];
|
||||
uint8_t list_length; /// must be 8*n, length in bytes of formattable capacity descriptor followed it.
|
||||
|
||||
@@ -317,7 +317,7 @@ STATIC_ASSERT( sizeof(scsi_read_format_capacity_data_t) == 12, "size is not corr
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
/// SCSI Read Capacity 10 Command: Read Capacity
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t cmd_code ; ///< SCSI OpCode for \ref SCSI_CMD_READ_CAPACITY_10
|
||||
uint8_t reserved1 ;
|
||||
uint32_t lba ; ///< The first Logical Block Address (LBA) accessed by this command
|
||||
@@ -337,7 +337,7 @@ typedef struct {
|
||||
STATIC_ASSERT(sizeof(scsi_read_capacity10_data_t) == 8, "size is not correct");
|
||||
|
||||
/// SCSI Read 10 Command
|
||||
typedef ATTR_PACKED_STRUCT(struct) {
|
||||
typedef struct ATTR_PACKED {
|
||||
uint8_t cmd_code ; ///< SCSI OpCode
|
||||
uint8_t reserved ; // has LUN according to wiki
|
||||
uint32_t lba ; ///< The first Logical Block Address (LBA) accessed by this command
|
||||
|
Reference in New Issue
Block a user