summaryrefslogtreecommitdiffstats
path: root/stepper_driver/estop/firmware/Makefile
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2020-01-03 20:41:04 +0100
committerMichael Buesch <m@bues.ch>2020-01-03 20:41:04 +0100
commit78133304e0646995ed3286849cdc79c9b0772076 (patch)
tree206e1e30a3fc7bad942b742fb5944ac9ac41b720 /stepper_driver/estop/firmware/Makefile
parent0d30d8329625a5e45e199ccbcfa8225c53c9023d (diff)
downloadcnc-78133304e0646995ed3286849cdc79c9b0772076.tar.xz
cnc-78133304e0646995ed3286849cdc79c9b0772076.zip
Rename stepper driver directory
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'stepper_driver/estop/firmware/Makefile')
-rw-r--r--stepper_driver/estop/firmware/Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/stepper_driver/estop/firmware/Makefile b/stepper_driver/estop/firmware/Makefile
new file mode 100644
index 0000000..333c179
--- /dev/null
+++ b/stepper_driver/estop/firmware/Makefile
@@ -0,0 +1,43 @@
+ASM ?= avra
+AVRDUDE ?= avrdude
+AVRDUDE_ARCH ?= m8
+AVRDUDE_SPEED ?= 1
+PROGRAMMER ?= avrisp2
+PROGPORT ?= usb
+
+LFUSE = 0x04
+HFUSE = 0x99
+
+
+NAME = estop
+HEX = $(NAME).S.hex
+
+all: $(HEX)
+
+$(HEX): estop.S m8def.inc
+ $(ASM) estop.S
+ -srec_cat $(HEX) -Intel -Output $(NAME).S.bin -Binary
+ @echo
+ @echo "Successfully built the firmware"
+
+install: all
+ $(AVRDUDE) -B $(AVRDUDE_SPEED) -p $(AVRDUDE_ARCH) \
+ -c $(PROGRAMMER) -P $(PROGPORT) -U flash:w:$(HEX)
+
+avrdude:
+ $(AVRDUDE) -B $(AVRDUDE_SPEED) -p $(AVRDUDE_ARCH) \
+ -c $(PROGRAMMER) -P $(PROGPORT) -t
+
+reset:
+ $(AVRDUDE) -B $(AVRDUDE_SPEED) -p $(AVRDUDE_ARCH) \
+ -c $(PROGRAMMER) -P $(PROGPORT) \
+ -U signature:r:/dev/null:i -q -q
+
+writefuse:
+ $(AVRDUDE) -B 10 -p $(AVRDUDE_ARCH) \
+ -c $(PROGRAMMER) -P $(PROGPORT) -q -q \
+ -U lfuse:w:$(LFUSE):m \
+ -U hfuse:w:$(HFUSE):m
+
+clean:
+ -rm -f *~ *.cof *.hex *.obj *.bin *.bak *.cache.* *.o
bues.ch cgit interface