diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-06 14:32:01 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-06 14:32:01 +0000 |
commit | f29fc1abc40dd862689ca8765e244c1212742744 (patch) | |
tree | c415237396cc2bfdb7d63401ae5a3c6fb2ea2a0d /LUFA/Drivers/USB/LowLevel/Pipe.h | |
parent | f7ab433c67b86723385ec05ee9c7b96dd18e6dde (diff) | |
download | lufa-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/Pipe.h')
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Pipe.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index 4b7b900e9..6e643778b 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -420,9 +420,9 @@ #define Pipe_GetCurrentPipe() (UPNUM & PIPE_PIPENUM_MASK)
- #define Pipe_SelectPipe(pipenum) MACROS{ UPNUM = pipenum; }MACROE
+ #define Pipe_SelectPipe(pipenum) MACROS{ UPNUM = (pipenum); }MACROE
- #define Pipe_ResetPipe(pipenum) MACROS{ UPRST = (1 << pipenum); UPRST = 0; }MACROE
+ #define Pipe_ResetPipe(pipenum) MACROS{ UPRST = (1 << (pipenum)); UPRST = 0; }MACROE
#define Pipe_EnablePipe() MACROS{ UPCONX |= (1 << PEN); }MACROE
@@ -432,21 +432,21 @@ #define Pipe_GetPipeToken() (UPCFG0X & PIPE_TOKEN_MASK)
- #define Pipe_SetToken(token) MACROS{ UPCFG0X = ((UPCFG0X & ~PIPE_TOKEN_MASK) | token); }MACROE
+ #define Pipe_SetToken(token) MACROS{ UPCFG0X = ((UPCFG0X & ~PIPE_TOKEN_MASK) | (token)); }MACROE
#define Pipe_SetInfiniteINRequests() MACROS{ UPCONX |= (1 << INMODE); }MACROE
- #define Pipe_SetFiniteINRequests(n) MACROS{ UPCONX &= ~(1 << INMODE); UPINRQX = n; }MACROE
+ #define Pipe_SetFiniteINRequests(n) MACROS{ UPCONX &= ~(1 << INMODE); UPINRQX = (n); }MACROE
#define Pipe_IsConfigured() ((UPSTAX & (1 << CFGOK)) ? true : false)
#define Pipe_BoundEndpointNumber() ((UPCFG0X >> PEPNUM0) & PIPE_EPNUM_MASK)
- #define Pipe_SetInterruptPeriod(ms) MACROS{ UPCFG2X = ms; }MACROE
+ #define Pipe_SetInterruptPeriod(ms) MACROS{ UPCFG2X = (ms); }MACROE
#define Pipe_GetPipeInterrupts() UPINT
- #define Pipe_HasPipeInterrupted(n) ((UPINT & (1 << n)) ? true : false)
+ #define Pipe_HasPipeInterrupted(n) ((UPINT & (1 << (n))) ? true : false)
#define Pipe_Unfreeze() MACROS{ UPCONX &= ~(1 << PFREEZE); }MACROE
|