summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1e1575c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,15 @@
+MCU=atmega328p
+CORE_FREQ=16000000UL
+DEV=/dev/ttyUSB0
+
+firmware.elf: firmware.c
+ avr-gcc -mmcu=${MCU} -DF_CPU=${CORE_FREQ} -O1 -o firmware.elf firmware.c
+
+firmware: firmware.elf
+ avr-objcopy -O ihex $^ $@
+
+flash: firmware
+ sudo avrdude -c arduino -p ${MCU} -P ${DEV} -U flash:w:$^
+
+clean:
+ @rm firmware.elf firmware