Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names are used in a project.

Re-add in flip, flip-ee, dfu and dfu-ee targets to project makefiles (thanks to Opendous Inc.)

Fix allowable F_CPU values comment in project makefiles.
pull/1469/head
Dean Camera 15 years ago
parent f6700c0ea5
commit 0486f12e3e

@ -32,6 +32,18 @@
# make program = Download the hex file to the device, using avrdude. # make program = Download the hex file to the device, using avrdude.
# Please customize the avrdude settings below first! # Please customize the avrdude settings below first!
# #
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make doxygen = Generate DoxyGen documentation for the project (must have # make doxygen = Generate DoxyGen documentation for the project (must have
# DoxyGen installed) # DoxyGen installed)
# #
@ -59,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -319,9 +324,9 @@ EXTMEMOPTS =
# -Map: create map file # -Map: create map file
# --cref: add cross reference to map file # --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += -Wl,--relax LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
@ -458,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -501,13 +506,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -525,16 +533,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -689,9 +718,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -709,7 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
program dfu flip flip-ee dfu-ee clean debug \
clean_list clean_binary gdb-config doxygen clean_list clean_binary gdb-config doxygen

@ -32,6 +32,18 @@
# make program = Download the hex file to the device, using avrdude. # make program = Download the hex file to the device, using avrdude.
# Please customize the avrdude settings below first! # Please customize the avrdude settings below first!
# #
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make doxygen = Generate DoxyGen documentation for the project (must have # make doxygen = Generate DoxyGen documentation for the project (must have
# DoxyGen installed) # DoxyGen installed)
# #
@ -59,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -321,9 +326,9 @@ EXTMEMOPTS =
# -Map: create map file # -Map: create map file
# --cref: add cross reference to map file # --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += -Wl,--relax LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
@ -355,7 +360,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
# Uncomment the following if you do /not/ wish a verification to be # Uncomment the following if you do /not/ wish a verification to be
# performed after programming the device. # performed after programming the device.
AVRDUDE_NO_VERIFY = -V #AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug # Increase verbosity level. Please use this when submitting bug
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
@ -460,7 +465,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -503,13 +508,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -527,16 +535,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -691,9 +720,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -711,7 +740,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
program dfu flip flip-ee dfu-ee clean debug \
clean_list clean_binary gdb-config doxygen clean_list clean_binary gdb-config doxygen

@ -32,6 +32,18 @@
# make program = Download the hex file to the device, using avrdude. # make program = Download the hex file to the device, using avrdude.
# Please customize the avrdude settings below first! # Please customize the avrdude settings below first!
# #
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make doxygen = Generate DoxyGen documentation for the project (must have # make doxygen = Generate DoxyGen documentation for the project (must have
# DoxyGen installed) # DoxyGen installed)
# #
@ -59,28 +71,21 @@ BOARD =
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 16000000 F_CPU = 16000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -320,9 +325,9 @@ EXTMEMOPTS =
# -Map: create map file # -Map: create map file
# --cref: add cross reference to map file # --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += -Wl,--relax LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
@ -459,7 +464,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -502,13 +507,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -526,16 +534,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -690,9 +719,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -710,7 +739,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
program dfu flip flip-ee dfu-ee clean debug \
clean_list clean_binary gdb-config doxygen clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -192,7 +185,6 @@ CSTANDARD = -std=gnu99
# Place -D or -U options here for C sources # Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS) CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
CDEFS += -DAUDIO_OUT_STEREO
# Place -D or -U options here for ASM sources # Place -D or -U options here for ASM sources
@ -465,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -508,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -532,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -696,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -716,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -508,13 +501,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -696,9 +713,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -508,13 +501,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -696,9 +713,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -508,13 +501,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -696,9 +713,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -508,13 +501,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -696,9 +713,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -466,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -509,13 +502,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -533,16 +529,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -697,9 +714,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -717,8 +734,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -466,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -509,13 +502,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -533,16 +529,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -697,9 +714,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -717,8 +734,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -476,7 +469,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -519,13 +512,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -543,16 +539,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -707,9 +724,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -727,8 +744,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -508,13 +501,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -696,9 +713,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -469,7 +462,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -512,13 +505,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -536,16 +532,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -700,9 +717,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -720,8 +737,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -508,13 +501,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -696,9 +713,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -476,7 +469,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -519,13 +512,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -543,16 +539,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -707,9 +724,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -727,8 +744,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -505,13 +498,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -693,9 +710,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -461,7 +454,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -504,13 +497,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -528,16 +524,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -692,9 +709,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -712,8 +729,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -466,7 +466,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -509,13 +509,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -533,16 +536,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -697,9 +721,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -717,8 +741,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -505,13 +498,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -693,9 +710,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -505,13 +498,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -693,9 +710,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -505,13 +498,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -693,9 +710,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -507,13 +500,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -695,9 +712,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -58,6 +58,7 @@
# To rebuild project do "make clean" then "make all". # To rebuild project do "make clean" then "make all".
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# MCU name # MCU name
MCU = at90usb1287 MCU = at90usb1287
@ -70,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -462,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -505,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -529,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -693,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -713,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -277,8 +270,8 @@ PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
# If this is left blank, then it will use the Standard printf version. # If this is left blank, then it will use the Standard printf version.
#PRINTF_LIB = PRINTF_LIB =
PRINTF_LIB = $(PRINTF_LIB_MIN) #PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT) #PRINTF_LIB = $(PRINTF_LIB_FLOAT)
@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -505,13 +498,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -693,9 +710,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -37,6 +37,8 @@
* - The HID report parser now always processed FEATURE items - HID_ENABLE_FEATURE_PROCESSING token now has no effect * - The HID report parser now always processed FEATURE items - HID_ENABLE_FEATURE_PROCESSING token now has no effect
* - The HID report parser now always ignores constant-data items, HID_INCLUDE_CONSTANT_DATA_ITEMS token now has no effect * - The HID report parser now always ignores constant-data items, HID_INCLUDE_CONSTANT_DATA_ITEMS token now has no effect
* - The Benito Programmer project now has its own unique VID/PID pair allocated from the Atmel donated LUFA VID/PID pool * - The Benito Programmer project now has its own unique VID/PID pair allocated from the Atmel donated LUFA VID/PID pool
* - Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names
* are used in a project
* *
* <b>Fixed:</b> * <b>Fixed:</b>
* - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the * - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the
@ -56,6 +58,8 @@
* - Fixed StillImageHost not correctly freezing and unfreezing data pipes while waiting for a response block header * - Fixed StillImageHost not correctly freezing and unfreezing data pipes while waiting for a response block header
* - Fixed error in PrinterHost preventing the full page data from being sent to the attached device * - Fixed error in PrinterHost preventing the full page data from being sent to the attached device
* - CDC based demos and project now work under 64 bit versions of Windows (thanks to Ronny Hanson, Thomas Bleeker) * - CDC based demos and project now work under 64 bit versions of Windows (thanks to Ronny Hanson, Thomas Bleeker)
* - Re-add in flip, flip-ee, dfu and dfu-ee targets to project makefiles (thanks to Opendous Inc.)
* - Fix allowable F_CPU values comment in project makefiles
* *
* *
* \section Sec_ChangeLog090810 Version 090810 * \section Sec_ChangeLog090810 Version 090810

@ -13,9 +13,6 @@
* *
* <b>Targeted for This Release:</b> * <b>Targeted for This Release:</b>
* - Finish HID and Still Image Host Mode Class Drivers, add demo summaries * - Finish HID and Still Image Host Mode Class Drivers, add demo summaries
* - Re-add in flip, flip-ee, dfu and dfu-ee targets to project makefiles
* - Add in new invalid event hook check targets to project makefiles
* - Fix allowable F_CPU values comment in project makefiles
* *
* <b>Targeted for Future Releases:</b> * <b>Targeted for Future Releases:</b>
* - Add hub support to match Atmel's stack * - Add hub support to match Atmel's stack

@ -33,10 +33,18 @@ LUFA_SRC_FILES = ./Drivers/USB/LowLevel/DevChapter9.c \
./Drivers/Peripheral/Serial.c \ ./Drivers/Peripheral/Serial.c \
./Drivers/Peripheral/SerialStream.c \ ./Drivers/Peripheral/SerialStream.c \
all: LUFA_Events.lst:
@echo
@echo Generating LUFA event name list...
@$(shell) cat `find ./ -name "*.h"` | egrep "EVENT_[^\(]*\(" | \
sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d'(' -f1 | sort | uniq > LUFA_Events.lst
all: LUFA_Events.lst
clean: clean:
rm -f $(LUFA_SRC_FILES:%.c=%.o) rm -f $(LUFA_SRC_FILES:%.c=%.o)
rm -f LUFA_Events.lst
clean_list: clean_list:

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -470,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -513,13 +506,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -537,16 +533,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -701,9 +718,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -721,8 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USER
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -470,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -513,13 +506,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -537,16 +533,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -701,9 +718,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -721,8 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USER
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 16000000 F_CPU = 16000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -259,6 +252,7 @@ CPPFLAGS += -fshort-enums
CPPFLAGS += -fno-exceptions CPPFLAGS += -fno-exceptions
CPPFLAGS += -Wall CPPFLAGS += -Wall
CFLAGS += -Wundef CFLAGS += -Wundef
#CPPFLAGS += -mshort-calls
#CPPFLAGS += -fno-unit-at-a-time #CPPFLAGS += -fno-unit-at-a-time
#CPPFLAGS += -Wstrict-prototypes #CPPFLAGS += -Wstrict-prototypes
#CPPFLAGS += -Wunreachable-code #CPPFLAGS += -Wunreachable-code
@ -473,7 +467,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -516,13 +510,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -540,16 +537,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -704,9 +722,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -724,8 +742,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen

@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to # processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code. # automatically to create a 32-bit value in your source code.
# Typical values are: #
# F_CPU = 1000000 # This will be an integer division of F_CLOCK below, as it is sourced by
# F_CPU = 1843200 # F_CLOCK after it has run through any CPU prescalers. Note that this value
# F_CPU = 2000000 # does not *change* the processor frequency - it should merely be updated to
# F_CPU = 3686400 # reflect the processor speed set externally so that the code can use accurate
# F_CPU = 4000000 # software delays.
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000 F_CPU = 8000000
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_CLOCK, in all source code files equal to the # This will define a symbol, F_CLOCK, in all source code files equal to the
# input clock frequency (before any prescaling is performed). This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the # differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed # raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target. # Default target.
all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library. # Change the build target to build a HEX file or a library.
build: elf hex eep lss sym build: elf hex eep lss sym
@ -506,13 +499,16 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi 2>/dev/null; echo; fi
showeventhooks: build $(LUFA_PATH)/LUFA/LUFA_Events.lst:
@make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
@echo @echo
@echo -------- Unhooked LUFA Events -------- @echo Checking for invalid events...
@$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
echo "(None)" @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
@echo -------------------------------------- @if test -s InvalidEvents.tmp; then exit 1; fi
showliboptions: showliboptions:
@echo @echo
@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo -------------------------------------- @echo --------------------------------------
# Display compiler version information. # Display compiler version information.
gccversion : gccversion :
@$(CC) --version @$(CC) --version
# Program the device. # Program the device.
program: $(TARGET).hex $(TARGET).eep program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation erase f
batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
dfu: $(TARGET).hex
dfu-programmer $(MCU) erase
dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
dfu-programmer $(MCU) reset
flip-ee: $(TARGET).hex $(TARGET).eep
$(COPY) $(TARGET).eep $(TARGET)eep.hex
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
$(REMOVE) $(TARGET)eep.hex
dfu-ee: $(TARGET).hex $(TARGET).eep
dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
dfu-programmer $(MCU) reset
# Generate avr-gdb config/init file which does the following: # Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set # define the reset signal, load the target file, connect to target, and set
@ -694,9 +711,9 @@ clean_list:
$(REMOVE) $(SRC:.c=.s) $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d) $(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i) $(REMOVE) $(SRC:.c=.i)
$(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep $(REMOVEDIR) .dep
doxygen: doxygen:
@echo Generating Project Documentation... @echo Generating Project Documentation...
@doxygen Doxygen.conf @doxygen Doxygen.conf
@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets. # Listing of phony targets.
.PHONY : all showeventhooks showliboptions showtarget \ .PHONY : all checkinvalidevents showliboptions \
begin finish end sizebefore sizeafter gccversion build \ showtarget begin finish end sizebefore sizeafter \
elf hex eep lss sym coff extcoff program clean debug \ gccversion build elf hex eep lss sym coff extcoff \
clean_list clean_binary gdb-config doxygen dfu flip \ program dfu flip flip-ee dfu-ee clean debug \
flip-ee dfu-ee clean_list clean_binary gdb-config doxygen
Loading…
Cancel
Save