summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-07-01 15:39:35 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-07-01 15:39:35 +0200
commit01227e76785845dae377a8808146ff51209f727a (patch)
treecd54fa87a17778fe8905c8de24bed8df0349d93d
parentda3ebb99ab95e659f2dc3e51fd1182258878011c (diff)
downloadanalog_instruments-01227e76785845dae377a8808146ff51209f727a.tar.gz
Makefile: add minipro flash and fuse targets
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 386814d..8e0d74e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
MCU = atmega8
+# only for avrdude
PROGRAMMER = dragon_isp
CPUFREQ = 8000000 #8MHz
@@ -53,9 +54,18 @@ all: clean build
flash: build
@sudo avrdude -p $(MCU) -c $(PROGRAMMER) -U flash:w:$(BUILDDIR)/$(OUTPUT).hex:i
+flash-minipro: build
+ @sudo minipro -p $(MCU) -w $(BUILDDIR)/$(OUTPUT).hex -f ihex
+
fuse:
@sudo avrdude -p $(MCU) -c $(PROGRAMMER) -U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE):m
+fuse-minipro: dir
+ @echo fuses_lo = $(LFUSE) > $(BUILDDIR)/fuses.conf
+ @echo fuses_hi = $(HFUSE) >> $(BUILDDIR)/fuses.conf
+ @echo lock_byte= 0xff >> $(BUILDDIR)/fuses.conf
+ @sudo minipro -p $(MCU) -c config -w $(BUILDDIR)/fuses.conf
+
devsetup:
@echo "--target=avr -isystem /usr/avr/include/ $(CFLAGS)" | tr ' ' '\n' > compile_flags.txt