求帮我看看为什么LED1是灭的,而不是一闪一灭的呢
#include <LPC21xx.H>#define LED1 1<<7
unsigned int j;
void delayms(unsigned int ms)
{
unsigned int i;
while(ms--)
for(i=0;i<125;i++);
}
void __irq
tiMER0_ISR(void)
{
if((IO0PIN&LED1)) IO0SET = LED1;
else IOCLR0 = LED1;
T0IR = 0x01;
VICVectAddr0 = 0;
}
void TIMER0_intrrupt()
{
T0TC = 0;
T0PR = 99;
T0MCR = 0X03;
T0MR0 = 110592;
T0TCR = 0X03;
T0TCR = 0X01;
VICIntEnable = (1<<4);
VICIntSelect = 0x00;
VICVectCntl0 = 0x24;
VICVectAddr0 = (unsigned int)TIMER0_ISR;
}
int main(void)
{
PINSEL0 = 0X00;
IO0DIR = LED1|LED2;
TIMER0_intrrupt();
while(1)
{
}
}
一周热门 更多>