Compare commits
No commits in common. '1fee74045843635677b22f910f9ef13c12131f40' and '77afb9d4cf4abcec2a12e5997a5b616fe9be98d1' have entirely different histories.
1fee740458
...
77afb9d4cf
@ -1,12 +0,0 @@
|
|||||||
--target=avr
|
|
||||||
-D
|
|
||||||
__AVR_ATmega324PA__
|
|
||||||
-D
|
|
||||||
F_CPU=16000000UL
|
|
||||||
-I
|
|
||||||
/usr/lib/avr/include
|
|
||||||
-I
|
|
||||||
./include
|
|
||||||
-I
|
|
||||||
../../dmm-libs/include
|
|
||||||
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
TARGET = main
|
|
||||||
SRCS := $(shell find ../../dmm-libs/src/ -name '*.c') $(shell find src/ -name '*.c')
|
|
||||||
FILES = $(SRCS:%.c=%) #main uart avrIOhelper/io-helper #uart#hier alle c-Datein reinschreiben, trennung durch " " und ohne .c-Endung
|
|
||||||
MCU = atmega324pa
|
|
||||||
PROGC = m324pa
|
|
||||||
CC = avr-gcc
|
|
||||||
#TOOL = stk500 -P /dev/ttyUSB0
|
|
||||||
TOOL = atmelice
|
|
||||||
#TOOL = avrispmkii
|
|
||||||
#TOOL = usbasp-clone
|
|
||||||
|
|
||||||
BUILDDIR = Builds
|
|
||||||
|
|
||||||
DEFINES = -DF_CPU=16000000UL -I include/ -I ../../dmm-libs/include/
|
|
||||||
|
|
||||||
CFLAGS =-mmcu=$(MCU) -O2 -Wall -Wpedantic $(DEFINES) -std=c99 -ffunction-sections -fdata-sections
|
|
||||||
LDFLAGS =-mmcu=$(MCU) -Wl,--gc-sections
|
|
||||||
|
|
||||||
LDFILES = $(foreach FILE,$(FILES),$(BUILDDIR)/$(FILE).o)
|
|
||||||
|
|
||||||
all: clean $(BUILDDIR)/$(TARGET).elf
|
|
||||||
|
|
||||||
$(BUILDDIR)/%.o: %.c
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(CC) $(CFLAGS) -c $< -o $(BUILDDIR)/$*.o
|
|
||||||
|
|
||||||
$(BUILDDIR)/$(TARGET).elf: $(LDFILES)
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(CC) $(LDFLAGS) $(LDFILES) -o $(BUILDDIR)/$(TARGET).elf
|
|
||||||
|
|
||||||
$(BUILDDIR)/$(TARGET).hex : $(BUILDDIR)/$(TARGET).elf
|
|
||||||
avr-objcopy -j .data -j .text -O ihex $< $@
|
|
||||||
|
|
||||||
fuse:
|
|
||||||
avrdude -p $(PROGC) -c $(TOOL) -U lfuse:w:0xE8:m -U hfuse:w:0xD1:m
|
|
||||||
|
|
||||||
load: $(BUILDDIR)/$(TARGET).hex
|
|
||||||
avrdude -p $(PROGC) -c $(TOOL) -U flash:w:$(BUILDDIR)/$(TARGET).hex -v -B 4MHz
|
|
||||||
|
|
||||||
program: clean load
|
|
||||||
|
|
||||||
reset:
|
|
||||||
avrdude -p $(PROGC) -c $(TOOL)
|
|
||||||
|
|
||||||
size: $(BUILDDIR)/$(TARGET).elf
|
|
||||||
avr-size -C --mcu=$(MCU) $(BUILDDIR)/$(TARGET).elf
|
|
||||||
|
|
||||||
.PHONY=clean
|
|
||||||
clean:
|
|
||||||
rm -rf $(BUILDDIR)
|
|
||||||
|
|
||||||
|
|
||||||
#Fuse m1284p external Osz. Long startuptime
|
|
||||||
# avrdude -c usbasp-clone -p m1284p -U lfuse:w:0xff:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m
|
|
||||||
|
|
||||||
#Fuse m1284p internal Osz. Long startuptime
|
|
||||||
# avrdude -c usbasp-clone -p m1284p -U lfuse:w:0xe2:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue