LED定时中断,程序运行没错,就是结果不对,实在不知程序哪错啦,请高手指点!!!
#include "spce061a.h"
int main()
{
*P_IOA_Dir=0x00ff;
*P_IOA_Attrib=0x00ff;
*P_IOA_Buffer=0x0000;
*P_INT_Ctrl_New=0x0100;
*P_IOB_Dir=0x4000; //B低接按键
*P_IOB_Attrib=0x4000;
*P_IOB_Buffer=0x4008;
*P_TimerA_Ctrl=0x0035; //4096Hz
*P_TimerA_Data=0xf000;
__asm("IRQ ON"); //调用汇编语言
while(1)
*P_Watchdog_Clear=0x0001;
}
void IRQ3(void)__attribute__((ISR)); //声明标准形式
void IRQ3(void)
{
if(*P_INT_Ctrl&0x0100) //b8
{
*P_IOA_Buffer=0x00ff;
*P_INT_Ctrl_New=0x2000;
__asm("FIQ ON"); //调用汇编语言
*P_INT_Clear=0x0100; //清中断
}
else
{
*P_IOA_Buffer=0x0000;
*P_INT_Clear=0x0100;
}
}
void FIQ(void)__attribute__((ISR));
void FIQ(void)
{
*P_INT_Clear=0x2000;
*P_IOA_Buffer^=0x00ff;
}
高手看哪错啦!!谢了啊