Subversion Repositories HomeAutomation

Rev

Rev 663 | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
198 arune 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"
663 arune 11
#include <config.h>
215 arune 12
 
198 arune 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