403241c7ef2f001b1545ef0b5631d2e4 859 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * "Hello World" example.
  3. *
  4. * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on
  5. * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example
  6. * designs. It runs with or without the MicroC/OS-II RTOS and requires a STDOUT
  7. * device in your system's hardware.
  8. * The memory footprint of this hosted application is ~69 kbytes by default
  9. * using the standard reference design.
  10. *
  11. * For a reduced footprint version of this template, and an explanation of how
  12. * to reduce the memory footprint for a given application, see the
  13. * "small_hello_world" template.
  14. *
  15. */
  16. #include <stdio.h>
  17. #include "altera_avalon_pio_regs.h"
  18. int main()
  19. {
  20. printf("Hello from Nios II!\n");
  21. int count = 0;
  22. while(true) {
  23. IOWR_ALTERA_AVALON_PIO_DATA(PIO_LED_BASE, count++);
  24. for(int i=0; i<2000000; i++) {
  25. }
  26. }
  27. return 0;
  28. }