Subversion Repositories freemyipod

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 14
Line 23... Line 23...
23
 
23
 
24
#ifndef __TIMER_H__
24
#ifndef __TIMER_H__
25
#define __TIMER_H__
25
#define __TIMER_H__
26
 
26
 
27
#include "global.h"
27
#include "global.h"
-
 
28
#include "s5l8701.h"
28
 
29
 
29
 
30
 
30
#define TIME_AFTER(a,b)         ((long)(b) - (long)(a) < 0)
31
#define TIME_AFTER(a,b)         ((long)(b) - (long)(a) < 0)
31
#define TIME_BEFORE(a,b)        TIME_AFTER(b,a)
32
#define TIME_BEFORE(a,b)        TIME_AFTER(b,a)
32
#define TIMEOUT_EXPIRED(a,b)    TIME_AFTER(USEC_TIMER,a + b)
33
#define TIMEOUT_EXPIRED(a,b)    TIME_AFTER(USEC_TIMER,a + b)
33
 
34
 
34
 
35
 
35
static inline void sleep(long duration)  /* in usec steps */
36
static inline void udelay(long duration)  /* in usec steps */
36
{
37
{
37
    long timestamp = USEC_TIMER;
38
    long timestamp = USEC_TIMER;
38
    while (!TIMEOUT_EXPIRED(timestamp, duration));
39
    while (!TIMEOUT_EXPIRED(timestamp, duration));
39
}
40
}
40
 
41
 
41
 
42
 
-
 
43
void setup_tick() INITCODE_ATTR;
-
 
44
void INT_TIMERB() ICODE_ATTR;
-
 
45
 
-
 
46
 
42
#endif
47
#endif