Add F_CPU macro to define CPU frequency.

Necessary for delay.h
This commit is contained in:
Marco Groß 2021-12-02 22:27:10 +01:00
parent 859e87b3d8
commit 58d84aa536

View File

@ -4,6 +4,7 @@ TARGET = $(BUILDFOLDER)$(TARGETNAME)
INC = -Isrc/include -I/usr/lib/avr/include/ INC = -Isrc/include -I/usr/lib/avr/include/
CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega32u4 CFLAGS = -Wall -Wpedantic -Wextra -g -Os -mmcu=atmega32u4
CPPFLAGS = -DF_CPU=8000000UL
SRC = $(wildcard src/*.c) SRC = $(wildcard src/*.c)
@ -11,7 +12,7 @@ all: $(TARGET)
$(TARGET): $(SRC) $(TARGET): $(SRC)
mkdir -p build 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 avr-objcopy -j .text -j .data -O ihex $@.elf $@.hex
clean: clean: