P = Kalender
D = atmega328p
F = 16000000
PATH := C:\Program Files\WinAVR\gcc530\bin;$(PATH)
#Auswahl des Shields
# Frank Philippczyks allererstes Shield mit 75 mm Diagonale, lichtschwach (okay)
#SHIELD = ITDB02
#CHIP = 9325
# Meistverbautes Shield: Tino Bochmann, Michael Schulze, Lutz Auerswald,
# Waldenburg, Aufschrift "2,4" TFT LCD SHIELD", billig, mit ILI9341
SHIELD = TFT24
CHIP = 9341
#Lieferung September 2016: S6D04H0
#CHIP = 6040
#Lieferung September 2016: ILI9481
#CHIP = 9481
#Weitere Shields
#SHIELD = MCUFRIEND24
#SHIELD = LMS241GF31
#SHIELD = TFT28R3
#Weitere Chips:
# HX8347A HX8352A HX8340B_8 HX8340B_S HX8353C
# ILI9327 ILI9325C ILI9325D ILI9325D_ALT ILI9481 ILI9341_S4P ILI9341_S5P ILI9486
# SSD1289 SSD1963_480 SSD1963_800 SSD1963_800_ALT
# ST7735 ST7735_ALT ST7735S
# S1D19122 (grayscale 240x320)
# PCF8833
# S6D1121 S6D0164
# R61581
# CPLD = 10000
CL = avr-gcc -Wall -Os -std=c++14 -fno-move-loop-invariants -ffunction-sections
CL+= -Wl,-gc-sections -mno-interrupts -mrelax -mmcu=$D
CL+= -D SHIELD_$(SHIELD) -D CHIP=$(CHIP) -D F_CPU=$F
PGMR = avrdude -c arduino -p $D -P com4
all: $P.flash $P.lst
$P.flash: $P.elf
-avr-size -C --mcu=$D $<
avr-objcopy -j .text -j .data -O binary $< $@
avr-objcopy -j .eeprom -O binary $< $P.eeprom
$P.lst: $P.elf
avr-objdump -d $< > $@
avr-objdump -t $< | grep " O " | sort >> $@
avr-strip $<
Kalender.o: Kalender.cpp *.h Makefile
$(CL) -c -o $@ $<
# -D EELOAD
utft.o: utft.cpp *.h Makefile
$(CL) -c -o $@ $<
#DefaultFonts.o: DefaultFonts.c
# $(CL) -c -o $@ $<
ArialBP19.o: ArialBP19.c
$(CL) -c -o $@ $<
ArialBP24.o: ArialBP24.c
$(CL) -c -o $@ $<
calib.o: calib.cpp
$(CL) -c -o $@ $<
stellen.o: stellen.cpp *.h Makefile
$(CL) -c -o $@ $<
kal.o: kal.cpp *.h Makefile
$(CL) -c -o $@ $<
ifeq ($(SHIELD),ITDB02)
TouchScreen.o: TouchScreen0.cpp *.h Makefile
endif
ifeq ($(SHIELD),MCUFRIEND24)
TouchScreen.o: TouchScreen4.cpp *.h Makefile
endif
ifeq ($(SHIELD),TFT28R3)
TouchScreen.o: TouchScreen1.cpp *.h Makefile
endif
ifeq ($(SHIELD),TFT24)
TouchScreen.o: TouchScreen3.cpp *.h Makefile
endif
ifeq ($(SHIELD),LMS241GF31)
TouchScreen.o: TouchScreen2.cpp *.h Makefile
endif
$(CL) -c -o $@ $<
$P.elf: Kalender.o utft.o ArialBP19.o ArialBP24.o TouchScreen.o calib.o stellen.o kal.o
$(CL) -o $@ $^ -lc -lm
flash: $P.flash
$(PGMR) -U $@:w:$<:r
#-U eeprom:w:$P.eeprom:r
# $@ = Ziel
# $< = Quelle (1. Datei)
# $^ = alle Quellen
clean:
del *.o $P.elf $P.lst $P.eeprom $P.flash
| Detected encoding: UTF-8 | 0
|