max80.c 557 B

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