我第一次裸奔2440,一个简单的程序。以下是源程序
init.s
AREA |DATA|,CODE,READONLY
ENTRY
ldr r13, = 0x1000
IMPORT LedMain
b LedMain
END
main.c
#define GPFCON (*(volatile unsigned *)0x56000050);
#define GPFDAT (*(volatile unsigned *)0x56000054);
#define GPFUP (*(volatile unsigned *)0x56000058);
void delay(unsigned int x);
int LedMain()
{
unsigned char ledtab[] = {0xdf, 0xbf, 0x7f};
int i;
GPFUP &= 0xffffff1f;
//报错:(serious)c2304e: <command> expected but found '&='
GPFCON &= 0xffff0000;
//报错:(serious)c2304e: <command> expected but found '&='
GPFCON |= 0x5400;
//报错:(serious)c2304e: <command> expected but found '|='
while (1)
{
for (i = 0; i < 3; ++i)
{
GPFDAT = ledtab[i];
delay(10);
}
}
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);
}
}
}
实在搞不清这是为什么,求教啦 |