Subversion Repositories FlightCtrl

Rev

Rev 1077 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1077 Rev 1078
1
#ifndef _MAIN_H
1
#ifndef _MAIN_H
2
#define _MAIN_H
2
#define _MAIN_H
3
 
3
 
4
#include <avr/io.h>
4
#include <avr/io.h>
5
 
5
 
6
//set crystal frequency here
6
//set crystal frequency here
7
#if defined (__AVR_ATmega644__)
7
#if defined (__AVR_ATmega644__)
8
#define SYSCLK  20000000L       //crystal freqency in Hz
8
#define SYSCLK  20000000L       //crystal freqency in Hz
9
#endif
9
#endif
10
 
10
 
11
#if defined (__AVR_ATmega644P__)
11
#if defined (__AVR_ATmega644P__)
12
#define SYSCLK  20000000L       //crystal freqency in Hz
12
#define SYSCLK  20000000L       //crystal freqency in Hz
13
#endif
13
#endif
14
 
14
 
15
#define F_CPU SYSCLK
15
#define F_CPU SYSCLK
16
 
16
 
17
 
17
 
18
// neue Hardware
18
// neue Hardware
19
#define RED_OFF   {if(BoardRelease == 10) PORTB &=~(1<<PORTB0); else  PORTB |= (1<<PORTB0);}
19
#define RED_OFF   {if((BoardRelease == 10)||(BoardRelease == 20)) PORTB &=~(1<<PORTB0); else  PORTB |= (1<<PORTB0);}
20
#define RED_ON    {if(BoardRelease == 10) PORTB |= (1<<PORTB0); else  PORTB &=~(1<<PORTB0);}
20
#define RED_ON    {if((BoardRelease == 10)||(BoardRelease == 20)) PORTB |= (1<<PORTB0); else  PORTB &=~(1<<PORTB0);}
21
#define RED_FLASH PORTB ^= (1<<PORTB0)
21
#define RED_FLASH PORTB ^= (1<<PORTB0)
22
#define GRN_OFF   {if(BoardRelease  < 12) PORTB &=~(1<<PORTB1); else PORTB |= (1<<PORTB1);}
22
#define GRN_OFF   {if(BoardRelease  < 12) PORTB &=~(1<<PORTB1); else PORTB |= (1<<PORTB1);}
23
#define GRN_ON    {if(BoardRelease  < 12) PORTB |= (1<<PORTB1); else PORTB &=~(1<<PORTB1);}
23
#define GRN_ON    {if(BoardRelease  < 12) PORTB |= (1<<PORTB1); else PORTB &=~(1<<PORTB1);}
24
#define GRN_FLASH PORTB ^= (1<<PORTB1)
24
#define GRN_FLASH PORTB ^= (1<<PORTB1)
25
 
25
 
26
#include <inttypes.h>
26
#include <inttypes.h>
27
 
27
 
28
extern uint8_t BoardRelease;
28
extern uint8_t BoardRelease;
29
 
29
 
30
#endif //_MAIN_H
30
#endif //_MAIN_H
31
 
31
 
32
 
32
 
33
 
33
 
34
 
34
 
35
 
35
 
36
 
36
 
37
 
37