Subversion Repositories FlightCtrl

Rev

Rev 935 | Rev 942 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 935 Rev 936
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
//Hier die Quarz Frequenz einstellen
-
 
7
#if defined (__AVR_ATmega32__)
-
 
8
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
-
 
9
#endif
-
 
10
 
6
//set crystal frequency here
11
#if defined (__AVR_ATmega644__)
7
#if defined (__AVR_ATmega644__)
12
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
8
#define SYSCLK  20000000L       //crystal freqency in Hz
13
#endif
9
#endif
14
 
10
 
15
#if defined (__AVR_ATmega644P__)
11
#if defined (__AVR_ATmega644P__)
16
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
12
#define SYSCLK  20000000L       //crystal freqency in Hz
17
#endif
13
#endif
18
 
14
 
19
#define F_CPU SYSCLK
15
#define F_CPU SYSCLK
20
 
16
 
21
 
17
 
22
// neue Hardware
18
// neue Hardware
23
#define ROT_OFF   {if(BoardRelease == 10) PORTB &=~(1<<PORTB0); else  PORTB |= (1<<PORTB0);}
19
#define RED_OFF   {if(BoardRelease == 10) PORTB &=~(1<<PORTB0); else  PORTB |= (1<<PORTB0);}
24
#define ROT_ON    {if(BoardRelease == 10) PORTB |= (1<<PORTB0); else  PORTB &=~(1<<PORTB0);}
20
#define RED_ON    {if(BoardRelease == 10) PORTB |= (1<<PORTB0); else  PORTB &=~(1<<PORTB0);}
25
#define ROT_FLASH PORTB ^= (1<<PORTB0)
21
#define RED_FLASH PORTB ^= (1<<PORTB0)
26
#define GRN_OFF   PORTB &=~(1<<PORTB1)
22
#define GRN_OFF   {if(BoardRelease  < 12) PORTB &=~(1<<PORTB1); else PORTB |= (1<<PORTB1);}
27
#define GRN_ON    PORTB |= (1<<PORTB1)
23
#define GRN_ON    {if(BoardRelease  < 12) PORTB |= (1<<PORTB1); else PORTB &=~(1<<PORTB1);}
28
#define GRN_FLASH PORTB ^= (1<<PORTB1)
24
#define GRN_FLASH PORTB ^= (1<<PORTB1)
29
 
25
 
30
#include <inttypes.h>
26
#include <inttypes.h>
31
 
27
 
32
extern uint8_t BoardRelease;
28
extern uint8_t BoardRelease;
33
 
29
 
34
#endif //_MAIN_H
30
#endif //_MAIN_H
35
 
31
 
36
 
32
 
37
 
33
 
38
 
34
 
39
 
35
 
40
 
36
 
41
 
37