- 积分
- 15
贡献72
飞刀18 FD
注册时间2017-4-10
在线时间2 小时
|
楼主 |
发表于 2017-4-10 17:16:14
|
显示全部楼层
#define rGPPCON (*(volatile unsigned *)(0x7F008160))
#define rGPPDAT (*(volatile unsigned *)(0x7F008164))
#define rGPPPUD (*(volatile unsigned *)(0x7F008168))
void msDelay(int time)
{
volatile unsigned int i,j;
for(i = 0; i < 2000000; i++)
for(j=0; j<time; j++);
}
void GPIO_Init(void)
{
rGPPCON = 0x11111;
rGPPPUD = 0x00;
rGPPDAT = 0X1F;
}
void LedTest(void)
{
volatile unsigned int i;
rGPPDAT = 0x0;
}
void Main(void)
{
GPIO_Init();
while(1)
LedTest();
}
|
|