c0d6e426f02f001b1545ef0b5631d2e4 902 B

1234567891011121314151617181920212223242526272829303132333435
  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. #include <system.h>
  19. int main()
  20. {
  21. printf("Hello from Nios II!\n");
  22. int count = 0;
  23. while(1) {
  24. printf("%d\n", count);
  25. IOWR_ALTERA_AVALON_PIO_DATA(PIO_LED_BASE, count++);
  26. for(int i=0; i<2000000; i++) {
  27. }
  28. }
  29. return 0;
  30. }