More USB macros; fix warnings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2178 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
e89affe3a2
commit
3a89153f23
@ -300,10 +300,10 @@ struct usbser_alloc_s
|
||||
/* Transfer helpers *********************************************************/
|
||||
|
||||
static uint16 usbclass_fillrequest(FAR struct usbser_dev_s *priv,
|
||||
char *reqbuf, uint16 reqlen);
|
||||
ubyte *reqbuf, uint16 reqlen);
|
||||
static int usbclass_sndpacket(FAR struct usbser_dev_s *priv);
|
||||
static inline int usbclass_recvpacket(FAR struct usbser_dev_s *priv,
|
||||
char *reqbuf, uint16 reqlen);
|
||||
ubyte *reqbuf, uint16 reqlen);
|
||||
|
||||
/* Request helpers *********************************************************/
|
||||
|
||||
@ -502,7 +502,7 @@ static const struct usb_qualdesc_s g_qualdesc =
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static uint16 usbclass_fillrequest(FAR struct usbser_dev_s *priv, char *reqbuf, uint16 reqlen)
|
||||
static uint16 usbclass_fillrequest(FAR struct usbser_dev_s *priv, ubyte *reqbuf, uint16 reqlen)
|
||||
{
|
||||
FAR uart_dev_t *serdev = &priv->serdev;
|
||||
FAR struct uart_buffer_s *xmit = &serdev->xmit;
|
||||
@ -646,7 +646,7 @@ static int usbclass_sndpacket(FAR struct usbser_dev_s *priv)
|
||||
************************************************************************************/
|
||||
|
||||
static inline int usbclass_recvpacket(FAR struct usbser_dev_s *priv,
|
||||
char *reqbuf, uint16 reqlen)
|
||||
ubyte *reqbuf, uint16 reqlen)
|
||||
{
|
||||
FAR uart_dev_t *serdev = &priv->serdev;
|
||||
FAR struct uart_buffer_s *recv = &serdev->recv;
|
||||
|
@ -58,12 +58,16 @@
|
||||
|
||||
/* USB directions (in endpoint addresses) */
|
||||
|
||||
#define USB_DIR_MASK (0x80)
|
||||
#define USB_EPNO_MASK (0x7f)
|
||||
#define USB_DIR_OUT (0x00) /* host-to-device */
|
||||
#define USB_DIR_IN (0x80) /* device-to-host */
|
||||
|
||||
#define USB_EPNO(addr) ((addr)&0x7f)
|
||||
#define USB_EPOUT(addr) ((addr)|USB_DIR_OUT)
|
||||
#define USB_EPIN(addr) ((addr)|USB_DIR_IN)
|
||||
#define USB_EPNO(addr) ((addr) & USB_EPNO_MASK)
|
||||
#define USB_EPOUT(addr) ((addr) | USB_DIR_OUT)
|
||||
#define USB_EPIN(addr) ((addr) | USB_DIR_IN)
|
||||
#define USB_ISEPIN(addr) (((addr) & USB_DIR_MASK) == USB_DIR_IN)
|
||||
#define USB_ISEPOUT(addr) (((addr) & USB_DIR_MASK) == USB_DIR_OUT)
|
||||
|
||||
/* Control Setup Packet. Byte 0=Request */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user