2
0

max80.c 651 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "common.h"
  2. #include "io.h"
  3. #include "abcio.h"
  4. #include "sys.h"
  5. #include "console.h"
  6. #include "boardinfo_fpga.h"
  7. void __hot main(void)
  8. {
  9. unsigned int max_abc_latency = 0;
  10. unsigned int abc_latency;
  11. init();
  12. while (1) {
  13. wait_for_irq();
  14. if (unlikely(do_write_rtc))
  15. write_rtc();
  16. if (unlikely(do_update_boardinfo))
  17. rom_update_boardinfo();
  18. abcdisk_io_poll();
  19. abc_latency = ABC_LATENCY;
  20. if (abc_latency > max_abc_latency) {
  21. max_abc_latency = abc_latency;
  22. con_printf("\nWorst ABC-bus latency: %u SDRAM cycles%s\n",
  23. abc_latency & 255,
  24. (abc_latency >> 8) ? " UNDERRUN" : "");
  25. }
  26. }
  27. }