Subversion Repositories FlightCtrl

Rev

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

Rev 885 Rev 886
Line 1... Line 1...
1
#--------------------------------------------------------------------
1
#--------------------------------------------------------------------
2
# MCU name
2
# MCU name
-
 
3
#MCU = atmega644
3
MCU = atmega644
4
MCU = atmega644p
4
F_CPU = 20000000
5
F_CPU = 20000000
5
#-------------------------------------------------------------------
6
#-------------------------------------------------------------------
6
HAUPT_VERSION    =   0
7
VERSION_MAJOR    =   0
7
NEBEN_VERSION    =  69
8
VERSION_MINOR    =  69
8
VERSION_INDEX    =  10
9
VERSION_INDEX    =  10
Line 9... Line 10...
9
 
10
 
-
 
11
VERSION_COMPATIBLE = 7  # PC-Kompatibilität
-
 
12
#-------------------------------------------------------------------
-
 
13
#OPTIONS
-
 
14
# Use on of the extensions für a gps solution
-
 
15
# If no extension is used the support for the MK3MAG only is included.
-
 
16
#EXT = KILLAGREG
10
VERSION_KOMPATIBEL = 7  # PC-Kompatibilität
17
#EXT = NAVICTRL
11
#-------------------------------------------------------------------
-
 
12
 
-
 
13
ifeq ($(MCU), atmega32)
-
 
14
# FUSE_SETTINGS= -u -U lfuse:w:0xff:m -U hfuse:w:0xcf:m
-
 
15
 
-
 
16
 HEX_NAME = MEGA32
-
 
Line 17... Line 18...
17
endif
18
#-------------------------------------------------------------------
18
 
19
 
19
ifeq ($(MCU), atmega644)
20
ifeq ($(MCU), atmega644)
20
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
21
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
21
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m  
22
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m  
22
# -u  bei neuen Controllern wieder einspielen
23
# -u  bei neuen Controllern wieder einspielen
Line 23... Line 24...
23
 HEX_NAME = MEGA644
24
 HEX_NAME = MEGA644_$(EXT)
24
endif
25
endif
25
 
26
 
26
ifeq ($(MCU), atmega644p)
27
ifeq ($(MCU), atmega644p)
Line 27... Line 28...
27
 FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
28
 FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
28
 HEX_NAME = MEGA644
29
 HEX_NAME = MEGA644p_$(EXT)
Line 42... Line 43...
42
FORMAT = ihex
43
FORMAT = ihex
Line 43... Line 44...
43
 
44
 
Line 44... Line 45...
44
# Target file name (without extension).
45
# Target file name (without extension).
45
 
46
 
46
ifeq ($(VERSION_INDEX), 0)
47
ifeq ($(VERSION_INDEX), 0)
47
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)a
48
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a
48
endif
49
endif
49
ifeq ($(VERSION_INDEX), 1)
50
ifeq ($(VERSION_INDEX), 1)
50
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)b
51
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)b
51
endif
52
endif
52
ifeq ($(VERSION_INDEX), 2)
53
ifeq ($(VERSION_INDEX), 2)
53
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)c
54
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)c
54
endif
55
endif
55
ifeq ($(VERSION_INDEX), 3)
56
ifeq ($(VERSION_INDEX), 3)
56
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)d
57
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)d
57
endif
58
endif
58
ifeq ($(VERSION_INDEX), 4)
59
ifeq ($(VERSION_INDEX), 4)
59
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)e
60
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)e
60
endif
61
endif
61
ifeq ($(VERSION_INDEX), 5)
62
ifeq ($(VERSION_INDEX), 5)
62
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)f
63
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)f
63
endif
64
endif
64
ifeq ($(VERSION_INDEX), 6)
65
ifeq ($(VERSION_INDEX), 6)
65
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)g
66
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)g
66
endif
67
endif
67
ifeq ($(VERSION_INDEX), 7)
68
ifeq ($(VERSION_INDEX), 7)
68
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)h
69
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)h
69
endif
70
endif
70
ifeq ($(VERSION_INDEX), 8)
71
ifeq ($(VERSION_INDEX), 8)
71
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)i
72
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)i
72
endif
73
endif
73
ifeq ($(VERSION_INDEX), 9)
74
ifeq ($(VERSION_INDEX), 9)
74
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)j
75
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)j
75
endif
76
endif
76
ifeq ($(VERSION_INDEX), 10)
77
ifeq ($(VERSION_INDEX), 10)
Line -... Line 78...
-
 
78
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)k
77
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(HAUPT_VERSION)_$(NEBEN_VERSION)k
79
endif
78
endif
80
 
79
 
81
 
Line 80... Line 82...
80
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization.
82
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization.
81
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
83
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
82
OPT = s
84
OPT = s
83
 
85
 
-
 
86
##########################################################################################################
-
 
87
# List C source files here. (C dependencies are automatically generated.)
-
 
88
SRC = main.c uart.c printf_P.c timer0.c timer2.c analog.c menu.c led.c 
-
 
89
SRC += twimaster.c rc.c fc.c eeprom.c fifo.c 
-
 
90
ifeq ($(MCU), atmega644p)
84
##########################################################################################################
91
SRC += uart1.c
-
 
92
endif
-
 
93
ifeq ($(EXT), KILLAGREG)
-
 
94
SRC += mm3.c mymath.c gps.c ubx.c
-
 
95
else
-
 
96
SRC += mk3mag.c
85
# List C source files here. (C dependencies are automatically generated.)
97
endif
Line 86... Line 98...
86
SRC = main.c uart.c  printf_P.c timer0.c  analog.c menu.c 
98
ifeq ($(EXT), NAVICTRL)
87
SRC += twimaster.c rc.c fc.c GPS.c spi.c
99
SRC += spi.c
Line 125... Line 137...
125
#CFLAGS += -std=c89
137
#CFLAGS += -std=c89
126
#CFLAGS += -std=gnu89
138
#CFLAGS += -std=gnu89
127
#CFLAGS += -std=c99
139
#CFLAGS += -std=c99
128
CFLAGS += -std=gnu99
140
CFLAGS += -std=gnu99
Line 129... Line 141...
129
 
141
 
-
 
142
CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_COMPATIBLE=$(VERSION_COMPATIBLE) -DVERSION_INDEX=$(VERSION_INDEX)
-
 
143
 
-
 
144
ifeq ($(EXT), KILLAGREG)
-
 
145
 CFLAGS += -DUSE_KILLAGREG
-
 
146
endif
-
 
147
ifeq ($(EXT), NAVICTRL)
-
 
148
 CFLAGS += -DUSE_NAVICTRL
-
 
149
endif
-
 
150
 
Line 130... Line 151...
130
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION) -DVERSION_KOMPATIBEL=$(VERSION_KOMPATIBEL) -DVERSION_INDEX=$(VERSION_INDEX)
151
 
131
 
152
 
132
 
153