Add F_CPU macro to define CPU frequency.
Necessary for delay.h
This commit is contained in:
parent
859e87b3d8
commit
58d84aa536
3
Makefile
3
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:
|
||||
|
Loading…
Reference in New Issue
Block a user