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/
|
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:
|
||||||
|
Loading…
Reference in New Issue
Block a user