aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/LowLevel/Endpoint.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-06 14:32:01 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-06 14:32:01 +0000
commitf29fc1abc40dd862689ca8765e244c1212742744 (patch)
treec415237396cc2bfdb7d63401ae5a3c6fb2ea2a0d /LUFA/Drivers/USB/LowLevel/Endpoint.h
parentf7ab433c67b86723385ec05ee9c7b96dd18e6dde (diff)
downloadlufa-f29fc1abc40dd862689ca8765e244c1212742744.tar.gz
lufa-f29fc1abc40dd862689ca8765e244c1212742744.tar.bz2
lufa-f29fc1abc40dd862689ca8765e244c1212742744.zip
Add double banking property to LUFA powered projects in the Projects directory. Add guards to macro parameters to ensure that formulas passed as parameters don't mess up the internal macro structure.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel/Endpoint.h')
-rw-r--r--LUFA/Drivers/USB/LowLevel/Endpoint.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h
index 4dfa1ef9b..5bbbb87b5 100644
--- a/LUFA/Drivers/USB/LowLevel/Endpoint.h
+++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h
@@ -351,12 +351,12 @@
#endif
#if !defined(CONTROL_ONLY_DEVICE)
- #define Endpoint_SelectEndpoint(epnum) MACROS{ UENUM = epnum; }MACROE
+ #define Endpoint_SelectEndpoint(epnum) MACROS{ UENUM = (epnum); }MACROE
#else
#define Endpoint_SelectEndpoint(epnum) (void)epnum
#endif
- #define Endpoint_ResetFIFO(epnum) MACROS{ UERST = (1 << epnum); UERST = 0; }MACROE
+ #define Endpoint_ResetFIFO(epnum) MACROS{ UERST = (1 << (epnum)); UERST = 0; }MACROE
#define Endpoint_EnableEndpoint() MACROS{ UECONX |= (1 << EPEN); }MACROE
@@ -372,7 +372,7 @@
#define Endpoint_GetEndpointInterrupts() UEINT
- #define Endpoint_HasEndpointInterrupted(n) ((UEINT & (1 << n)) ? true : false)
+ #define Endpoint_HasEndpointInterrupted(n) ((UEINT & (1 << (n))) ? true : false)
#define Endpoint_IsINReady() ((UEINTX & (1 << TXINI)) ? true : false)
@@ -406,7 +406,7 @@
#define Endpoint_GetEndpointDirection() (UECFG0X & ENDPOINT_DIR_IN)
- #define Endpoint_SetEndpointDirection(dir) MACROS{ UECFG0X = ((UECFG0X & ~ENDPOINT_DIR_IN) | dir); }MACROE
+ #define Endpoint_SetEndpointDirection(dir) MACROS{ UECFG0X = ((UECFG0X & ~ENDPOINT_DIR_IN) | (dir)); }MACROE
#endif
/* Enums: */
@@ -1179,11 +1179,11 @@
#endif
#define Endpoint_ConfigureEndpoint(Number, Type, Direction, Size, Banks) \
- Endpoint_ConfigureEndpoint_Prv(Number, \
- ((Type << EPTYPE0) | Direction), \
- ((1 << ALLOC) | Banks | \
+ Endpoint_ConfigureEndpoint_Prv((Number), \
+ (((Type) << EPTYPE0) | (Direction)), \
+ ((1 << ALLOC) | (Banks) | \
(__builtin_constant_p(Size) ? \
- Endpoint_BytesToEPSizeMask(Size) : \
+ Endpoint_BytesToEPSizeMask(Size) : \
Endpoint_BytesToEPSizeMaskDynamic(Size))))
/* Function Prototypes: */