Merge pull request #286 from josesimoes/patch-1

Replace packed struct definition with one from CMSIS
This commit is contained in:
Fabien Poussin 2021-09-20 19:52:29 +02:00 committed by GitHub
commit 1127b5575e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 23 deletions

View File

@ -26,11 +26,9 @@
#ifdef __IAR_SYSTEMS_ICC__
#define PACKED_STRUCT PACKED_VAR struct
#else
#define PACKED_STRUCT struct PACKED_VAR
#endif
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t bcdUSB;
@ -49,7 +47,7 @@ typedef PACKED_STRUCT {
#define USBH_DT_DEVICE 0x01
#define USBH_DT_DEVICE_SIZE 18
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t wTotalLength;
@ -62,7 +60,7 @@ typedef PACKED_STRUCT {
#define USBH_DT_CONFIG 0x02
#define USBH_DT_CONFIG_SIZE 9
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t wData[1];
@ -70,7 +68,7 @@ typedef PACKED_STRUCT {
#define USBH_DT_STRING 0x03
#define USBH_DT_STRING_SIZE 2
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bInterfaceNumber;
@ -84,7 +82,7 @@ typedef PACKED_STRUCT {
#define USBH_DT_INTERFACE 0x04
#define USBH_DT_INTERFACE_SIZE 9
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bEndpointAddress;
@ -95,7 +93,7 @@ typedef PACKED_STRUCT {
#define USBH_DT_ENDPOINT 0x05
#define USBH_DT_ENDPOINT_SIZE 7
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bFirstInterface;
@ -108,7 +106,7 @@ typedef PACKED_STRUCT {
#define USBH_DT_INTERFACE_ASSOCIATION 0x0b
#define USBH_DT_INTERFACE_ASSOCIATION_SIZE 8
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bDescLength;
uint8_t bDescriptorType;
uint8_t bNbrPorts;
@ -120,7 +118,7 @@ typedef PACKED_STRUCT {
#define USBH_DT_HUB 0x29
#define USBH_DT_HUB_SIZE (7 + 4)
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bmRequestType;
uint8_t bRequest;
uint16_t wValue;

View File

@ -178,7 +178,7 @@ typedef enum {
} usbh_uvc_ctrl_vs_interface_controls_t;
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubType;
@ -192,7 +192,7 @@ typedef PACKED_STRUCT {
uint8_t bCopyProtect;
} usbh_uvc_format_mjpeg_t;
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubType;
@ -209,7 +209,7 @@ typedef PACKED_STRUCT {
} usbh_uvc_frame_mjpeg_t;
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubType;
@ -225,7 +225,7 @@ typedef PACKED_STRUCT {
uint32_t dwFrameInterval[0];
} usbh_uvc_frame_uncompressed_t;
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bDescriptorSubType;
@ -240,7 +240,7 @@ typedef PACKED_STRUCT {
uint8_t bCopyProtect;
} usbh_uvc_format_uncompressed;
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint16_t bmHint;
uint8_t bFormatIndex;
uint8_t bFrameIndex;
@ -267,14 +267,14 @@ typedef PACKED_STRUCT {
* segment. This behavior is required for frame-based payload formats (e.g., DV) and is optional
* for stream-based payload formats (e.g., MPEG-2 TS). For stream-based formats, support for this
* bit must be indicated via the bmFramingInfofield of the Video Probe and Commitcontrols
* (see section 4.3.1.1, Video Probe and Commit Controls).
* (see section 4.3.1.1, <EFBFBD>Video Probe and Commit Controls<EFBFBD>).
*
* D1: End of Frame.
* This bit is set if the following payload data marks the end of the current video or still image
* frame (for framebased formats), or to indicate the end of a codec-specific segment
* (for stream-based formats). This behavior is optional for all payload formats.
* For stream-based formats, support for this bit must be indicated via the bmFramingInfofield
* of the Video Probe and CommitControls (see section 4.3.1.1, Video Probe and Commit Controls).
* of the Video Probe and CommitControls (see section 4.3.1.1, <EFBFBD>Video Probe and Commit Controls<EFBFBD>).
*
* D2: Presentation Time.
* This bit is set if the dwPresentationTimefield is being sent as part of the header.

View File

@ -205,7 +205,7 @@ static void _msd_unload(usbh_baseclassdriver_t *drv) {
/*===========================================================================*/
/* USB Bulk Only Transport SCSI Command block wrapper */
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint32_t dCBWSignature;
uint32_t dCBWTag;
uint32_t dCBWDataTransferLength;
@ -219,7 +219,7 @@ typedef PACKED_STRUCT {
#define MSD_CBWFLAGS_H2D 0x00
/* USB Bulk Only Transport SCSI Command status wrapper */
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint32_t dCSWSignature;
uint32_t dCSWTag;
uint32_t dCSWDataResidue;
@ -405,7 +405,7 @@ static msd_bot_result_t _msd_bot_transaction(msd_transaction_t *tran, USBHMassSt
/* Request sense */
#define SCSI_CMD_REQUEST_SENSE 0x03
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t byte[18];
} scsi_sense_response_t;
@ -439,7 +439,7 @@ typedef PACKED_STRUCT {
/* Inquiry */
#define SCSI_CMD_INQUIRY 0x12
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t peripheral;
uint8_t removable;
uint8_t version;
@ -455,14 +455,14 @@ typedef PACKED_STRUCT {
/* Read Capacity 10 */
#define SCSI_CMD_READ_CAPACITY_10 0x25
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint32_t last_block_addr;
uint32_t block_size;
} scsi_readcapacity10_response_t;
/* Start/Stop Unit */
#define SCSI_CMD_START_STOP_UNIT 0x1B
typedef PACKED_STRUCT {
typedef __PACKED_STRUCT {
uint8_t op_code;
uint8_t lun_immed;
uint8_t res1;