s3c44b0x进不了中断,刚学arm7,遇到问题,谁帮我解决,还有分送上,QQ;370126961,多谢
#include"44b.h"#include"option.h"/*intpIrqStart=0;intpIrqFinish=0;intpIrqHandler=0;*/...
#include"44b.h"
#include"option.h"
/*
int pIrqStart = 0;
int pIrqFinish = 0;
int pIrqHandler = 0;
*/
int tempdat;
void __irq KEY_INT (void);
void PLL_Init() //CPU clock set
{
rPLLCON = (0X48 << 12)|(0X3 << 4)|0X2; //40MHZ
}
void IO_Init()
{
rPCONC = 0X55555555;
rPDATC = 0X4;
rPCONG = 0XFF00;
}
void INT_Init()
{
rEXTINT = 0X0;
//rEXTINTPND = 0X0;
rINTCON = 0X5;
rINTMOD = 0X0;
rINTMSK = ~(BIT_GLOBAL|BIT_EINT4567);
rI_ISPC = 0X3FFF;
}
int Main()
{
IO_Init();
INT_Init();
PLL_Init();
pISR_EINT4567 = (unsigned)KEY_INT;
while(1);
{
tempdat = rINTPND;
}
}
void __irq KEY_INT (void)
{
rPDATC = 0XF;
rI_ISPC |= BIT_EINT4567;
if( (rEXTINTPND & (1<<0) ) != 0)
{
rPDATC = 0X2;
rEXTINTPND |= (1 << 0);
}
if( (rEXTINTPND & (1<<1) ) != 0)
{
rPDATC = 0X4;
rEXTINTPND |= (1 << 1);
}
if( (rEXTINTPND & (1<<2) ) != 0)
{
rPDATC = 0X8;
rEXTINTPND |= (1 << 2);
}
if( (rEXTINTPND & (1<<3) ) != 0)
{
rPDATC = 0X0;
rEXTINTPND |= (1 << 3);
}
} 展开
#include"option.h"
/*
int pIrqStart = 0;
int pIrqFinish = 0;
int pIrqHandler = 0;
*/
int tempdat;
void __irq KEY_INT (void);
void PLL_Init() //CPU clock set
{
rPLLCON = (0X48 << 12)|(0X3 << 4)|0X2; //40MHZ
}
void IO_Init()
{
rPCONC = 0X55555555;
rPDATC = 0X4;
rPCONG = 0XFF00;
}
void INT_Init()
{
rEXTINT = 0X0;
//rEXTINTPND = 0X0;
rINTCON = 0X5;
rINTMOD = 0X0;
rINTMSK = ~(BIT_GLOBAL|BIT_EINT4567);
rI_ISPC = 0X3FFF;
}
int Main()
{
IO_Init();
INT_Init();
PLL_Init();
pISR_EINT4567 = (unsigned)KEY_INT;
while(1);
{
tempdat = rINTPND;
}
}
void __irq KEY_INT (void)
{
rPDATC = 0XF;
rI_ISPC |= BIT_EINT4567;
if( (rEXTINTPND & (1<<0) ) != 0)
{
rPDATC = 0X2;
rEXTINTPND |= (1 << 0);
}
if( (rEXTINTPND & (1<<1) ) != 0)
{
rPDATC = 0X4;
rEXTINTPND |= (1 << 1);
}
if( (rEXTINTPND & (1<<2) ) != 0)
{
rPDATC = 0X8;
rEXTINTPND |= (1 << 2);
}
if( (rEXTINTPND & (1<<3) ) != 0)
{
rPDATC = 0X0;
rEXTINTPND |= (1 << 3);
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询