diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2012-06-09 13:00:56 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2012-06-09 13:00:56 +0000 |
| commit | ef4c84eafe165753e40cb1080bc8599e20072e1f (patch) | |
| tree | a2d5f03d455543dbf5b383e28a39268e6d2881aa /LUFA/Common/ArchitectureSpecific.h | |
| parent | be85f7dc041eb743fbe285dfe45b2a6696f6d108 (diff) | |
Added new JTAG_ENABLE() macro for the AVR8 architecture. Fixed the JTAG_DISABLE() macro clearing all other bits in MCUSR when called.
Moved the XPLAIN board specific bootloader entry condition code to the Application_Jump_Check() function of the DFU bootloader, added support for the original XPLAIN board to the CDC class bootloader.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@2319 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Common/ArchitectureSpecific.h')
| -rw-r--r-- | LUFA/Common/ArchitectureSpecific.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/LUFA/Common/ArchitectureSpecific.h b/LUFA/Common/ArchitectureSpecific.h index f7dca663..1a05be81 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 disbled 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 |
