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

View file

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