Disable JTAG in WinAVR
作者:lysoft 日期:2008-05-20
Disable JTAG in WinAVR
do it very simple:
#define JTAG_Set(x) \
{ \
__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" \
: /* no outputs */ \
: "r" ((uint8_t)(x ? (1< "M" (_SFR_IO_ADDR(MCUCSR)) \
: "r0"); \
}
use it just like this:
JTAG_Set(1); // disable JTAG port
do it very simple:
#define JTAG_Set(x) \
{ \
__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" \
: /* no outputs */ \
: "r" ((uint8_t)(x ? (1<
: "r0"); \
}
use it just like this:
JTAG_Set(1); // disable JTAG port
评论: 0 | 引用: 0 | 查看次数: 3140
发表评论
上一篇
下一篇

文章来自:
Tags:
相关日志:







