Various cosmetic changes.
This commit is contained in:
parent
ead2c26be8
commit
46d435fc65
|
@ -143,13 +143,13 @@
|
|||
/* These string IDs only exist if a user-defined string is provided */
|
||||
|
||||
#ifdef CONFIG_CDCACM_NOTIFSTR
|
||||
# define CDCACM_NOTIFSTRID (CDCACM_LASTBASESTRID+1)
|
||||
# define CDCACM_NOTIFSTRID (CDCACM_LASTBASESTRID + 1)
|
||||
#else
|
||||
# define CDCACM_NOTIFSTRID CDCACM_LASTBASESTRID
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CDCACM_DATAIFSTR
|
||||
# define CDCACM_DATAIFSTRID (CDCACM_NOTIFSTRID+1)
|
||||
# define CDCACM_DATAIFSTRID (CDCACM_NOTIFSTRID + 1)
|
||||
#else
|
||||
# define CDCACM_DATAIFSTRID CDCACM_NOTIFSTRID
|
||||
#endif
|
||||
|
|
|
@ -292,7 +292,7 @@
|
|||
# undef CONFIG_USBMSC_STRBASE
|
||||
# define CONFIG_USBMSC_STRBASE (0)
|
||||
#else
|
||||
# define USBMSC_INTERFACESTRID (CONFIG_USBMSC_STRBASE+1)
|
||||
# define USBMSC_INTERFACESTRID (CONFIG_USBMSC_STRBASE + 1)
|
||||
#endif
|
||||
|
||||
#define USBMSC_LASTSTRID USBMSC_INTERFACESTRID
|
||||
|
@ -300,7 +300,7 @@
|
|||
|
||||
/* Configuration Descriptor */
|
||||
|
||||
#define USBMSC_INTERFACEID (CONFIG_USBMSC_IFNOBASE+0)
|
||||
#define USBMSC_INTERFACEID (CONFIG_USBMSC_IFNOBASE + 0)
|
||||
#define USBMSC_ALTINTERFACEID (0)
|
||||
|
||||
#define USBMSC_CONFIGIDNONE (0) /* Config ID means to return to address mode */
|
||||
|
|
|
@ -81,11 +81,11 @@
|
|||
*
|
||||
* IOCTL commands for TSC driver A would then be defined in a TSC A header file like:
|
||||
*
|
||||
* TSCIOC_A_CMD1 _TSIOC(TSC_A_FIRST+0)
|
||||
* TSCIOC_A_CMD2 _TSIOC(TSC_A_FIRST+1)
|
||||
* TSCIOC_A_CMD3 _TSIOC(TSC_A_FIRST+2)
|
||||
* TSCIOC_A_CMD1 _TSIOC(TSC_A_FIRST + 0)
|
||||
* TSCIOC_A_CMD2 _TSIOC(TSC_A_FIRST + 1)
|
||||
* TSCIOC_A_CMD3 _TSIOC(TSC_A_FIRST + 2)
|
||||
* ...
|
||||
* TSCIOC_A_CMD42 _TSIOC(TSC_A_FIRST+41)
|
||||
* TSCIOC_A_CMD42 _TSIOC(TSC_A_FIRST + 41)
|
||||
*
|
||||
* The next reservation would look like:
|
||||
*
|
||||
|
@ -143,7 +143,9 @@ struct touch_sample_s
|
|||
int npoints; /* The number of touch points in point[] */
|
||||
struct touch_point_s point[1]; /* Actual dimension is npoints */
|
||||
};
|
||||
#define SIZEOF_TOUCH_SAMPLE_S(n) (sizeof(struct touch_sample_s) + ((n)-1)*sizeof(struct touch_point_s))
|
||||
|
||||
#define SIZEOF_TOUCH_SAMPLE_S(n) \
|
||||
(sizeof(struct touch_sample_s) + ((n) - 1) * sizeof(struct touch_point_s))
|
||||
|
||||
/************************************************************************************
|
||||
* Public Function Prototypes
|
||||
|
|
|
@ -617,6 +617,7 @@ struct cdc_hdr_funcdesc_s
|
|||
uint8_t cdc[2]; /* bcdCDC, USB Class Definitions for Communication Devices Specification
|
||||
* release number in binary-coded decimal. */
|
||||
};
|
||||
|
||||
#define SIZEOF_HDR_FUNCDESC 5
|
||||
|
||||
/* Table 27: Call Management Functional Descriptor */
|
||||
|
@ -631,6 +632,7 @@ struct cdc_callmgmt_funcdesc_s
|
|||
* optionally used for call management
|
||||
*/
|
||||
};
|
||||
|
||||
#define SIZEOF_CALLMGMT_FUNCDESC 5
|
||||
|
||||
/* Table 28: Abstract Control Management Functional Descriptor */
|
||||
|
@ -642,6 +644,7 @@ struct cdc_acm_funcdesc_s
|
|||
uint8_t subtype; /* bDescriptorSubType, CDC_DSUBTYPE_ACM as defined in Table 25 */
|
||||
uint8_t caps; /* bmCapabilities: Bit encoded */
|
||||
};
|
||||
|
||||
#define SIZEOF_ACM_FUNCDESC 4
|
||||
|
||||
/* Table 29: Direct Line Management Functional Descriptor */
|
||||
|
@ -653,6 +656,7 @@ struct cdc_dlc_funcdesc_s
|
|||
uint8_t subtype; /* bDescriptorSubType, CDC_DSUBTYPE_DLC as defined in Table 25 */
|
||||
uint8_t caps; /* bmCapabilities: Bit encoded */
|
||||
};
|
||||
|
||||
#define SIZEOF_DLC_FUNCDESC 4
|
||||
|
||||
/* Table 30: Telephone Ringer Functional Descriptor */
|
||||
|
@ -667,6 +671,7 @@ struct cdc_tcmr_funcdesc_s
|
|||
*/
|
||||
uint8_t npats; /* bNumRingerPatterns: Number of ringer patterns supported. */
|
||||
};
|
||||
|
||||
#define SIZEOF_TCMR_FUNCDESC 5
|
||||
|
||||
/* Table 31: Telephone Operational Modes Functional Descriptor */
|
||||
|
@ -678,6 +683,7 @@ struct cdc_tcmops_funcdesc_s
|
|||
uint8_t subtype; /* bDescriptorSubType, CDC_DSUBTYPE_TCMOPS as defined in Table 25 */
|
||||
uint8_t caps; /* bmCapabilities: Bit encoded */
|
||||
};
|
||||
|
||||
#define SIZEOF_TCMOPS_FUNCDESC 4
|
||||
|
||||
/* Table 32: Telephone Call State Reporting Capabilities Descriptor */
|
||||
|
@ -689,6 +695,7 @@ struct cdc_tcmc_funcdesc_s
|
|||
uint8_t subtype; /* bDescriptorSubType, CDC_DSUBTYPE_TCMCALL as defined in Table 25 */
|
||||
uint8_t caps; /* bmCapabilities: Bit encoded */
|
||||
};
|
||||
|
||||
#define SIZEOF_TCMC_FUNCDESC 4
|
||||
|
||||
/* Table 33: Union Interface Functional Descriptor */
|
||||
|
@ -706,7 +713,8 @@ struct cdc_union_funcdesc_s
|
|||
* interface in the union
|
||||
*/
|
||||
};
|
||||
#define SIZEOF_UNION_FUNCDESC(n) ((n)+4)
|
||||
|
||||
#define SIZEOF_UNION_FUNCDESC(n) ((n) + 4)
|
||||
|
||||
/* Table 34: Country Selection Functional Descriptor */
|
||||
|
||||
|
@ -722,7 +730,8 @@ struct cdc_country_funcdesc_s
|
|||
* release date as specified in offset 3 for Nth country supported
|
||||
*/
|
||||
};
|
||||
#define SIZEOF_COUNTRY_FUNCDESC(n) (sizeof(uint16_t)*(n) + 4)
|
||||
|
||||
#define SIZEOF_COUNTRY_FUNCDESC(n) (sizeof(uint16_t) * (n) + 4)
|
||||
|
||||
/* Table 35: USB Terminal Functional Descriptor */
|
||||
|
||||
|
@ -741,7 +750,8 @@ struct cdc_usbterm_funcdesc_s
|
|||
uint8_t options; /* bmOptions, bit-encoded options */
|
||||
uint8_t child[1]; /* Nth ID of lower Terminal or Unit to which this Terminal is connected. */
|
||||
};
|
||||
#define SIZEOF_USBTERM_FUNCDESC(n) ((n)+7)
|
||||
|
||||
#define SIZEOF_USBTERM_FUNCDESC(n) ((n) + 7)
|
||||
|
||||
/* Table 36: Network Channel Terminal Functional Descriptor */
|
||||
|
||||
|
@ -757,6 +767,7 @@ struct cdc_netchan_funcdesc_s
|
|||
uint8_t index; /* bChannelIndex, The channel index of the associated network channel */
|
||||
uint8_t phyif; /* bPhysicalInterface, Type of physical interface */
|
||||
};
|
||||
|
||||
#define SIZEOF_NETCHAN_FUNCDESC 7
|
||||
|
||||
/* Table 37: Protocol Unit Functional Descriptor */
|
||||
|
@ -770,7 +781,8 @@ struct cdc_protounit_funcdesc_s
|
|||
uint8_t proto; /* bProtocol, Protocol code as defined in Table 19 */
|
||||
uint8_t child[1]; /* Nth ID of lower Terminal or Unit to which this Terminal is connected */
|
||||
};
|
||||
#define SIZEOF_PROTOUNIT_FUNCDESC(n) ((n)+5)
|
||||
|
||||
#define SIZEOF_PROTOUNIT_FUNCDESC(n) ((n) + 5)
|
||||
|
||||
/* Table 38: Extension Unit Functional Descriptor */
|
||||
|
||||
|
@ -784,7 +796,8 @@ struct cdc_extunit_funcdesc_s
|
|||
uint8_t name; /* iName, Index of string descriptor, describing the name of the Extension Unit */
|
||||
uint8_t child[1]; /* Nth ID of lower Terminal or Unit to which this Terminal is connected */
|
||||
};
|
||||
#define SIZEOF_EXTUNIT_FUNCDESC(n) ((n)+6)
|
||||
|
||||
#define SIZEOF_EXTUNIT_FUNCDESC(n) ((n) + 6)
|
||||
|
||||
/* Table 39: Multi-Channel Management Functional Descriptor */
|
||||
|
||||
|
@ -795,6 +808,7 @@ struct cdc_mcm_funcdesc_s
|
|||
uint8_t subtype; /* bDescriptorSubType, CDC_DSUBTYPE_MCM as defined in Table 25 */
|
||||
uint8_t caps; /* bmCapabilities: Bit encoded */
|
||||
};
|
||||
|
||||
#define SIZEOF_MCM_FUNCDESC 4
|
||||
|
||||
/* Table 40: CAPI Control Management Functional Descriptor */
|
||||
|
@ -806,6 +820,7 @@ struct cdc_capi_funcdesc_s
|
|||
uint8_t subtype; /* bDescriptorSubType, CDC_DSUBTYPE_CAPI as defined in Table 25 */
|
||||
uint8_t caps; /* bmCapabilities: Bit encoded */
|
||||
};
|
||||
|
||||
#define SIZEOF_CAPI_FUNCDESC 4
|
||||
|
||||
/* Table 41: Ethernet Networking Functional Descriptor */
|
||||
|
@ -829,6 +844,7 @@ struct cdc_ecm_funcdesc_s
|
|||
* available for causing wake-up of the host.
|
||||
*/
|
||||
};
|
||||
|
||||
#define SIZEOF_ECM_FUNCDESC 13
|
||||
|
||||
/* Table 43: ATM Networking Functional Descriptor */
|
||||
|
@ -853,6 +869,7 @@ struct cdc_atm_funcdesc_s
|
|||
* capable of supporting
|
||||
*/
|
||||
};
|
||||
|
||||
#define SIZEOF_ATM_FUNCDESC 12
|
||||
|
||||
/* Descriptor Data Structures ***************************************************************/
|
||||
|
@ -865,6 +882,7 @@ struct cdc_linecoding_s
|
|||
uint8_t parity; /* bParityType, 0=None, 1=Odd, 2=Even, 3=Mark, 4=Space */
|
||||
uint8_t nbits; /* bDataBits, Data bits (5,6,7,8, or 16) */
|
||||
};
|
||||
|
||||
#define SIZEOF_CDC_LINECODING 7
|
||||
|
||||
/* Table 55: Line Status Information Structure */
|
||||
|
@ -892,6 +910,7 @@ struct cdc_notification_s
|
|||
uint8_t len[2]; /* wLength - length of variable data */
|
||||
uint8_t data[1]; /* Variable length data begins here */
|
||||
};
|
||||
|
||||
#define SIZEOF_NOTIFICATION_S(n) (sizeof(struct cdc_notification_s) + (n) - 1)
|
||||
|
||||
/* Table 60: Unit Parameter Structure */
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
#define OHCI_MAX_RHPORT 15 /* Maximum number of OHCI root hub ports */
|
||||
|
||||
#define OHCI_RHPORTST_OFFSET(n) (0x0054+(((n)-1) << 2))
|
||||
#define OHCI_RHPORTST_OFFSET(n) (0x0054 + (((n) - 1) << 2))
|
||||
#define OHCI_RHPORTST1_OFFSET 0x0054 /* HcRhPort1Status: Root hub port status 1 */
|
||||
#define OHCI_RHPORTST2_OFFSET 0x0058 /* HcRhPort2Status: Root hub port status 2 */
|
||||
#define OHCI_RHPORTST3_OFFSET 0x005c /* HcRhPort3Status: Root hub port status 3 */
|
||||
|
@ -352,7 +352,7 @@
|
|||
|
||||
#define HCCA_INTTBL_OFFSET (0x00)
|
||||
#define HCCA_INTTBL_WSIZE (32)
|
||||
#define HCCA_INTTBL_BSIZE (HCCA_INTTBL_WSIZE*4)
|
||||
#define HCCA_INTTBL_BSIZE (HCCA_INTTBL_WSIZE * 4)
|
||||
|
||||
/* HccaFrameNumber: Current frame number */
|
||||
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
|
||||
/* Mass storage requests */
|
||||
|
||||
#define USBMSC_TYPE_SETUPIN (USB_DIR_IN|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE)
|
||||
#define USBMSC_TYPE_SETUPOUT (USB_DIR_OUT|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE)
|
||||
#define USBMSC_TYPE_SETUPIN (USB_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE)
|
||||
#define USBMSC_TYPE_SETUPOUT (USB_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE)
|
||||
|
||||
#define USBMSC_REQ_MSRESET (0xff) /* Reset mass storage device and interface */
|
||||
#define USBMSC_REQ_GETMAXLUN (0xfe) /* Return number LUNs supported */
|
||||
|
|
|
@ -79,9 +79,10 @@
|
|||
#define MSBYTE(u16) ((u16) >> 8) /* Get MS byte from uint16_t */
|
||||
#define LSBYTE(u16) ((u16) & 0xff) /* Get LS byte from uint16_t */
|
||||
|
||||
#define GETUINT16(p) (((uint16_t)p[1]<<8)|(uint16_t)p[0])
|
||||
#define GETUINT32(p) (((uint32_t)p[3]<<24)|((uint32_t)p[2]<<16)|\
|
||||
((uint32_t)p[1]<<8)|(uint32_t)p[0])
|
||||
#define GETUINT16(p) (((uint16_t)p[1] << 8) | (uint16_t)p[0])
|
||||
#define GETUINT32(p) (((uint32_t)p[3] << 24) | \
|
||||
((uint32_t)p[2] << 16) | \
|
||||
((uint32_t)p[1] << 8) | (uint32_t)p[0])
|
||||
|
||||
/* USB directions (in endpoint addresses) */
|
||||
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
|
||||
/* Event encoding/decoding macros *******************************************/
|
||||
|
||||
#define TRACE_EVENT(id,data) ((uint16_t)(id)|(data))
|
||||
#define TRACE_ID(event) ((event)&0xff00)
|
||||
#define TRACE_DATA(event) ((event)&0x00ff)
|
||||
#define TRACE_EVENT(id,data) ((uint16_t)(id) | (data))
|
||||
#define TRACE_ID(event) ((event) & 0xff00)
|
||||
#define TRACE_DATA(event) ((event) & 0x00ff)
|
||||
|
||||
/* Events ******************************************************************/
|
||||
|
||||
|
|
|
@ -55,10 +55,11 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#define USBHOST_DEVADDR_HASHSIZE 8
|
||||
#define USBHOST_DEVADDR_HASHMASK (USBHOST_DEVADDR_HASHSIZE-1)
|
||||
#define USBHOST_DEVADDR_HASHMASK (USBHOST_DEVADDR_HASHSIZE - 1)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
|
|
|
@ -64,17 +64,19 @@
|
|||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
FAR char *inet_ntoa(struct in_addr in)
|
||||
{
|
||||
static char buffer[INET_ADDRSTRLEN+2];
|
||||
static char buffer[INET_ADDRSTRLEN + 2];
|
||||
FAR unsigned char *ptr = (FAR unsigned char *)&in.s_addr;
|
||||
sprintf(buffer, "%u.%u.%u.%u", ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
snprintf(buffer, INET_ADDRSTRLEN + 2, "%u.%u.%u.%u",
|
||||
ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
return buffer;
|
||||
}
|
||||
#else
|
||||
FAR char *_inet_ntoa(in_addr_t in)
|
||||
{
|
||||
static char buffer[INET_ADDRSTRLEN+2];
|
||||
static char buffer[INET_ADDRSTRLEN + 2];
|
||||
FAR unsigned char *ptr = (FAR unsigned char *)∈
|
||||
sprintf(buffer, "%u.%u.%u.%u", ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
snprintf(buffer, INET_ADDRSTRLEN + 2, "%u.%u.%u.%u",
|
||||
ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -108,7 +108,8 @@ static int inet_ipv4_ntop(FAR const void *src, FAR char *dest, socklen_t size)
|
|||
}
|
||||
|
||||
ptr = (FAR uint8_t *)src;
|
||||
sprintf(dest, "%u.%u.%u.%u", ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
snprintf(dest, INET_ADDRSTRLEN, "%u.%u.%u.%u",
|
||||
ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -80,8 +80,8 @@
|
|||
|
||||
enum mqalloc_e
|
||||
{
|
||||
MQ_ALLOC_FIXED = 0, /* pre-allocated; never freed */
|
||||
MQ_ALLOC_DYN, /* dynamically allocated; free when unused */
|
||||
MQ_ALLOC_FIXED = 0, /* Pre-allocated; never freed */
|
||||
MQ_ALLOC_DYN, /* Dynamically allocated; free when unused */
|
||||
MQ_ALLOC_IRQ /* Preallocated, reserved for interrupt handling */
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue