使用CY7C63813的INT0做外部中断输入,配置为:
Input_CMOS ;Open Drain,Pullup;FallingEdge
程序为
#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#pragma interrupt_handler KeyISR //定义中断服务函数button_svr()
void Delay_MS(void);
BYTE LedFlag = 0 ;
void main(void)
{
// Insert your main routine code here.
M8C_EnableGInt ; // Uncomment this line to enable Global Interrupts
M8C_EnableIntMask(INT_MSK0,INT_MSK0_GPIO_PORT0);
while(1)
{
}
}
void KeyISR(void) //中断服务程序
{
LedFlag = ~LedFlag ;
if(LedFlag)
P0DATA = 0x7f ;
else
P0DATA = 0xff ;
}
但是并不能进入中断,求大虾帮忙解决,不胜感激 |