www.久久久久|狼友网站av天堂|精品国产无码a片|一级av色欲av|91在线播放视频|亚洲无码主播在线|国产精品草久在线|明星AV网站在线|污污内射久久一区|婷婷综合视频网站

當(dāng)前位置:首頁 > 單片機(jī) > 單片機(jī)
[導(dǎo)讀] /******************************************************************** ** File : DExternInterrupt.c | Interrupt | ** Version : 1.0 ** Descript

 

/******************************************************************
**
** File : DExternInterrupt.c | Interrupt |
** Version : 1.0
** Description: Extern Interrupt
** Author : LightWu
** Date : 2013-4-16
**
*******************************************************************/


#include "MSP430X24X.h"


void main(void)
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD; //關(guān)狗

P4DIR = BIT0|BIT1|BIT2|BIT3; //設(shè)置為輸出
P4SEL = 0;

P1IE |= 0x08; // P1.3 interrupt enabled
P1IES |= 0x08; // P1.3 Hi/lo edge
P1IFG &= ~0x08; // P1.3 IFG cleared


__bis_SR_register(LPM4_bits + GIE); // Enter LPM4 w/interrupt

while(1)
{


}

}


// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
P4OUT ^= 0x0F; //電平翻轉(zhuǎn)

P1IFG &= ~0x08; // P1.3 IFG cleared,注意清標(biāo)志位,否則會(huì)一直進(jìn)入中斷
}

 

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除。
關(guān)閉
關(guān)閉