|
我用的时候广州友善之臂的开发板,现在再没有操作系统的情况下,就用了友善之臂提供的启动代码,写了一个定时器程序,但是现在就是跑不起来,能不能帮忙看看?
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
#include "2410int.h"
char b_change = 1;
void __irq Timer0Done(void)
{
// set the led
//I_ISPC = BIT_TIMER0;
rSRCPND=0x00000000;
rINTPND=0x00000000;
if(b_change != 0 )
{
rGPBDAT = 0x00;
b_change = 0;
}
else
{
rGPBDAT = 0xffffffff;
b_change = 1;
} //printf("hello");
}
int Main(void)
{
// 采用了2410TEST中的头文件
// used to initional the cpu and test the fun
int m_vb=0;
/*
__asm
{
MRS m_vb,CPSR
AND m_vb,m_vb,0X10
MSR CPSR_c,m_vb
}
*/
rGPBCON = 0x00154000;
rGPBDAT = 0xffffffff;
rINTMOD=0x00000000; //中断设置
rPRIORITY=0x0000007f;
rINTMSK = ~( BIT_ALLMSK | BIT_TIMER0);
pISR_TIMER0 = (int)Timer0Done;
// init the timer4
rTCFG0 = 0x0000000f;
rTCFG1 = 0x00000004;
rTCNTB0 = 0xffff;
rSRCPND=0x00000000;
rINTPND=0x00000000;
rTCON = 0x02;
rTCON = 0x01;
while(1)
{
};
rINTMSK = BIT_ALLMSK;
}
|
|