aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-06 05:58:40 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-06 05:58:40 +0000
commit0486f12e3eab71e75273b774bb13eeb5937c544d (patch)
treed1d5db9c50805e92aa8c55958e2c833ca500bc65
parentf6700c0ea58f61e4413dfe416a526f6e9eb0fb73 (diff)
downloadlufa-0486f12e3eab71e75273b774bb13eeb5937c544d.tar.gz
lufa-0486f12e3eab71e75273b774bb13eeb5937c544d.tar.bz2
lufa-0486f12e3eab71e75273b774bb13eeb5937c544d.zip
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.
-rw-r--r--Bootloaders/CDC/makefile90
-rw-r--r--Bootloaders/DFU/makefile92
-rw-r--r--Bootloaders/TeensyHID/makefile88
-rw-r--r--Demos/Device/ClassDriver/AudioInput/makefile77
-rw-r--r--Demos/Device/ClassDriver/AudioOutput/makefile78
-rw-r--r--Demos/Device/ClassDriver/CDC/makefile77
-rw-r--r--Demos/Device/ClassDriver/DualCDC/makefile77
-rw-r--r--Demos/Device/ClassDriver/GenericHID/makefile77
-rw-r--r--Demos/Device/ClassDriver/Joystick/makefile77
-rw-r--r--Demos/Device/ClassDriver/Keyboard/makefile77
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/makefile77
-rw-r--r--Demos/Device/ClassDriver/MIDI/makefile77
-rw-r--r--Demos/Device/ClassDriver/MassStorage/makefile79
-rw-r--r--Demos/Device/ClassDriver/Mouse/makefile77
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/makefile77
-rw-r--r--Demos/Device/ClassDriver/USBtoSerial/makefile77
-rw-r--r--Demos/Device/Incomplete/Sideshow/makefile77
-rw-r--r--Demos/Device/LowLevel/AudioInput/makefile77
-rw-r--r--Demos/Device/LowLevel/AudioOutput/makefile77
-rw-r--r--Demos/Device/LowLevel/CDC/makefile77
-rw-r--r--Demos/Device/LowLevel/DualCDC/makefile77
-rw-r--r--Demos/Device/LowLevel/GenericHID/makefile77
-rw-r--r--Demos/Device/LowLevel/Joystick/makefile77
-rw-r--r--Demos/Device/LowLevel/Keyboard/makefile77
-rw-r--r--Demos/Device/LowLevel/KeyboardMouse/makefile77
-rw-r--r--Demos/Device/LowLevel/MIDI/makefile77
-rw-r--r--Demos/Device/LowLevel/MassStorage/makefile79
-rw-r--r--Demos/Device/LowLevel/Mouse/makefile77
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/makefile77
-rw-r--r--Demos/Device/LowLevel/USBtoSerial/makefile77
-rw-r--r--Demos/Host/ClassDriver/CDCHost/makefile77
-rw-r--r--Demos/Host/ClassDriver/MassStorageHost/makefile77
-rw-r--r--Demos/Host/ClassDriver/MouseHost/makefile77
-rw-r--r--Demos/Host/ClassDriver/StillImageHost/makefile77
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/makefile54
-rw-r--r--Demos/Host/LowLevel/CDCHost/makefile77
-rw-r--r--Demos/Host/LowLevel/GenericHIDHost/makefile77
-rw-r--r--Demos/Host/LowLevel/KeyboardHost/makefile77
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/makefile77
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/makefile77
-rw-r--r--Demos/Host/LowLevel/MouseHost/makefile77
-rw-r--r--Demos/Host/LowLevel/MouseHostWithParser/makefile77
-rw-r--r--Demos/Host/LowLevel/PrinterHost/makefile77
-rw-r--r--Demos/Host/LowLevel/StillImageHost/makefile78
-rw-r--r--Demos/OTG/TestApp/makefile83
-rw-r--r--LUFA/ManPages/ChangeLog.txt4
-rw-r--r--LUFA/ManPages/FutureChanges.txt3
-rw-r--r--LUFA/makefile12
-rw-r--r--Projects/AVRISP/makefile79
-rw-r--r--Projects/Benito/makefile77
-rw-r--r--Projects/Magstripe/makefile80
-rw-r--r--Projects/MissileLauncher/makefile77
52 files changed, 2357 insertions, 1468 deletions
diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile
index 3c79cb649..87cc5c792 100644
--- a/Bootloaders/CDC/makefile
+++ b/Bootloaders/CDC/makefile
@@ -32,6 +32,18 @@
# make program = Download the hex file to the device, using avrdude.
# 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
# DoxyGen installed)
#
@@ -59,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -319,9 +324,9 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--relax
-LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
@@ -458,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -501,14 +506,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -525,16 +533,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -709,7 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile
index 2f9444b34..622290ff3 100644
--- a/Bootloaders/DFU/makefile
+++ b/Bootloaders/DFU/makefile
@@ -32,6 +32,18 @@
# make program = Download the hex file to the device, using avrdude.
# 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
# DoxyGen installed)
#
@@ -59,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -321,9 +326,9 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--relax
-LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
+LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
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
# performed after programming the device.
-AVRDUDE_NO_VERIFY = -V
+#AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
# 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.
-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.
build: elf hex eep lss sym
@@ -503,14 +508,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -527,16 +535,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -711,7 +740,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Bootloaders/TeensyHID/makefile b/Bootloaders/TeensyHID/makefile
index e7e14e7d5..15d1d9dff 100644
--- a/Bootloaders/TeensyHID/makefile
+++ b/Bootloaders/TeensyHID/makefile
@@ -32,6 +32,18 @@
# make program = Download the hex file to the device, using avrdude.
# 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
# DoxyGen installed)
#
@@ -59,28 +71,21 @@ BOARD =
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 16000000
# Input clock frequency.
# 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
# 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'
@@ -320,9 +325,9 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
-LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
@@ -459,7 +464,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -502,14 +507,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -526,16 +534,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -710,7 +739,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/AudioInput/makefile b/Demos/Device/ClassDriver/AudioInput/makefile
index ad884a908..d68fb10df 100644
--- a/Demos/Device/ClassDriver/AudioInput/makefile
+++ b/Demos/Device/ClassDriver/AudioInput/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/AudioOutput/makefile b/Demos/Device/ClassDriver/AudioOutput/makefile
index 98ad10926..9940103e3 100644
--- a/Demos/Device/ClassDriver/AudioOutput/makefile
+++ b/Demos/Device/ClassDriver/AudioOutput/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -192,7 +185,6 @@ CSTANDARD = -std=gnu99
# 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 += -DAUDIO_OUT_STEREO
# 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.
-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.
build: elf hex eep lss sym
@@ -508,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -532,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -716,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/CDC/makefile b/Demos/Device/ClassDriver/CDC/makefile
index f3b34c295..996ec418d 100644
--- a/Demos/Device/ClassDriver/CDC/makefile
+++ b/Demos/Device/ClassDriver/CDC/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/DualCDC/makefile b/Demos/Device/ClassDriver/DualCDC/makefile
index cdacd2d33..0f2f41507 100644
--- a/Demos/Device/ClassDriver/DualCDC/makefile
+++ b/Demos/Device/ClassDriver/DualCDC/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/GenericHID/makefile b/Demos/Device/ClassDriver/GenericHID/makefile
index 17253ca11..bf5e41193 100644
--- a/Demos/Device/ClassDriver/GenericHID/makefile
+++ b/Demos/Device/ClassDriver/GenericHID/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -508,14 +501,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/Joystick/makefile b/Demos/Device/ClassDriver/Joystick/makefile
index 8b447e570..10051d70c 100644
--- a/Demos/Device/ClassDriver/Joystick/makefile
+++ b/Demos/Device/ClassDriver/Joystick/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -508,14 +501,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/Keyboard/makefile b/Demos/Device/ClassDriver/Keyboard/makefile
index 45e9ce4fd..d9e805aa0 100644
--- a/Demos/Device/ClassDriver/Keyboard/makefile
+++ b/Demos/Device/ClassDriver/Keyboard/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -508,14 +501,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/makefile b/Demos/Device/ClassDriver/KeyboardMouse/makefile
index 31393dd0a..a02e34dd5 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/makefile
+++ b/Demos/Device/ClassDriver/KeyboardMouse/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -508,14 +501,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/MIDI/makefile b/Demos/Device/ClassDriver/MIDI/makefile
index b474e5cb7..dd150d6ce 100644
--- a/Demos/Device/ClassDriver/MIDI/makefile
+++ b/Demos/Device/ClassDriver/MIDI/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/MassStorage/makefile b/Demos/Device/ClassDriver/MassStorage/makefile
index 18566cae7..34d76a977 100644
--- a/Demos/Device/ClassDriver/MassStorage/makefile
+++ b/Demos/Device/ClassDriver/MassStorage/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -328,7 +321,7 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@ -466,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -509,14 +502,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -533,16 +529,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -717,8 +734,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/Mouse/makefile b/Demos/Device/ClassDriver/Mouse/makefile
index 5c7bf9400..3664e8c4d 100644
--- a/Demos/Device/ClassDriver/Mouse/makefile
+++ b/Demos/Device/ClassDriver/Mouse/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -466,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -509,14 +502,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -533,16 +529,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -717,8 +734,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/makefile b/Demos/Device/ClassDriver/RNDISEthernet/makefile
index 2c0dfb824..84a39327a 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/makefile
+++ b/Demos/Device/ClassDriver/RNDISEthernet/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -476,7 +469,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -519,14 +512,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -543,16 +539,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -727,8 +744,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/ClassDriver/USBtoSerial/makefile b/Demos/Device/ClassDriver/USBtoSerial/makefile
index d61cd37c1..ea45d066f 100644
--- a/Demos/Device/ClassDriver/USBtoSerial/makefile
+++ b/Demos/Device/ClassDriver/USBtoSerial/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -508,14 +501,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/Incomplete/Sideshow/makefile b/Demos/Device/Incomplete/Sideshow/makefile
index 2b0a7d71d..6ceafa1a7 100644
--- a/Demos/Device/Incomplete/Sideshow/makefile
+++ b/Demos/Device/Incomplete/Sideshow/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -469,7 +462,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -512,14 +505,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -536,16 +532,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -720,8 +737,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/AudioInput/makefile b/Demos/Device/LowLevel/AudioInput/makefile
index ee6e12c74..06703c0e1 100644
--- a/Demos/Device/LowLevel/AudioInput/makefile
+++ b/Demos/Device/LowLevel/AudioInput/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/AudioOutput/makefile b/Demos/Device/LowLevel/AudioOutput/makefile
index 492c15285..611472058 100644
--- a/Demos/Device/LowLevel/AudioOutput/makefile
+++ b/Demos/Device/LowLevel/AudioOutput/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/CDC/makefile b/Demos/Device/LowLevel/CDC/makefile
index c2a1f22bf..813258249 100644
--- a/Demos/Device/LowLevel/CDC/makefile
+++ b/Demos/Device/LowLevel/CDC/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/DualCDC/makefile b/Demos/Device/LowLevel/DualCDC/makefile
index f3d210272..87c4ca8a7 100644
--- a/Demos/Device/LowLevel/DualCDC/makefile
+++ b/Demos/Device/LowLevel/DualCDC/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/GenericHID/makefile b/Demos/Device/LowLevel/GenericHID/makefile
index 554d74da0..6f5a6e416 100644
--- a/Demos/Device/LowLevel/GenericHID/makefile
+++ b/Demos/Device/LowLevel/GenericHID/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/Joystick/makefile b/Demos/Device/LowLevel/Joystick/makefile
index 83d1019f0..b23c15b13 100644
--- a/Demos/Device/LowLevel/Joystick/makefile
+++ b/Demos/Device/LowLevel/Joystick/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/Keyboard/makefile b/Demos/Device/LowLevel/Keyboard/makefile
index 00d27ec54..0561df251 100644
--- a/Demos/Device/LowLevel/Keyboard/makefile
+++ b/Demos/Device/LowLevel/Keyboard/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/KeyboardMouse/makefile b/Demos/Device/LowLevel/KeyboardMouse/makefile
index 8fc5be507..e7aae35ce 100644
--- a/Demos/Device/LowLevel/KeyboardMouse/makefile
+++ b/Demos/Device/LowLevel/KeyboardMouse/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/MIDI/makefile b/Demos/Device/LowLevel/MIDI/makefile
index e45df19db..66843cd3b 100644
--- a/Demos/Device/LowLevel/MIDI/makefile
+++ b/Demos/Device/LowLevel/MIDI/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/MassStorage/makefile b/Demos/Device/LowLevel/MassStorage/makefile
index 66cc0744a..954324f17 100644
--- a/Demos/Device/LowLevel/MassStorage/makefile
+++ b/Demos/Device/LowLevel/MassStorage/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -327,7 +320,7 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -508,14 +501,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -532,16 +528,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/Mouse/makefile b/Demos/Device/LowLevel/Mouse/makefile
index 04997b9ae..3eec080fd 100644
--- a/Demos/Device/LowLevel/Mouse/makefile
+++ b/Demos/Device/LowLevel/Mouse/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/RNDISEthernet/makefile b/Demos/Device/LowLevel/RNDISEthernet/makefile
index d7a94f6e4..c6d8306c9 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/makefile
+++ b/Demos/Device/LowLevel/RNDISEthernet/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -476,7 +469,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -519,14 +512,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -543,16 +539,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -727,8 +744,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Device/LowLevel/USBtoSerial/makefile b/Demos/Device/LowLevel/USBtoSerial/makefile
index 153fca587..324367ae1 100644
--- a/Demos/Device/LowLevel/USBtoSerial/makefile
+++ b/Demos/Device/LowLevel/USBtoSerial/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/ClassDriver/CDCHost/makefile b/Demos/Host/ClassDriver/CDCHost/makefile
index d9c967bbf..db62b2ec0 100644
--- a/Demos/Host/ClassDriver/CDCHost/makefile
+++ b/Demos/Host/ClassDriver/CDCHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -505,14 +498,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/ClassDriver/MassStorageHost/makefile b/Demos/Host/ClassDriver/MassStorageHost/makefile
index 9e4d120b0..42bbff874 100644
--- a/Demos/Host/ClassDriver/MassStorageHost/makefile
+++ b/Demos/Host/ClassDriver/MassStorageHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/ClassDriver/MouseHost/makefile b/Demos/Host/ClassDriver/MouseHost/makefile
index 9134c3ab8..03bcf30f5 100644
--- a/Demos/Host/ClassDriver/MouseHost/makefile
+++ b/Demos/Host/ClassDriver/MouseHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/ClassDriver/StillImageHost/makefile b/Demos/Host/ClassDriver/StillImageHost/makefile
index f36d9f278..626d6e685 100644
--- a/Demos/Host/ClassDriver/StillImageHost/makefile
+++ b/Demos/Host/ClassDriver/StillImageHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -461,7 +454,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -504,14 +497,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -528,16 +524,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -712,8 +729,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/Incomplete/BluetoothHost/makefile b/Demos/Host/Incomplete/BluetoothHost/makefile
index e16fd4022..019554293 100644
--- a/Demos/Host/Incomplete/BluetoothHost/makefile
+++ b/Demos/Host/Incomplete/BluetoothHost/makefile
@@ -466,7 +466,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -509,14 +509,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -533,16 +536,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -717,8 +741,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/CDCHost/makefile b/Demos/Host/LowLevel/CDCHost/makefile
index c36fdc588..282915fa9 100644
--- a/Demos/Host/LowLevel/CDCHost/makefile
+++ b/Demos/Host/LowLevel/CDCHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -505,14 +498,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/GenericHIDHost/makefile b/Demos/Host/LowLevel/GenericHIDHost/makefile
index e670801ac..bc474604d 100644
--- a/Demos/Host/LowLevel/GenericHIDHost/makefile
+++ b/Demos/Host/LowLevel/GenericHIDHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/KeyboardHost/makefile b/Demos/Host/LowLevel/KeyboardHost/makefile
index 8825a6ce7..072ca2506 100644
--- a/Demos/Host/LowLevel/KeyboardHost/makefile
+++ b/Demos/Host/LowLevel/KeyboardHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -505,14 +498,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile
index aab3e7a5d..1ec8d4754 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/MassStorageHost/makefile b/Demos/Host/LowLevel/MassStorageHost/makefile
index c3f7cbcbd..96242749e 100644
--- a/Demos/Host/LowLevel/MassStorageHost/makefile
+++ b/Demos/Host/LowLevel/MassStorageHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/MouseHost/makefile b/Demos/Host/LowLevel/MouseHost/makefile
index c0dca6eb0..1f9551630 100644
--- a/Demos/Host/LowLevel/MouseHost/makefile
+++ b/Demos/Host/LowLevel/MouseHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -505,14 +498,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/makefile b/Demos/Host/LowLevel/MouseHostWithParser/makefile
index 52dc00cdc..241563f67 100644
--- a/Demos/Host/LowLevel/MouseHostWithParser/makefile
+++ b/Demos/Host/LowLevel/MouseHostWithParser/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -507,14 +500,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -531,16 +527,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/PrinterHost/makefile b/Demos/Host/LowLevel/PrinterHost/makefile
index 5f25db941..8e28bdaf1 100644
--- a/Demos/Host/LowLevel/PrinterHost/makefile
+++ b/Demos/Host/LowLevel/PrinterHost/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/Host/LowLevel/StillImageHost/makefile b/Demos/Host/LowLevel/StillImageHost/makefile
index 6f80dc153..583f7cfc8 100644
--- a/Demos/Host/LowLevel/StillImageHost/makefile
+++ b/Demos/Host/LowLevel/StillImageHost/makefile
@@ -58,6 +58,7 @@
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------
+
# MCU name
MCU = at90usb1287
@@ -70,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -462,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -505,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -529,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -713,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Demos/OTG/TestApp/makefile b/Demos/OTG/TestApp/makefile
index 14ebf4a50..2935bafb5 100644
--- a/Demos/OTG/TestApp/makefile
+++ b/Demos/OTG/TestApp/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -277,8 +270,8 @@ PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
# If this is left blank, then it will use the Standard printf version.
-#PRINTF_LIB =
-PRINTF_LIB = $(PRINTF_LIB_MIN)
+PRINTF_LIB =
+#PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
@@ -324,7 +317,7 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -505,14 +498,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -529,16 +525,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index db91efe7b..ea31537dc 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -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 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
+ * - 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>
* - 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 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)
+ * - 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
diff --git a/LUFA/ManPages/FutureChanges.txt b/LUFA/ManPages/FutureChanges.txt
index fe6523d66..23d3ff883 100644
--- a/LUFA/ManPages/FutureChanges.txt
+++ b/LUFA/ManPages/FutureChanges.txt
@@ -13,9 +13,6 @@
*
* <b>Targeted for This Release:</b>
* - 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>
* - Add hub support to match Atmel's stack
diff --git a/LUFA/makefile b/LUFA/makefile
index 64d0edef7..147aaaacf 100644
--- a/LUFA/makefile
+++ b/LUFA/makefile
@@ -33,10 +33,18 @@ LUFA_SRC_FILES = ./Drivers/USB/LowLevel/DevChapter9.c \
./Drivers/Peripheral/Serial.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:
rm -f $(LUFA_SRC_FILES:%.c=%.o)
+ rm -f LUFA_Events.lst
clean_list:
diff --git a/Projects/AVRISP/makefile b/Projects/AVRISP/makefile
index 0726f86b6..35e1e4244 100644
--- a/Projects/AVRISP/makefile
+++ b/Projects/AVRISP/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -134,7 +127,7 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c \
- Descriptors.c \
+ Descriptors.c \
Lib/V2Protocol.c \
Lib/V2ProtocolParams.c \
Lib/V2ProtocolTarget.c \
@@ -470,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -513,14 +506,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -537,16 +533,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -721,8 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Projects/Benito/makefile b/Projects/Benito/makefile
index d598122e4..5a1e76378 100644
--- a/Projects/Benito/makefile
+++ b/Projects/Benito/makefile
@@ -71,28 +71,21 @@ BOARD = USER
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -470,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -513,14 +506,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -537,16 +533,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -721,8 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Projects/Magstripe/makefile b/Projects/Magstripe/makefile
index 95d6d9989..f672660b2 100644
--- a/Projects/Magstripe/makefile
+++ b/Projects/Magstripe/makefile
@@ -71,28 +71,21 @@ BOARD = USER
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 16000000
# Input clock frequency.
# 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
# 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'
@@ -259,6 +252,7 @@ CPPFLAGS += -fshort-enums
CPPFLAGS += -fno-exceptions
CPPFLAGS += -Wall
CFLAGS += -Wundef
+#CPPFLAGS += -mshort-calls
#CPPFLAGS += -fno-unit-at-a-time
#CPPFLAGS += -Wstrict-prototypes
#CPPFLAGS += -Wunreachable-code
@@ -335,7 +329,7 @@ EXTMEMOPTS =
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
-LDFLAGS += -Wl,--relax
+LDFLAGS += -Wl,--relax
LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@ -473,7 +467,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -516,14 +510,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -540,16 +537,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -724,8 +742,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee \ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file
diff --git a/Projects/MissileLauncher/makefile b/Projects/MissileLauncher/makefile
index 784989359..a32030890 100644
--- a/Projects/MissileLauncher/makefile
+++ b/Projects/MissileLauncher/makefile
@@ -71,28 +71,21 @@ BOARD = USBKEY
# Processor frequency.
# 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
# automatically to create a 32-bit value in your source code.
-# Typical values are:
-# F_CPU = 1000000
-# F_CPU = 1843200
-# F_CPU = 2000000
-# F_CPU = 3686400
-# F_CPU = 4000000
-# F_CPU = 7372800
-# F_CPU = 8000000
-# F_CPU = 11059200
-# F_CPU = 14745600
-# F_CPU = 16000000
-# F_CPU = 18432000
-# F_CPU = 20000000
+#
+# This will be an integer division of F_CLOCK below, as it is sourced by
+# F_CLOCK after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
F_CPU = 8000000
# Input clock frequency.
# 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
# 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'
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# 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.
build: elf hex eep lss sym
@@ -506,14 +499,17 @@ sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -530,16 +526,37 @@ showtarget:
@echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(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:
# 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=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee
+.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+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 \ No newline at end of file