added usb programmer option to blackbox makefile

Wed, 14 Dec 2011 20:43:08 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Wed, 14 Dec 2011 20:43:08 +0100
changeset 80
393b63b8c95f
parent 79
027e164b32f3
child 81
4f2f94a043fd

added usb programmer option to blackbox makefile

blackbox/Makefile file | annotate | diff | comparison | revisions
--- a/blackbox/Makefile	Tue Dec 13 18:41:13 2011 +0100
+++ b/blackbox/Makefile	Wed Dec 14 20:43:08 2011 +0100
@@ -11,7 +11,12 @@
 F_CPU = 8000000
 
 BAUD=57600
-ISP_BAUD = 115200
+ISP_BAUD=115200
+ifdef USB
+PORT=/dev/ttyUSB$(USB)
+else
+PORT=/dev/ttyS0
+endif
 
 #SRC = main.c seriald.c driver/ADC.c driver/clock.c driver/timer.c
 #SRC = main.c driver/rs232.c driver/manchester.c
@@ -74,10 +79,10 @@
 	rm $(PRG).map
 
 program: code
-	$(AVRDUDE) -c stk500v2 -b $(ISP_BAUD) -i 1 -p $(MCU) -V -U flash:w:$(PRG).hex:i
+	$(AVRDUDE) -P $(PORT) -c stk500v2 -b $(ISP_BAUD) -i 1 -p $(MCU) -V -U flash:w:$(PRG).hex:i
 
 fuse:
-	$(AVRDUDE) -c stk500 -p $(MCU) -V $(FUSES)
+	$(AVRDUDE) -P $(PORT) -c stk500v2 -p $(MCU) -V $(FUSES)
 
 clean:
 	rm -rf *.o *.elf *.elf.src *.s *.i

mercurial