Rev 2033 | Rev 2044 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2033 | Rev 2039 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | #------------------------------------------------------------------- |
14 | #------------------------------------------------------------------- |
15 | #OPTIONS |
15 | #OPTIONS |
Line 16... | Line 16... | ||
16 | 16 | ||
17 | # Use one of the extensions for a gps solution |
17 | # Use one of the extensions for a gps solution |
18 | #EXT = NAVICTRL |
18 | #EXT = NAVICTRL |
19 | #EXT = MK3MAG |
19 | EXT = DIRECT_GPS |
20 | EXT = |
- | |
21 | - | ||
22 | # Use optional one the RCs if EXT = NAVICTRL has been used |
- | |
23 | #RC = DSL |
- | |
Line 24... | Line 20... | ||
24 | #RC = SPECTRUM |
20 | #EXT = |
25 | 21 | ||
26 | #GYRO=ENC-03_FC1.3 |
22 | #GYRO=ENC-03_FC1.3 |
27 | #GYRO_HW_NAME=ENC |
23 | #GYRO_HW_NAME=ENC |
Line 46... | Line 42... | ||
46 | REV=0001 |
42 | REV=0001 |
47 | #$(shell sh -c "cat .svn/entries | sed -n '4p'") |
43 | #$(shell sh -c "cat .svn/entries | sed -n '4p'") |
Line 48... | Line 44... | ||
48 | 44 | ||
49 | ifeq ($(MCU), atmega644) |
45 | ifeq ($(MCU), atmega644) |
50 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
46 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
51 | HEX_NAME = MEGA644_$(EXT)_$(RC)_$(GYRO) |
47 | HEX_NAME = MEGA644_$(EXT)_$(GYRO) |
Line 52... | Line 48... | ||
52 | endif |
48 | endif |
53 | 49 | ||
54 | ifeq ($(MCU), atmega644p) |
50 | ifeq ($(MCU), atmega644p) |
55 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
51 | FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m |
Line 56... | Line -... | ||
56 | HEX_NAME = MEGA644p_$(EXT)_$(RC)_$(GYRO) |
- | |
57 | endif |
- | |
58 | - | ||
59 | - | ||
60 | ifeq ($(F_CPU), 16000000) |
52 | HEX_NAME = MEGA644p_$(EXT)_$(GYRO) |
61 | QUARZ = 16MHZ |
53 | endif |
62 | endif |
54 | |
Line 135... | Line 127... | ||
135 | #OPT = s |
127 | #OPT = s |
Line 136... | Line 128... | ||
136 | 128 | ||
137 | ########################################################################################################## |
129 | ########################################################################################################## |
138 | # List C source files here. (C dependencies are automatically generated.) |
130 | # List C source files here. (C dependencies are automatically generated.) |
139 | SRC = main.c uart0.c printf_P.c timer0.c timer2.c analog.c menu.c output.c controlMixer.c |
131 | SRC = main.c uart0.c printf_P.c timer0.c timer2.c analog.c menu.c output.c controlMixer.c |
140 | SRC += externalControl.c GPSControl.c dongfangMath.c twimaster.c rc.c attitude.c flight.c |
132 | SRC += externalControl.c dongfangMath.c twimaster.c rc.c attitude.c flight.c |
Line 141... | Line 133... | ||
141 | SRC += eeprom.c heightControl.c configuration.c attitudeControl.c commands.c $(GYRO).c |
133 | SRC += eeprom.c heightControl.c configuration.c attitudeControl.c commands.c $(GYRO).c |
142 | 134 | ||
143 | ifeq ($(EXT), MK3MAG) |
- | |
144 | SRC += mk3mag.c |
135 | ifeq ($(EXT), DIRECT_GPS) |
- | 136 | SRC += mk3mag.c directGPSNaviControl.c uart1.c ubx.c |
|
145 | #mymath.c |
137 | endif |
146 | endif |
138 | |
147 | ifeq ($(EXT), NAVICTRL) |
- | |
148 | SRC += spi.c |
- | |
149 | ifeq ($(RC), DSL) |
- | |
150 | SRC += dsl.c |
- | |
151 | endif |
- | |
152 | ifeq ($(RC), SPECTRUM) |
- | |
153 | SRC += spectrum.c |
139 | ifeq ($(EXT), NAVICTRL) |
154 | endif |
140 | SRC += spi.c |
Line 155... | Line 141... | ||
155 | endif |
141 | endif |
156 | ########################################################################################################## |
142 | ########################################################################################################## |
157 | 143 | ||
158 | # List Assembler source files here. |
144 | # List Assembler source files here. |
159 | # Make them always end in a capital .S. Files ending in a lowercase .s |
145 | # Make them always end in a capital .S. Files ending in a lowercase .s |
160 | # will not be considered source files but generated files (assembler |
146 | # will not be considered source files but generated files (assembler |
161 | # output from the compiler), and will be deleted upon "make clean"! |
147 | # output from the compiler), and will be deleted upon "make clean"! |
162 | # Even though the DOS/Win* filesystem matches both .s and .S the same, |
148 | # Even though the DOS/Win* filesystem matches both .s and .S the same, |
Line 163... | Line 149... | ||
163 | # it will preserve the spelling of the filenames, and gcc itself does |
149 | # it will preserve the spelling of the filenames, and gcc itself does |
164 | # care about how the name is spelled on its command-line. |
150 | # care about how the name is spelled on its command-line. |
165 | ASRC = |
151 | ASRC = isqrt.S |
Line 192... | Line 178... | ||
192 | #CFLAGS += -std=c99 |
178 | #CFLAGS += -std=c99 |
193 | CFLAGS += -std=gnu99 |
179 | CFLAGS += -std=gnu99 |
Line 194... | Line 180... | ||
194 | 180 | ||
Line 195... | Line 181... | ||
195 | CFLAGS += -DF_CPU=$(F_CPU) -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_PATCH=$(VERSION_PATCH) -DVERSION_SERIAL_MAJOR=$(VERSION_SERIAL_MAJOR) -DVERSION_SERIAL_MINOR=$(VERSION_SERIAL_MINOR) -DNC_SPI_COMPATIBLE=$(NC_SPI_COMPATIBLE) -DGYRO_HW_NAME=${GYRO_HW_NAME} -DGYRO_HW_FACTOR=${GYRO_HW_FACTOR} -DGYRO_PITCHROLL_CORRECTION=${GYRO_PITCHROLL_CORRECTION} -DGYRO_YAW_CORRECTION=${GYRO_YAW_CORRECTION} |
181 | CFLAGS += -DF_CPU=$(F_CPU) -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_PATCH=$(VERSION_PATCH) -DVERSION_SERIAL_MAJOR=$(VERSION_SERIAL_MAJOR) -DVERSION_SERIAL_MINOR=$(VERSION_SERIAL_MINOR) -DNC_SPI_COMPATIBLE=$(NC_SPI_COMPATIBLE) -DGYRO_HW_NAME=${GYRO_HW_NAME} -DGYRO_HW_FACTOR=${GYRO_HW_FACTOR} -DGYRO_PITCHROLL_CORRECTION=${GYRO_PITCHROLL_CORRECTION} -DGYRO_YAW_CORRECTION=${GYRO_YAW_CORRECTION} |
196 | 182 | ||
197 | ifeq ($(EXT), MK3MAG) |
183 | ifeq ($(EXT), DIRECT_GPS) |
198 | CFLAGS += -DUSE_MK3MAG |
184 | CFLAGS += -DUSE_DIRECT_GPS |
199 | endif |
185 | endif |
200 | ifeq ($(EXT), NAVICTRL) |
- | |
201 | CFLAGS += -DUSE_NAVICTRL |
- | |
202 | ifeq ($(RC), DSL) |
- | |
203 | CFLAGS += -DUSE_RC_DSL |
- | |
204 | endif |
- | |
205 | ifeq ($(RC), SPECTRUM) |
- | |
206 | CFLAGS += -DUSE_RC_SPECTRUM |
186 | ifeq ($(EXT), NAVICTRL) |
Line 207... | Line 187... | ||
207 | endif |
187 | CFLAGS += -DUSE_NAVICTRL |
208 | endif |
188 | endif |
209 | 189 | ||
Line 405... | Line 385... | ||
405 | extcoff: $(TARGET).elf |
385 | extcoff: $(TARGET).elf |
406 | @echo |
386 | @echo |
407 | @echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
387 | @echo $(MSG_EXTENDED_COFF) $(TARGET).cof |
408 | $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
388 | $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof |
Line 409... | Line -... | ||
409 | - | ||
410 | - | ||
411 | - | ||
412 | 389 | ||
413 | # Program the device. |
390 | # Program the device. |
414 | program: $(TARGET).hex $(TARGET).eep |
391 | program: $(TARGET).hex $(TARGET).eep |
Line 415... | Line -... | ||
415 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
- | |
416 | - | ||
417 | - | ||
418 | 392 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
|
419 | 393 | ||
420 | # Create final output files (.hex, .eep) from ELF output file. |
394 | # Create final output files (.hex, .eep) from ELF output file. |
421 | %.hex: %.elf |
395 | %.hex: %.elf |
422 | @echo |
396 | @echo |