#include "string.h"
#include "stdio.h"
#include "sys/alt_alarm.h"
#include "system.h"
#include "altera_avalon_pio_regs.h"
#include "alt_types.h"
int main (void) __attribute__ ((weak, alias ("alt_main")));
int alt_main (void)
{
alt_u8 led;
int ch;
led = 0xff;
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, led);
printf("Do all LEDs (D0-D7) function? <y/n>?");
getchar();
ch = getchar();
if (ch == 'y')
{
printf("LEDs are functional.\n");
led = 0x00;
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, led);
usleep(2000000);
return ;
}
else
{
printf("\n**One of the LEDs failed to illuminate!**\n");
usleep(2000000);
return ;
}
}
编译出现如下错误: (另附硬件图片)希望得到指教,不枉我整天游走此论坛!!!
[此贴子已经被作者于2005-11-16 10:23:08编辑过]
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |