Subversion Repositories HomeAutomation

Rev

Rev 215 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /* vim: set sw=8 ts=8 si et: */
  2. /*********************************************
  3. * Author: Guido Socher
  4. * Copyright: GPL V2
  5. **********************************************/
  6.  
  7. #include <avr/interrupt.h>
  8. #include <avr/pgmspace.h>
  9. #include <avr/io.h>
  10. #include "avr_compat.h"
  11.  
  12. #ifndef ALIBC_OLD
  13. #include <util/delay.h>
  14. #else
  15. #include <avr/delay.h>
  16. #endif
  17.  
  18. void delay_ms(unsigned int ms)
  19. /* delay for a minimum of <ms> */
  20. {
  21.         // we use a calibrated macro. This is more
  22.         // accurate and not so much compiler dependent
  23.         // as self made code.
  24.         while(ms){
  25.                 _delay_ms(0.96);
  26.                 ms--;
  27.         }
  28. }
  29.  
  30.  
  31.