aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver
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 /Demos/Device/ClassDriver
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.
Diffstat (limited to 'Demos/Device/ClassDriver')
-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
13 files changed, 612 insertions, 392 deletions
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