You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

timer.c 587B

123456789101112131415161718192021222324252627
  1. /* A couple of routines to implement a low-overhead timer for drivers */
  2. /*
  3. * This program is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU General Public License as
  5. * published by the Free Software Foundation; either version 2, or (at
  6. * your option) any later version.
  7. */
  8. #include "timer.h"
  9. /* Machine Independant timer helper functions */
  10. void mdelay(unsigned int msecs)
  11. {
  12. unsigned int i;
  13. for(i = 0; i < msecs; i++) {
  14. udelay(1000);
  15. }
  16. }
  17. void waiton_timer2(unsigned int ticks)
  18. {
  19. load_timer2(ticks);
  20. while(timer2_running()) {
  21. }
  22. }