USBasp 2011.05.28. for Atmega328p 16 MHz
[pub/USBasp.git] / firmware / Makefile
index e57be2f..fd422b1 100755 (executable)
@@ -3,16 +3,19 @@
 #   20061119   Thomas Fischl        original
 #   20061120   Hanns-Konrad Unger   help: and TARGET=atmega48 added
 #   20140308   Peter Henn           TARGET=atmega328 added
+#   20140329   Peter Henn           F_CPU parameter added
 #
 
 # TARGET=atmega8    HFUSE=0xc9  LFUSE=0xef
 # TARGET=atmega48   HFUSE=0xdd  LFUSE=0xff
-# TARGET=atmega328  HFUSE=0xd9  LFUSE=0xef EFUSE=0x05
+# TARGET=atmega328  HFUSE=0xd9  LFUSE=0xef EFUSE=0x05 F_CPU=12000000
+# TARGET=atmega328  HFUSE=0xd9  LFUSE=0xef EFUSE=0x05 F_CPU=16000000
 # TARGET=at90s2313
 TARGET=atmega328p
 HFUSE=0xd9
 LFUSE=0xef
 EFUSE=0x05
+F_CPU=16000000
 
 # ISP=bsd      PORT=/dev/parport0
 # ISP=ponyser  PORT=/dev/ttyS1
@@ -38,11 +41,11 @@ help:
 ifdef EFUSE
        @echo "       EFUSE=${EFUSE}"
 endif
-       @echo "       CLOCK=12000000"
+       @echo "       CLOCK=${F_CPU}"
        @echo "       ISP=${ISP}"
        @echo "       PORT=${PORT}"
 
-COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=$(TARGET) # -DDEBUG_LEVEL=2
+COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=$(TARGET) -DF_CPU=$(F_CPU)L # -DDEBUG_LEVEL=2
 
 OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o isp.o clock.o tpi.o main.o