|
// 描 述 :跑马灯
#define GPFCON (*(volatile unsigned *)0x56000050)
#define GPFDAT (*(volatile unsigned *)0x56000054)
#define GPFUP (*(volatile unsigned *)0x56000058)
int LedMain()
{
void Delay(unsigned int);
unsigned char ledtab[]={0xf7,0xef,0xdf,0xbf};
int i;
GPFUP&=0XFFFFFF87; //使能上拉F3-6
GPFCON&=0XC03f;
GPFCON|=0X1540; //将F3-6设为输出口
while(1)
{
for(i=0;i <4;i++)
{
GPFDAT=ledtab;
Delay(70);
}
}
return(0);
}
void Delay(unsigned int x )
{
unsigned int i,j,k;
for(i=0;i <=x;i++)
for(j=0;j <=0xff;j++)
for(k=0;k <=0xff;k++);
} |
|