Move clock speed setting into makefile

Move clock speed setting into makefile.
This commit is contained in:
finga 2021-09-09 19:47:06 +02:00
parent 727f89eeb0
commit e099b0f94a
2 changed files with 2 additions and 3 deletions

View file

@ -2,6 +2,7 @@
MCU := atmega328p
PROGRAMMER := usbasp
SPEED := 8000000UL
TARGET := main.hex
BIN := main.elf
@ -13,7 +14,7 @@ OBJCOPY := avr-objcopy
SIZE := avr-size
AVRDUDE := avrdude
CFLAGS := -mmcu=$(MCU) -Os -Wall -Werror -Wextra
CFLAGS := -mmcu=$(MCU) -D F_CPU=$(SPEED) -Os -Wall -Werror -Wextra
all: $(TARGET)

View file

@ -1,5 +1,3 @@
#define F_CPU 8000000UL
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>