Rev 234 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 234 | Rev 237 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | PRG = bios |
1 | PRG = bios |
| 2 | OBJ = vectors.o bios.o flash.o |
2 | OBJ = vectors.o bios.o flash.o |
| 3 | MCU_TARGET = |
3 | MCU_TARGET = atmega8 |
| 4 | OPTIMIZE = -Os -mcall-prologues |
4 | OPTIMIZE = -Os -mcall-prologues |
| 5 | BIOS_START = 0x1000 |
5 | BIOS_START = 0x1000 |
| 6 | BOOT_START = 0x1f00 |
6 | BOOT_START = 0x1f00 |
| 7 | 7 | ||
| 8 | DEFS = |
8 | DEFS = |
| 9 | LIBS = |
9 | LIBS = |
| 10 | 10 | ||
| - | 11 | TARGET_CLK_SRC = 0xe2 |
|
| - | 12 | #TARGET_CLK_SRC for mega88 |
|
| 11 |
|
13 | #0xe7 #CKDIV8=1, external crystal |
| - | 14 | #0xe0 #CKDIV8=1, external clock |
|
| 12 |
|
15 | #0xe2 #CKDIV8=1, internal RC |
| 13 |
|
16 | #TARGET_CLK_SRC for mega8 |
| 14 |
|
17 | #0x24 #BODLEVEL = 4.0V, BODEN=enabled, internal 8MHz |
| - | 18 | #0x20 #BODLEVEL = 4.0V, BODEN=enabled, external clock |
|
| 15 | 19 | ||
| - | 20 | # |
|
| 16 | # You should not have to change anything below here. |
21 | # You should not have to change anything below here. |
| - | 22 | # |
|
| 17 | 23 | ||
| 18 | CC = avr-gcc |
24 | CC = avr-gcc |
| 19 | 25 | ||
| 20 | # Override is only needed by avr-lib build system. |
26 | # Override is only needed by avr-lib build system. |
| 21 | 27 | ||
| Line 28... | Line 34... | ||
| 28 | SIZE = avr-size |
34 | SIZE = avr-size |
| 29 | SZFLAGS = |
35 | SZFLAGS = |
| 30 | UPLOAD = avrdude |
36 | UPLOAD = avrdude |
| 31 | ULFLAGS = -p $(MCU_TARGET) -P /dev/ttyUSB0 -c avrispv2 -b 115200 -U flash:w:$(PRG).hex |
37 | ULFLAGS = -p $(MCU_TARGET) -P /dev/ttyUSB0 -c avrispv2 -b 115200 -U flash:w:$(PRG).hex |
| 32 | 38 | ||
| - | 39 | ifeq ($(MCU_TARGET),atmega88) |
|
| - | 40 | #BOOTRST=0, BOOTSZ0=1, BOOTSZ1=1 |
|
| - | 41 | EXTFUSE = 0x06 |
|
| - | 42 | #BODLEVEL = 4.3V |
|
| - | 43 | HIGHFUSE = 0xdc |
|
| - | 44 | LOWFUSE = $(TARGET_CLK_SRC) |
|
| - | 45 | endif |
|
| - | 46 | ||
| - | 47 | ifeq ($(MCU_TARGET),atmega8) |
|
| - | 48 | #BOOTRST=0, BOOTSZ0=1, BOOTSZ1=1 |
|
| - | 49 | HIGHFUSE = 0xd6 |
|
| - | 50 | LOWFUSE = $(TARGET_CLK_SRC) |
|
| - | 51 | endif |
|
| - | 52 | ||
| - | 53 | AVRDUDE_WRITE_FUSEBITS = -u |
|
| - | 54 | ifdef EXTFUSE |
|
| - | 55 | AVRDUDE_WRITE_FUSEBITS += -U efuse:w:$(EXTFUSE):m |
|
| - | 56 | endif |
|
| - | 57 | ifdef HIGHFUSE |
|
| - | 58 | AVRDUDE_WRITE_FUSEBITS += -U hfuse:w:$(HIGHFUSE):m |
|
| - | 59 | endif |
|
| - | 60 | ifdef LOWFUSE |
|
| - | 61 | AVRDUDE_WRITE_FUSEBITS += -U lfuse:w:$(LOWFUSE):m |
|
| - | 62 | endif |
|
| - | 63 | ||
| - | 64 | #comment this line for not programming fusebits |
|
| - | 65 | ULFLAGS += $(AVRDUDE_WRITE_FUSEBITS) |
|
| 33 | 66 | ||
| 34 | default: $(PRG).elf lst |
67 | default: $(PRG).elf lst |
| 35 | @$(SIZE) $(SZFLAGS) $(PRG).elf |
68 | @$(SIZE) $(SZFLAGS) $(PRG).elf |
| 36 | 69 | ||
| 37 | all: $(PRG).elf lst text eeprom |
70 | all: $(PRG).elf lst text eeprom |