aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Common
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-04-25 07:28:36 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-04-25 07:28:36 +0000
commitf670bdeff83ee519b67c661cbe794d787c2a5403 (patch)
treeb92a94dc8195e498981bc33a704b5be381ba40d7 /LUFA/Common
parent7b0cebc1d7c3fe55fa10acb66de60e52c2478195 (diff)
downloadlufa-f670bdeff83ee519b67c661cbe794d787c2a5403.tar.gz
lufa-f670bdeff83ee519b67c661cbe794d787c2a5403.tar.bz2
lufa-f670bdeff83ee519b67c661cbe794d787c2a5403.zip
Add __VA_ARGS__ support to the LUFA supplied ISR macro. Add proper result typecasting to the SWAPENDIAN_* macros.
Switch to using -1 on the UC3 target to obtain a register mask with all bits set (for clearing interrupts and status flags). Fix incorrect USB controller mode on the UC3 when a fixed mode is specified as a compile time option due to AVR32_USBB.USBCON.uide being set by default. Make USB_Descriptor_String_t use a uint16_t for Unicode strings on all targets except the AVR8 (retained for backwards compatibility).
Diffstat (limited to 'LUFA/Common')
-rw-r--r--LUFA/Common/Common.h2
-rw-r--r--LUFA/Common/Endianness.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h
index e349063da..1fc47e0eb 100644
--- a/LUFA/Common/Common.h
+++ b/LUFA/Common/Common.h
@@ -257,7 +257,7 @@
*
* \param Name Unique name of the interrupt service routine.
*/
- #define ISR(Name, ...) void Name (void) __attribute__((__interrupt__)); void Name (void)
+ #define ISR(Name, ...) void Name (void) __attribute__((__interrupt__)) __VA_ARGS__; void Name (void)
#endif
/* Inline Functions: */
diff --git a/LUFA/Common/Endianness.h b/LUFA/Common/Endianness.h
index ef8c1a788..115d054f2 100644
--- a/LUFA/Common/Endianness.h
+++ b/LUFA/Common/Endianness.h
@@ -78,7 +78,7 @@
*
* \return Input value with the byte ordering reversed.
*/
- #define SWAPENDIAN_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8))
+ #define SWAPENDIAN_16(x) (uint16_t)((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8))
/** Swaps the byte ordering of a 32-bit value at compile-time. Do not use this macro for swapping byte orderings
* of dynamic values computed at runtime- use \ref SwapEndian_32() instead. The result of this macro can be used
@@ -91,8 +91,8 @@
*
* \return Input value with the byte ordering reversed.
*/
- #define SWAPENDIAN_32(x) ((((x) & 0xFF000000UL) >> 24UL) | (((x) & 0x00FF0000UL) >> 8UL) | \
- (((x) & 0x0000FF00UL) << 8UL) | (((x) & 0x000000FFUL) << 24UL))
+ #define SWAPENDIAN_32(x) (uint32_t)((((x) & 0xFF000000UL) >> 24UL) | (((x) & 0x00FF0000UL) >> 8UL) | \
+ (((x) & 0x0000FF00UL) << 8UL) | (((x) & 0x000000FFUL) << 24UL))
#if defined(ARCH_BIG_ENDIAN) && !defined(le16_to_cpu)
#define le16_to_cpu(x) SwapEndian_16(x)