Move clock speed setting into makefile
Move clock speed setting into makefile.
This commit is contained in:
parent
727f89eeb0
commit
e099b0f94a
2 changed files with 2 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#define F_CPU 8000000UL
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
|
|
Loading…
Reference in a new issue