changeset 2:43d3b2bef999

Make the programmer code smarter, default to Dragon.
author darius@Inchoate
date Wed, 11 Mar 2009 17:10:13 +1030
parents f5022e20d550
children 15d89caaf516
files Makefile.avr
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.avr	Wed Mar 11 16:58:26 2009 +1030
+++ b/Makefile.avr	Wed Mar 11 17:10:13 2009 +1030
@@ -17,7 +17,7 @@
 # Tell as to generate listings
 CPPFLAGS+=-Wa,-adhlmsn=${<:T:S/.c/.lst/}
 
-MCU?=at90s8515
+MCU?=notset
 CFLAGS+=-mmcu=${MCU}
 
 LDFLAGS+=-Wl,-Map=${PROG}.map,--cref
@@ -26,7 +26,22 @@
 RM=rm -f
 
 PROGRAMMER=avrdude
-PROGOPTS?=-p ${PART} -c alf -E vcc,noreset -q
+PROGTYPE?=alf
+# Need the -B 1 or it is very slow. For slow clocks (eg factory fused) -B 10 works
+PROGEXTRA?=-B 1
+
+.if ${PROGTYPE} != "dragon_isp" && ${PROGTYPE} != "dragon_jtag"
+PROGEXITS?=vcc,noreset
+.endif
+
+.if defined(PROGEXITS) && ${PROGEXITS} != ""
+_PROGEXITS=-E ${PROGEXITS}
+.endif
+.if defined(PROGPORT) && ${PROGPORT} != ""
+_PROGPORT=-P ${PROGPORT}
+.endif
+
+PROGOPTS?=-p ${PART} -c ${PROGTYPE} ${_PROGPORT} ${_PROGEXITS} -q ${PROGEXTRA}
 
 .if !defined(SRCS)
 SRCS=	${PROG}.c