From 75be6467e05ed59d3b649e6ffd01b81908d9c767 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 11 Oct 2008 19:35:55 +0000 Subject: [PATCH] Added macro for LE 32-bit values git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1030 42af7a65-404d-4744-a932-0658087f49c3 --- include/nuttx/usb.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/nuttx/usb.h b/include/nuttx/usb.h index bd044abc00..4b5835d935 100644 --- a/include/nuttx/usb.h +++ b/include/nuttx/usb.h @@ -53,11 +53,13 @@ #define LSBYTE(u16) ((u16) & 0xff) /* Get LS byte from uint16 */ #define GETUINT16(p) (((uint16)p[1]<<8)|(uint16)p[0]) +#define GETUINT32(p) (((uint32)p[3]<<24)|((uint32)p[2]<<16)|\ + ((uint32)p[1]<<8)|(uint32)p[0]) /* USB directions (in endpoint addresses) */ -#define USB_DIR_OUT (0x00) /* To the device */ -#define USB_DIR_IN (0x80) /* To the host */ +#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)