Subversion Repositories FlightCtrl

Rev

Rev 1400 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1400 Rev 1452
Line 18... Line 18...
18
 HEX_NAME = MEGA32
18
 HEX_NAME = MEGA32
19
endif
19
endif
Line 20... Line 20...
20
 
20
 
21
ifeq ($(MCU), atmega644)
21
ifeq ($(MCU), atmega644)
22
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
22
FUSE_SETTINGS = -u -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
23
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m  
23
#FUSE_SETTINGS = -U lfuse:w:0xff:m -U hfuse:w:0xdf:m
24
# -u  bei neuen Controllern wieder einspielen
24
# -u  bei neuen Controllern wieder einspielen
25
 HEX_NAME = MEGA644
25
 HEX_NAME = MEGA644
Line 26... Line 26...
26
endif
26
endif
Line 100... Line 100...
100
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
100
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
101
OPT = 2
101
OPT = 2
Line 102... Line 102...
102
 
102
 
103
##########################################################################################################
103
##########################################################################################################
104
# List C source files here. (C dependencies are automatically generated.)
104
# List C source files here. (C dependencies are automatically generated.)
105
SRC = main.c uart.c  printf_P.c timer0.c  analog.c menu.c 
105
SRC = main.c uart.c  printf_P.c timer0.c  analog.c menu.c
106
SRC += twimaster.c rc.c fc.c GPS.c spi.c led.c Spectrum.c
106
SRC += twimaster.c rc.c fc.c GPS.c spi.c led.c Spectrum.c
Line 107... Line 107...
107
SRC += mymath.c
107
SRC += mymath.c
Line 120... Line 120...
120
 
120
 
121
 
121
 
122
 
122
 
Line 123... Line 123...
123
# List any extra directories to look for include files here.
123
# List any extra directories to look for include files here.
124
#     Each directory must be seperated by a space.
124
#     Each directory must be seperated by a space.
125
EXTRAINCDIRS = 
125
EXTRAINCDIRS =
Line 155... Line 155...
155
#  -ahlms:    create listing
155
#  -ahlms:    create listing
156
#  -gstabs:   have the assembler create line number information; note that
156
#  -gstabs:   have the assembler create line number information; note that
157
#             for use in COFF files, additional information about filenames
157
#             for use in COFF files, additional information about filenames
158
#             and function names needs to be present in the assembler source
158
#             and function names needs to be present in the assembler source
159
#             files -- see avr-libc docs [FIXME: not yet described there]
159
#             files -- see avr-libc docs [FIXME: not yet described there]
160
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs 
160
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
Line 161... Line 161...
161
 
161
 
162
 
162
 
Line 183... Line 183...
183
 
183
 
Line 184... Line 184...
184
 
184
 
185
 
185
 
186
# Programming support using avrdude. Settings and variables.
186
# Programming support using avrdude. Settings and variables.
187
 
187
 
188
# Programming hardware: alf avr910 avrisp bascom bsd 
188
# Programming hardware: alf avr910 avrisp bascom bsd
189
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
189
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
Line 199... Line 199...
199
 
199
 
200
#AVRDUDE_PORT = com1    # programmer connected to serial device
200
#AVRDUDE_PORT = com1    # programmer connected to serial device
201
#AVRDUDE_PORT = lpt1    # programmer connected to parallel port
201
#AVRDUDE_PORT = lpt1    # programmer connected to parallel port
Line 202... Line 202...
202
AVRDUDE_PORT = usb # programmer connected to USB
202
AVRDUDE_PORT = usb # programmer connected to USB
203
 
203
 
204
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex 
204
#AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
Line 205... Line 205...
205
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS)
205
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex $(FUSE_SETTINGS)
206
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
206
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
Line 216... Line 216...
216
# Uncomment the following if you do /not/ wish a verification to be
216
# Uncomment the following if you do /not/ wish a verification to be
217
# performed after programming the device.
217
# performed after programming the device.
218
AVRDUDE_FLAGS += -V
218
AVRDUDE_FLAGS += -V
Line 219... Line 219...
219
 
219
 
220
# Increase verbosity level.  Please use this when submitting bug
220
# Increase verbosity level.  Please use this when submitting bug
221
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> 
221
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
222
# to submit bug reports.
222
# to submit bug reports.
Line 223... Line 223...
223
#AVRDUDE_FLAGS += -v -v
223
#AVRDUDE_FLAGS += -v -v
224
 
224
 
Line 252... Line 252...
252
# Define Messages
252
# Define Messages
253
# English
253
# English
254
MSG_ERRORS_NONE = Errors: none
254
MSG_ERRORS_NONE = Errors: none
255
MSG_BEGIN = -------- begin --------
255
MSG_BEGIN = -------- begin --------
256
MSG_END = --------  end  --------
256
MSG_END = --------  end  --------
257
MSG_SIZE_BEFORE = Size before: 
257
MSG_SIZE_BEFORE = Size before:
258
MSG_SIZE_AFTER = Size after:
258
MSG_SIZE_AFTER = Size after:
259
MSG_COFF = Converting to AVR COFF:
259
MSG_COFF = Converting to AVR COFF:
260
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
260
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
261
MSG_FLASH = Creating load file for Flash:
261
MSG_FLASH = Creating load file for Flash:
262
MSG_EEPROM = Creating load file for EEPROM:
262
MSG_EEPROM = Creating load file for EEPROM:
Line 267... Line 267...
267
MSG_ASSEMBLING = Assembling:
267
MSG_ASSEMBLING = Assembling:
268
MSG_CLEANING = Cleaning project:
268
MSG_CLEANING = Cleaning project:
Line 269... Line 269...
269
 
269
 
270
 
270
 
Line 271... Line 271...
271
# Define all object files.
271
# Define all object files.
272
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) 
272
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
Line 273... Line 273...
273
 
273
 
Line 308... Line 308...
308
sizeafter:
308
sizeafter:
309
	@if [ -f $(TARGET).elf ]; then echo Size after:; $(ELFSIZE); $(HEXSIZE); echo; fi
309
	@if [ -f $(TARGET).elf ]; then echo Size after:; $(ELFSIZE); $(HEXSIZE); echo; fi
Line 310... Line 310...
310
 
310
 
311
 
311
 
312
# Display compiler version information.
312
# Display compiler version information.
Line 313... Line 313...
313
gccversion : 
313
gccversion :
314
	@$(CC) --version
314
	@$(CC) --version
315
 
315
 
316
 
316
 
317
# Convert ELF to COFF for use in debugging / simulating in
317
# Convert ELF to COFF for use in debugging / simulating in
318
# AVR Studio or VMLAB.
318
# AVR Studio or VMLAB.
319
COFFCONVERT=$(OBJCOPY) --debugging \
319
COFFCONVERT=$(OBJCOPY) --debugging \
Line 320... Line 320...
320
	--change-section-address .data-0x800000 \
320
	--change-section-address .data-0x800000 \
321
	--change-section-address .bss-0x800000 \
321
	--change-section-address .bss-0x800000 \
322
	--change-section-address .noinit-0x800000 \
322
	--change-section-address .noinit-0x800000 \
Line 335... Line 335...
335
	$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
335
	$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
Line 336... Line 336...
336
 
336
 
337
 
337
 
338
 
338
 
Line 364... Line 364...
364
 
364
 
365
# Create a symbol table from ELF output file.
365
# Create a symbol table from ELF output file.
366
%.sym: %.elf
366
%.sym: %.elf
367
	@echo
367
	@echo
368
	@echo $(MSG_SYMBOL_TABLE) $@
368
	@echo $(MSG_SYMBOL_TABLE) $@
Line 369... Line 369...
369
	avr-nm -n $< > $@
369
#	avr-nm -n $< > $@
370
 
370
 
Line 423... Line 423...
423
	$(REMOVE) $(LST)
423
	$(REMOVE) $(LST)
424
	$(REMOVE) $(SRC:.c=.s)
424
	$(REMOVE) $(SRC:.c=.s)
425
	$(REMOVE) $(SRC:.c=.d)
425
	$(REMOVE) $(SRC:.c=.d)
Line 426... Line 426...
426
 
426
 
427
 
427
 
428
# Automatically generate C source code dependencies. 
428
# Automatically generate C source code dependencies.
429
# (Code originally taken from the GNU make user manual and modified 
429
# (Code originally taken from the GNU make user manual and modified
430
# (See README.txt Credits).)
430
# (See README.txt Credits).)
431
#
431
#
432
# Note that this will work with sh (bash) and sed that is shipped with WinAVR
432
# Note that this will work with sh (bash) and sed that is shipped with WinAVR