diff options
Diffstat (limited to 'LUFA/Common')
| -rw-r--r-- | LUFA/Common/ArchitectureSpecific.h | 20 | ||||
| -rw-r--r-- | LUFA/Common/Attributes.h | 2 | ||||
| -rw-r--r-- | LUFA/Common/BoardTypes.h | 3 | ||||
| -rw-r--r-- | LUFA/Common/Common.h | 3 |
4 files changed, 25 insertions, 3 deletions
diff --git a/LUFA/Common/ArchitectureSpecific.h b/LUFA/Common/ArchitectureSpecific.h index f7dca663..9b719a22 100644 --- a/LUFA/Common/ArchitectureSpecific.h +++ b/LUFA/Common/ArchitectureSpecific.h @@ -65,6 +65,24 @@ /* Macros: */ #if (ARCH == ARCH_AVR8) || (ARCH == ARCH_XMEGA) || defined(__DOXYGEN__) #if (ARCH == ARCH_AVR8) || defined(__DOXYGEN__) + /** Re-enables the AVR's JTAG bus in software, until a system reset. This will re-enable JTAG debugging + * interface after is has been disabled in software via \ref JTAG_DISABLE(). + * + * \note This macro is not available for all architectures. + */ + #define JTAG_ENABLE() MACROS{ \ + __asm__ __volatile__ ( \ + "in __tmp_reg__,__SREG__" "\n\t" \ + "cli" "\n\t" \ + "out %1, %0" "\n\t" \ + "out __SREG__, __tmp_reg__" "\n\t" \ + "out %1, %0" "\n\t" \ + : \ + : "r" (MCUCR & ~(1 << JTD)), \ + "M" (_SFR_IO_ADDR(MCUCR)) \ + : "r0"); \ + }MACROE + /** Disables the AVR's JTAG bus in software, until a system reset. This will override the current JTAG * status as set by the JTAGEN fuse, disabling JTAG debugging and reverting the JTAG pins back to GPIO * mode. @@ -79,7 +97,7 @@ "out __SREG__, __tmp_reg__" "\n\t" \ "out %1, %0" "\n\t" \ : \ - : "r" (1 << JTD), \ + : "r" (MCUCR | (1 << JTD)), \ "M" (_SFR_IO_ADDR(MCUCR)) \ : "r0"); \ }MACROE diff --git a/LUFA/Common/Attributes.h b/LUFA/Common/Attributes.h index f4040b23..b058eed8 100644 --- a/LUFA/Common/Attributes.h +++ b/LUFA/Common/Attributes.h @@ -116,7 +116,7 @@ /** Forces the compiler to not automatically zero the given global variable on startup, so that the * current RAM contents is retained. Under most conditions this value will be random due to the - * behaviour of volatile memory once power is removed, but may be used in some specific circumstances, + * behavior of volatile memory once power is removed, but may be used in some specific circumstances, * like the passing of values back after a system watchdog reset. */ #define ATTR_NO_INIT __attribute__ ((section (".noinit"))) diff --git a/LUFA/Common/BoardTypes.h b/LUFA/Common/BoardTypes.h index 0a40b191..59e9bb74 100644 --- a/LUFA/Common/BoardTypes.h +++ b/LUFA/Common/BoardTypes.h @@ -212,6 +212,9 @@ /** Selects the Olimex AVR-USB-T32U4 specific board drivers, including the Button and LED drivers. */ #define BOARD_OLIMEXT32U4 49 + + /** Selects the Olimex AVR-ISP-MK2 specific board drivers, including the Button and LED drivers. */ + #define BOARD_OLIMEXISPMK2 50 #if !defined(__DOXYGEN__) diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index 54d73868..d2d657a3 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -109,9 +109,10 @@ #include "Endianness.h" #elif (ARCH == ARCH_UC3) #include <avr32/io.h> + #include <math.h> // === TODO: Find abstracted way to handle these === - #define PROGMEM const + #define PROGMEM #define pgm_read_byte(x) *x #define memcmp_P(...) memcmp(__VA_ARGS__) #define memcpy_P(...) memcpy(__VA_ARGS__) |
