/* * "Hello World" example. * * This example prints ' Hello from Nios II ' to the STDOUT stream. It runs on * The Nios II ' standard ', ' full_featured ', ' fast ', and ' low_cost ' example * Designs. It runs with or without the microc/os-ii RTOS and requires a STDOUT * Device in your system ' s hardware. * The memory footprint of this hosted application are ~69 Kbytes by default * Using the standard reference design. * * For a reduced footprint version of the This template, and the explanation of how * To reduce the memory footprint-a given application, see the * "Small_hello_world" template. * */ #include "system.h" #include "Altera_avalon_pio_regs.h" #include <stdio.h> #include <unistd.h> int Main () { int I ; printf ("Hello from Nios ii!\n"); while (1) { For ( I=0;I<4;I++) { IOWR _altera_avalon_pio_data ( led_pio_base , 1 << i ); Usleep (1000000); //each one 0.5s delay } } return0; } |