Add double banking property to LUFA powered projects in the Projects directory. Add...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Endpoint.h
index 4dfa1ef..5bbbb87 100644 (file)
                                #endif\r
                                \r
                                #if !defined(CONTROL_ONLY_DEVICE)\r
-                                       #define Endpoint_SelectEndpoint(epnum)    MACROS{ UENUM = epnum; }MACROE\r
+                                       #define Endpoint_SelectEndpoint(epnum)    MACROS{ UENUM = (epnum); }MACROE\r
                                #else\r
                                        #define Endpoint_SelectEndpoint(epnum)    (void)epnum\r
                                #endif\r
 \r
-                               #define Endpoint_ResetFIFO(epnum)             MACROS{ UERST = (1 << epnum); UERST = 0; }MACROE\r
+                               #define Endpoint_ResetFIFO(epnum)             MACROS{ UERST = (1 << (epnum)); UERST = 0; }MACROE\r
 \r
                                #define Endpoint_EnableEndpoint()             MACROS{ UECONX |= (1 << EPEN); }MACROE\r
 \r
 \r
                                #define Endpoint_GetEndpointInterrupts()      UEINT\r
 \r
-                               #define Endpoint_HasEndpointInterrupted(n)    ((UEINT & (1 << n)) ? true : false)\r
+                               #define Endpoint_HasEndpointInterrupted(n)    ((UEINT & (1 << (n))) ? true : false)\r
                                \r
                                #define Endpoint_IsINReady()                  ((UEINTX & (1 << TXINI))  ? true : false)\r
                                \r
                                \r
                                #define Endpoint_GetEndpointDirection()       (UECFG0X & ENDPOINT_DIR_IN)\r
                                \r
-                               #define Endpoint_SetEndpointDirection(dir)    MACROS{ UECFG0X = ((UECFG0X & ~ENDPOINT_DIR_IN) | dir); }MACROE\r
+                               #define Endpoint_SetEndpointDirection(dir)    MACROS{ UECFG0X = ((UECFG0X & ~ENDPOINT_DIR_IN) | (dir)); }MACROE\r
                        #endif\r
 \r
                /* Enums: */\r
                        #endif\r
 \r
                        #define Endpoint_ConfigureEndpoint(Number, Type, Direction, Size, Banks)            \\r
-                                                           Endpoint_ConfigureEndpoint_Prv(Number,          \\r
-                                                                     ((Type << EPTYPE0) | Direction),      \\r
-                                                                     ((1 << ALLOC) | Banks |               \\r
+                                                           Endpoint_ConfigureEndpoint_Prv((Number),        \\r
+                                                                     (((Type) << EPTYPE0) | (Direction)),  \\r
+                                                                     ((1 << ALLOC) | (Banks) |             \\r
                                                                        (__builtin_constant_p(Size) ?       \\r
-                                                                        Endpoint_BytesToEPSizeMask(Size) :  \\r
+                                                                        Endpoint_BytesToEPSizeMask(Size) : \\r
                                                                         Endpoint_BytesToEPSizeMaskDynamic(Size))))\r
                                                                                                        \r
                /* Function Prototypes: */\r