From 61a1ae5dc8673b7459706559e076d84c447d2a80 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sat, 11 Jul 2020 12:41:08 +0200 Subject: [PATCH] Add firmware template --- firmware/.gitignore | 4 ++++ firmware/Makefile | 20 ++++++++++++++++++++ firmware/main.c | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 firmware/.gitignore create mode 100644 firmware/Makefile create mode 100644 firmware/main.c diff --git a/firmware/.gitignore b/firmware/.gitignore new file mode 100644 index 0000000..f14feeb --- /dev/null +++ b/firmware/.gitignore @@ -0,0 +1,4 @@ +*.o +*.hex +*.obj +*.hex diff --git a/firmware/Makefile b/firmware/Makefile new file mode 100644 index 0000000..6cd36a8 --- /dev/null +++ b/firmware/Makefile @@ -0,0 +1,20 @@ +MCU=atmega88 +CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000 +LDFLAGS=-Wl,-gc-sections -Wl,-relax +CC=avr-gcc +TARGET=main +OBJECT_FILES=main.o + +all: $(TARGET).hex + +clean: + rm -f *.o *.hex *.obj *.hex + +%.hex: %.obj + avr-objcopy -R .eeprom -O ihex $< $@ + +%.obj: $(OBJECT_FILES) + $(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@ + +program: $(TARGET).hex + avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex diff --git a/firmware/main.c b/firmware/main.c new file mode 100644 index 0000000..2371c9a --- /dev/null +++ b/firmware/main.c @@ -0,0 +1,6 @@ +#include + +int main() +{ + +}