- UID
- 1062083
- 性别
- 男
|
本帖最后由 yuchengze 于 2016-12-27 15:02 编辑
nit.s ; 注: IMPORT 之前需要有一个空格,否则编译不能通过 IMPORT Main
AREA |C$$code|,CODE,READONLY
global start
start
bl Main
END
main.c
#include
#define rGPMCON (*(volatile unsigned*)(0x7F008820))
#define rGPMDAT (*(volatile unsigned*)(0x7F008824))
#define rGPMPUD (*(volatile unsigned*)(0x7F008828))
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)
{
rGPMCON =0x11111;
rGPMPUD =0x00;
rGPMDAT =0X1F;
}
void LedTest(void)
{
volatile unsigned int i;
while(1)
{
for(i=0;i<4;i++)
{
rGPMDAT = ~(1<<i); msDelay(10);
}
}
}
void Main(void)
{
GPIO_Init();
LedTest();
}
备注:程序跑通。LED循环点亮
</i);
</time;j++); |
|