From 58d84aa5369b5acd249a57edc9514267dc2e375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Gro=C3=9F?= Date: Thu, 2 Dec 2021 22:27:10 +0100 Subject: [PATCH] Add F_CPU macro to define CPU frequency. Necessary for delay.h --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bc43382..5a7401c 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ TARGET = $(BUILDFOLDER)$(TARGETNAME) INC = -Isrc/include -I/usr/lib/avr/include/ CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega32u4 +CPPFLAGS = -DF_CPU=8000000UL SRC = $(wildcard src/*.c) @@ -11,7 +12,7 @@ all: $(TARGET) $(TARGET): $(SRC) mkdir -p build - avr-gcc -o $@.elf $^ $(CFLAGS) $(INC) + avr-gcc -o $@.elf $^ $(CPPFLAGS) $(CFLAGS) $(INC) avr-objcopy -j .text -j .data -O ihex $@.elf $@.hex clean: