From e099b0f94a12dbe099949627d6f8198bd8156d49 Mon Sep 17 00:00:00 2001 From: finga Date: Thu, 9 Sep 2021 19:47:06 +0200 Subject: [PATCH] Move clock speed setting into makefile Move clock speed setting into makefile. --- firmware/src/Makefile | 3 ++- firmware/src/main.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/firmware/src/Makefile b/firmware/src/Makefile index f792d8e..6c80b72 100644 --- a/firmware/src/Makefile +++ b/firmware/src/Makefile @@ -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) diff --git a/firmware/src/main.c b/firmware/src/main.c index 97b51f2..f70b58d 100644 --- a/firmware/src/main.c +++ b/firmware/src/main.c @@ -1,5 +1,3 @@ -#define F_CPU 8000000UL - #include #include #include