Subversion Repositories HomeAutomation

Rev

Rev 394 | 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. #include <config.h>
  12.  
  13. #ifndef ALIBC_OLD
  14. #include <util/delay.h>
  15. #else
  16. #include <avr/delay.h>
  17. #endif
  18.  
  19. void delay_ms(unsigned int ms)
  20. /* delay for a minimum of <ms> */
  21. {
  22.         // we use a calibrated macro. This is more
  23.         // accurate and not so much compiler dependent
  24.         // as self made code.
  25.         while(ms){
  26.                 _delay_ms(0.96);
  27.                 ms--;
  28.         }
  29. }
  30.  
  31.  
  32.