comparison Makefile @ 26:292cd17de2a4

merge
author Matt Johnston <matt@ucc.asn.au>
date Wed, 26 Jun 2013 22:00:08 +0800
parents 5f9a40d6991b a55d7c2440fd
children ce5097eacf2f
comparison
equal deleted inserted replaced
25:534009795508 26:292cd17de2a4
4 # License: <insert your license reference here> 4 # License: <insert your license reference here>
5 5
6 # This is a prototype Makefile. Modify it according to your needs. 6 # This is a prototype Makefile. Modify it according to your needs.
7 # You should at least check the settings for 7 # You should at least check the settings for
8 # DEVICE ....... The AVR device you compile for 8 # DEVICE ....... The AVR device you compile for
9 # CLOCK ........ Target AVR clock rate in Hertz 9 # CLOCK ........ Target AVR CLOCK rate in Hertz
10 # OBJECTS ...... The object files created from your source files. This list is 10 # OBJECTS ...... The object files created from your source files. This list is
11 # usually the same as the list of source files with suffix ".o". 11 # usually the same as the list of source files with suffix ".o".
12 # PROGRAMMER ... Options to avrdude which define the hardware you use for 12 # PROGRAMMER ... Options to avrdude which define the hardware you use for
13 # uploading to the AVR and the interface where this hardware 13 # uploading to the AVR and the interface where this hardware
14 # is connected. We recommend that you leave it undefined and 14 # is connected. We recommend that you leave it undefined and
17 # default_serial = "avrdoper" 17 # default_serial = "avrdoper"
18 # FUSES ........ Parameters for avrdude to flash the fuses appropriately. 18 # FUSES ........ Parameters for avrdude to flash the fuses appropriately.
19 19
20 DEVICE = atmega328p 20 DEVICE = atmega328p
21 PROGDEVICE = atmega328p 21 PROGDEVICE = atmega328p
22 CLOCK = 4915200 22 CLOCK = 4915200L
23 PROGRAMMER = #-c stk500v2 -P avrdoper 23 PROGRAMMER = #-c stk500v2 -P avrdoper
24 PROGRAMMER = -c stk500 -P ~/dev/stk500 -p $(PROGDEVICE) -B 2 24 PROGRAMMER = -c stk500 -P ~/dev/stk500 -p $(PROGDEVICE) -B 2
25 SOURCE_1WIRE = onewire.c simple_ds18b20.c crc8.c 25 SOURCE_1WIRE = onewire.c simple_ds18b20.c crc8.c
26 SOURCE_CRYPTO = hmac-sha1.c sha1-asm.S aes.c 26 SOURCE_CRYPTO = hmac-sha1.c sha1-asm.S aes.c
27 SOURCE_SD = byteordering.c fat.c partition.c sd_raw.c 27 SOURCE_SD = byteordering.c fat.c partition.c sd_raw.c
31 31
32 OBJECTS := $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCE))) 32 OBJECTS := $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCE)))
33 33
34 # default but 2mhz 34 # default but 2mhz
35 FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x77:m -U efuse:w:0xfd:m 35 FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x77:m -U efuse:w:0xfd:m
36
37 #LOCKBIT
38 # -U lock:w:0x28:m
39 # 0 unused bit7
40 # 0 unused
41 # 1 blb12 no writing to bootloader
42 # 0 blb11
43 # 1 blb02 no writing to app
44 # 0 blb01
45 # 0 lb2
46 # 0 lb1 bit0
36 47
37 # ATMega8 fuse bits used above (fuse bits for other devices are different!): 48 # ATMega8 fuse bits used above (fuse bits for other devices are different!):
38 # Example for 8 MHz internal oscillator 49 # Example for 8 MHz internal oscillator
39 # Fuse high byte: 50 # Fuse high byte:
40 # 0xd9 = 1 1 0 1 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000) 51 # 0xd9 = 1 1 0 1 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
86 97
87 .c.s: 98 .c.s:
88 $(COMPILE) -S $< -o $@ 99 $(COMPILE) -S $< -o $@
89 100
90 flash: all 101 flash: all
91 $(AVRDUDE) -U flash:w:main.hex:i 102 $(AVRDUDE) -D -U flash:w:main.hex:i
92 103
93 checkprog: 104 checkprog:
94 $(AVRDUDE) -v 105 $(AVRDUDE) -v
95 106
96 fuse: 107 fuse: