Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
310 pangu 1
#if defined (__AVR_ATmega8__)
2
#define TIMER_TEILER          CK8
3
//#define TIMER_RELOAD_VALUE    125
4
#endif
5
 
6
#define INT0_ENABLE      GIMSK |= 0x40           
7
#define INT0_DISABLE     GIMSK &= ~0x40           
8
#define TIM0_START       TIMSK |= 0x01                        
9
#define TIM0_STOPP       TIMSK &= ~0x01                        
10
#define ICP_INT_ENABLE   TIMSK |= 0x20                        
11
#define ICP_INT_DISABLE  TIMSK &= ~0x20                        
12
#define TIMER1_INT_ENABLE   TIMSK |= 0x04                        
13
#define TIMER1_INT_DISABLE  TIMSK &= ~0x04                        
14
#define TIMER2_INT_ENABLE   TIMSK |= 0x40                        
15
#define TIMER2_INT_DISABLE  TIMSK &= ~0x40                        
16
#define INT0_POS_FLANKE   MCUCR |= 0x01
17
#define INT0_ANY_FLANKE   MCUCR |= 0x01
18
#define INT0_NEG_FLANKE   MCUCR &= ~0x01
19
#define CLR_INT0_FLAG     GIFR &= ~0x40
20
#define INIT_INT0_FLANKE  MCUCR &= ~0x03; MCUCR |= 0x02;
21
#define TIMER0_PRESCALER  TCCR0
22
#define ICP_POS_FLANKE    TCCR1B |= (1<<ICES1)
23
#define ICP_NEG_FLANKE    TCCR1B &= ~(1<<ICES1)
24
 
25
 
26
extern volatile unsigned int CountMilliseconds;
27
extern volatile unsigned char Timer0Overflow;
28
extern volatile unsigned int flag10ms;
29
 
30
 
31
void Timer_Init(void);
32
void Delay_ms(unsigned int);
33
unsigned int SetDelay (unsigned int t);
34
char CheckDelay (unsigned int t);
35