#include"lpc21xx.h"
#include"stdio.h"
#define CON 0x000000ff
unsigned int temp=0x00;
const unsigned int disp[16]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};
void __irq eint0(void) {
temp++;
if(temp==16)temp=0;
while(EXTINT&(1<<0))
EXTINT=1<<0;
IO0CLR=CON;
IO0SET=disp[temp];
VICVectAddr=0; }
void __irq eint1(void){
temp--;
if(temp==225)temp=15;
while(EXTINT&(1<<1))EXTINT=1<<1;
IO0CLR=CON;
IO0SET=disp[temp];
VICVectAddr=0; }
void __irq eint2(void){
temp=0;
while(EXTINT&(1<<2))EXTINT=1<<2;
IO0CLR=CON;
IO0SET=disp[temp];
VICVectAddr=0;}
int main(){
PINSEL0=0XA0000000;
PINSEL1=0X00000001;
IO0DIR=CON;
IO0SET=disp[temp];
VICIntSelect=0;
VICIntEnable=0x0001c000;
VICVectCntl0=0x0000002e;
VICVectCntl1=0x0000002f;
VICVectCntl2=0x00000030;
VICVectAddr0=(int)eint0;
VICVectAddr1=(int)eint1;
VICVectAddr2=(int)eint2;
EXTINT=0X07;
while(1);
}
|