Add in new invalid event hook check targets to project makefiles to produce compilati...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 6 Sep 2009 05:58:40 +0000 (05:58 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 6 Sep 2009 05:58:40 +0000 (05:58 +0000)
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.

52 files changed:
Bootloaders/CDC/makefile
Bootloaders/DFU/makefile
Bootloaders/TeensyHID/makefile
Demos/Device/ClassDriver/AudioInput/makefile
Demos/Device/ClassDriver/AudioOutput/makefile
Demos/Device/ClassDriver/CDC/makefile
Demos/Device/ClassDriver/DualCDC/makefile
Demos/Device/ClassDriver/GenericHID/makefile
Demos/Device/ClassDriver/Joystick/makefile
Demos/Device/ClassDriver/Keyboard/makefile
Demos/Device/ClassDriver/KeyboardMouse/makefile
Demos/Device/ClassDriver/MIDI/makefile
Demos/Device/ClassDriver/MassStorage/makefile
Demos/Device/ClassDriver/Mouse/makefile
Demos/Device/ClassDriver/RNDISEthernet/makefile
Demos/Device/ClassDriver/USBtoSerial/makefile
Demos/Device/Incomplete/Sideshow/makefile
Demos/Device/LowLevel/AudioInput/makefile
Demos/Device/LowLevel/AudioOutput/makefile
Demos/Device/LowLevel/CDC/makefile
Demos/Device/LowLevel/DualCDC/makefile
Demos/Device/LowLevel/GenericHID/makefile
Demos/Device/LowLevel/Joystick/makefile
Demos/Device/LowLevel/Keyboard/makefile
Demos/Device/LowLevel/KeyboardMouse/makefile
Demos/Device/LowLevel/MIDI/makefile
Demos/Device/LowLevel/MassStorage/makefile
Demos/Device/LowLevel/Mouse/makefile
Demos/Device/LowLevel/RNDISEthernet/makefile
Demos/Device/LowLevel/USBtoSerial/makefile
Demos/Host/ClassDriver/CDCHost/makefile
Demos/Host/ClassDriver/MassStorageHost/makefile
Demos/Host/ClassDriver/MouseHost/makefile
Demos/Host/ClassDriver/StillImageHost/makefile
Demos/Host/Incomplete/BluetoothHost/makefile
Demos/Host/LowLevel/CDCHost/makefile
Demos/Host/LowLevel/GenericHIDHost/makefile
Demos/Host/LowLevel/KeyboardHost/makefile
Demos/Host/LowLevel/KeyboardHostWithParser/makefile
Demos/Host/LowLevel/MassStorageHost/makefile
Demos/Host/LowLevel/MouseHost/makefile
Demos/Host/LowLevel/MouseHostWithParser/makefile
Demos/Host/LowLevel/PrinterHost/makefile
Demos/Host/LowLevel/StillImageHost/makefile
Demos/OTG/TestApp/makefile
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/FutureChanges.txt
LUFA/makefile
Projects/AVRISP/makefile
Projects/Benito/makefile
Projects/Magstripe/makefile
Projects/MissileLauncher/makefile

index 3c79cb6..87cc5c7 100644 (file)
 # make program = Download the hex file to the device, using avrdude.\r
 #                Please customize the avrdude settings below first!\r
 #\r
+# make dfu = Download the hex file to the device, using dfu-programmer (must\r
+#            have dfu-programmer installed).\r
+#\r
+# make flip = Download the hex file to the device, using Atmel FLIP (must\r
+#             have Atmel FLIP installed).\r
+#\r
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer\r
+#               (must have dfu-programmer installed).\r
+#\r
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP\r
+#                (must have Atmel FLIP installed).\r
+#\r
 # make doxygen = Generate DoxyGen documentation for the project (must have\r
 #                DoxyGen installed)\r
 #\r
@@ -59,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -319,9 +324,9 @@ EXTMEMOPTS =
 #    -Map:      create map file\r
 #    --cref:    add cross reference to  map file\r
 LDFLAGS = -Wl,-Map=$(TARGET).map,--cref\r
-LDFLAGS += -Wl,--relax\r
-LDFLAGS += -Wl,--gc-sections\r
 LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)\r
+LDFLAGS += -Wl,--relax \r
+LDFLAGS += -Wl,--gc-sections\r
 LDFLAGS += $(EXTMEMOPTS)\r
 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
 LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)\r
@@ -458,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -501,14 +506,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -525,16 +533,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -689,9 +718,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -709,7 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
 clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 2f9444b..622290f 100644 (file)
 # make program = Download the hex file to the device, using avrdude.\r
 #                Please customize the avrdude settings below first!\r
 #\r
+# make dfu = Download the hex file to the device, using dfu-programmer (must\r
+#            have dfu-programmer installed).\r
+#\r
+# make flip = Download the hex file to the device, using Atmel FLIP (must\r
+#             have Atmel FLIP installed).\r
+#\r
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer\r
+#               (must have dfu-programmer installed).\r
+#\r
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP\r
+#                (must have Atmel FLIP installed).\r
+#\r
 # make doxygen = Generate DoxyGen documentation for the project (must have\r
 #                DoxyGen installed)\r
 #\r
@@ -59,28 +71,21 @@ BOARD = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -321,9 +326,9 @@ EXTMEMOPTS =
 #    -Map:      create map file\r
 #    --cref:    add cross reference to  map file\r
 LDFLAGS = -Wl,-Map=$(TARGET).map,--cref\r
-LDFLAGS += -Wl,--relax\r
-LDFLAGS += -Wl,--gc-sections\r
 LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)\r
+LDFLAGS += -Wl,--relax \r
+LDFLAGS += -Wl,--gc-sections\r
 LDFLAGS += $(EXTMEMOPTS)\r
 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
 LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)\r
@@ -355,7 +360,7 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
 \r
 # Uncomment the following if you do /not/ wish a verification to be\r
 # performed after programming the device.\r
-AVRDUDE_NO_VERIFY = -V\r
+#AVRDUDE_NO_VERIFY = -V\r
 \r
 # Increase verbosity level.  Please use this when submitting bug\r
 # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> \r
@@ -460,7 +465,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -503,14 +508,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -527,16 +535,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -691,9 +720,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -711,7 +740,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
 clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index e7e14e7..15d1d9d 100644 (file)
 # make program = Download the hex file to the device, using avrdude.\r
 #                Please customize the avrdude settings below first!\r
 #\r
+# make dfu = Download the hex file to the device, using dfu-programmer (must\r
+#            have dfu-programmer installed).\r
+#\r
+# make flip = Download the hex file to the device, using Atmel FLIP (must\r
+#             have Atmel FLIP installed).\r
+#\r
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer\r
+#               (must have dfu-programmer installed).\r
+#\r
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP\r
+#                (must have Atmel FLIP installed).\r
+#\r
 # make doxygen = Generate DoxyGen documentation for the project (must have\r
 #                DoxyGen installed)\r
 #\r
@@ -59,28 +71,21 @@ BOARD  =
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 16000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -320,9 +325,9 @@ EXTMEMOPTS =
 #    -Map:      create map file\r
 #    --cref:    add cross reference to  map file\r
 LDFLAGS = -Wl,-Map=$(TARGET).map,--cref\r
+LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)\r
 LDFLAGS += -Wl,--relax \r
 LDFLAGS += -Wl,--gc-sections\r
-LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)\r
 LDFLAGS += $(EXTMEMOPTS)\r
 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
 LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)\r
@@ -459,7 +464,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -502,14 +507,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -526,16 +534,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -690,9 +719,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -710,7 +739,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
 clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index ad884a9..d68fb10 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 98ad109..9940103 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -192,7 +185,6 @@ CSTANDARD = -std=gnu99
 \r
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)\r
-CDEFS += -DAUDIO_OUT_STEREO\r
 \r
 \r
 # Place -D or -U options here for ASM sources\r
@@ -465,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -508,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -532,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -696,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -716,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index f3b34c2..996ec41 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index cdacd2d..0f2f415 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 17253ca..bf5e411 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -508,14 +501,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -532,16 +528,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -696,9 +713,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 8b447e5..10051d7 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -508,14 +501,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -532,16 +528,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -696,9 +713,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 45e9ce4..d9e805a 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -508,14 +501,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -532,16 +528,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -696,9 +713,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 31393dd..a02e34d 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -508,14 +501,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -532,16 +528,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -696,9 +713,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index b474e5c..dd150d6 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 18566ca..34d76a9 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -328,7 +321,7 @@ EXTMEMOPTS =
 #    -Map:      create map file\r
 #    --cref:    add cross reference to  map file\r
 LDFLAGS = -Wl,-Map=$(TARGET).map,--cref\r
-LDFLAGS += -Wl,--relax\r
+LDFLAGS += -Wl,--relax \r
 LDFLAGS += -Wl,--gc-sections\r
 LDFLAGS += $(EXTMEMOPTS)\r
 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
@@ -466,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -509,14 +502,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -533,16 +529,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -697,9 +714,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -717,8 +734,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 5c7bf94..3664e8c 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -466,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -509,14 +502,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -533,16 +529,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -697,9 +714,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -717,8 +734,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 2c0dfb8..84a3932 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -476,7 +469,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -519,14 +512,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -543,16 +539,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -707,9 +724,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -727,8 +744,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index d61cd37..ea45d06 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -508,14 +501,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -532,16 +528,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -696,9 +713,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 2b0a7d7..6ceafa1 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -469,7 +462,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -512,14 +505,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -536,16 +532,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -700,9 +717,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -720,8 +737,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index ee6e12c..06703c0 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 492c152..6114720 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index c2a1f22..8132582 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index f3d2102..87c4ca8 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 554d74d..6f5a6e4 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 83d1019..b23c15b 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 00d27ec..0561df2 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 8fc5be5..e7aae35 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index e45df19..66843cd 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 66cc074..954324f 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -327,7 +320,7 @@ EXTMEMOPTS =
 #    -Map:      create map file\r
 #    --cref:    add cross reference to  map file\r
 LDFLAGS = -Wl,-Map=$(TARGET).map,--cref\r
-LDFLAGS += -Wl,--relax\r
+LDFLAGS += -Wl,--relax \r
 LDFLAGS += -Wl,--gc-sections\r
 LDFLAGS += $(EXTMEMOPTS)\r
 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
@@ -465,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -508,14 +501,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -532,16 +528,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -696,9 +713,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -716,8 +733,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 04997b9..3eec080 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index d7a94f6..c6d8306 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -476,7 +469,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -519,14 +512,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -543,16 +539,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -707,9 +724,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -727,8 +744,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 153fca5..324367a 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index d9c967b..db62b2e 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -505,14 +498,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -529,16 +525,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -693,9 +710,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 9e4d120..42bbff8 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 9134c3a..03bcf30 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index f36d9f2..626d6e6 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -461,7 +454,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -504,14 +497,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -528,16 +524,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -692,9 +709,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -712,8 +729,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index e16fd40..0195542 100644 (file)
@@ -466,7 +466,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -509,14 +509,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -533,16 +536,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -697,9 +721,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -717,8 +741,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index c36fdc5..282915f 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -505,14 +498,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -529,16 +525,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -693,9 +710,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index e670801..bc47460 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 8825a6c..072ca25 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -505,14 +498,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -529,16 +525,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -693,9 +710,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index aab3e7a..1ec8d47 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index c3f7cbc..9624274 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index c0dca6e..1f95516 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -505,14 +498,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -529,16 +525,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -693,9 +710,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 52dc00c..241563f 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -464,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -507,14 +500,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -531,16 +527,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -695,9 +712,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -715,8 +732,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 5f25db9..8e28bda 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 6f80dc1..583f7cf 100644 (file)
@@ -58,6 +58,7 @@
 # To rebuild project do "make clean" then "make all".\r
 #----------------------------------------------------------------------------\r
 \r
+\r
 # MCU name\r
 MCU = at90usb1287\r
 \r
@@ -70,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -462,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -505,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -529,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -693,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -713,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 14ebf4a..2935baf 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -277,8 +270,8 @@ PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
 PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt\r
 \r
 # If this is left blank, then it will use the Standard printf version.\r
-#PRINTF_LIB = \r
-PRINTF_LIB = $(PRINTF_LIB_MIN)\r
+PRINTF_LIB = \r
+#PRINTF_LIB = $(PRINTF_LIB_MIN)\r
 #PRINTF_LIB = $(PRINTF_LIB_FLOAT)\r
 \r
 \r
@@ -324,7 +317,7 @@ EXTMEMOPTS =
 #    -Map:      create map file\r
 #    --cref:    add cross reference to  map file\r
 LDFLAGS = -Wl,-Map=$(TARGET).map,--cref\r
-LDFLAGS += -Wl,--relax\r
+LDFLAGS += -Wl,--relax \r
 LDFLAGS += -Wl,--gc-sections\r
 LDFLAGS += $(EXTMEMOPTS)\r
 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
@@ -462,7 +455,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -505,14 +498,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -529,16 +525,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -693,9 +710,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -713,8 +730,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index db91efe..ea31537 100644 (file)
@@ -37,6 +37,8 @@
   *  - The HID report parser now always processed FEATURE items - HID_ENABLE_FEATURE_PROCESSING token now has no effect\r
   *  - The HID report parser now always ignores constant-data items, HID_INCLUDE_CONSTANT_DATA_ITEMS token now has no effect\r
   *  - The Benito Programmer project now has its own unique VID/PID pair allocated from the Atmel donated LUFA VID/PID pool\r
+  *  - Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names\r
+  *    are used in a project\r
   *\r
   *  <b>Fixed:</b>\r
   *  - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the\r
@@ -56,6 +58,8 @@
   *  - Fixed StillImageHost not correctly freezing and unfreezing data pipes while waiting for a response block header\r
   *  - Fixed error in PrinterHost preventing the full page data from being sent to the attached device\r
   *  - CDC based demos and project now work under 64 bit versions of Windows (thanks to Ronny Hanson, Thomas Bleeker)\r
+  *  - Re-add in flip, flip-ee, dfu and dfu-ee targets to project makefiles (thanks to Opendous Inc.)\r
+  *  - Fix allowable F_CPU values comment in project makefiles\r
   *\r
   *\r
   *  \section Sec_ChangeLog090810 Version 090810\r
index fe6523d..23d3ff8 100644 (file)
@@ -13,9 +13,6 @@
   *\r
   *  <b>Targeted for This Release:</b>\r
   *  - Finish HID and Still Image Host Mode Class Drivers, add demo summaries\r
-  *  - Re-add in flip, flip-ee, dfu and dfu-ee targets to project makefiles\r
-  *  - Add in new invalid event hook check targets to project makefiles\r
-  *  - Fix allowable F_CPU values comment in project makefiles\r
   *\r
   *  <b>Targeted for Future Releases:</b>\r
   *  - Add hub support to match Atmel's stack\r
index 64d0ede..147aaaa 100644 (file)
@@ -33,10 +33,18 @@ LUFA_SRC_FILES =     ./Drivers/USB/LowLevel/DevChapter9.c        \
                      ./Drivers/Peripheral/Serial.c               \\r
                      ./Drivers/Peripheral/SerialStream.c         \\r
 \r
-all:\r
-       \r
+LUFA_Events.lst:\r
+       @echo\r
+       @echo Generating LUFA event name list...\r
+       @$(shell) cat `find ./ -name "*.h"` | egrep "EVENT_[^\(]*\(" | \\r
+                     sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                     cut -d'(' -f1 | sort | uniq > LUFA_Events.lst\r
+                                 \r
+all: LUFA_Events.lst\r
+\r
 clean:\r
        rm -f $(LUFA_SRC_FILES:%.c=%.o)\r
+       rm -f LUFA_Events.lst\r
        \r
 clean_list:\r
 \r
index 0726f86..35e1e42 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -134,7 +127,7 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB
 \r
 # List C source files here. (C dependencies are automatically generated.)\r
 SRC = $(TARGET).c                                                 \\r
-         Descriptors.c                                               \
+         Descriptors.c                                               \\r
       Lib/V2Protocol.c                                            \\r
       Lib/V2ProtocolParams.c                                      \\r
       Lib/V2ProtocolTarget.c                                      \\r
@@ -470,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -513,14 +506,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -537,16 +533,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -701,9 +718,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -721,8 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index d598122..5a1e763 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USER
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -470,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -513,14 +506,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -537,16 +533,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -701,9 +718,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -721,8 +738,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee
\ No newline at end of file
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file
index 95d6d99..f672660 100644 (file)
@@ -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
index 7849893..a320308 100644 (file)
@@ -71,28 +71,21 @@ BOARD  = USBKEY
 \r
 # Processor frequency.\r
 #     This will define a symbol, F_CPU, in all source code files equal to the \r
-#     processor frequency. You can then use this symbol in your source code to \r
+#     processor frequency in Hz. You can then use this symbol in your source code to \r
 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
 #     automatically to create a 32-bit value in your source code.\r
-#     Typical values are:\r
-#         F_CPU =  1000000\r
-#         F_CPU =  1843200\r
-#         F_CPU =  2000000\r
-#         F_CPU =  3686400\r
-#         F_CPU =  4000000\r
-#         F_CPU =  7372800\r
-#         F_CPU =  8000000\r
-#         F_CPU = 11059200\r
-#         F_CPU = 14745600\r
-#         F_CPU = 16000000\r
-#         F_CPU = 18432000\r
-#         F_CPU = 20000000\r
+#\r
+#     This will be an integer division of F_CLOCK below, as it is sourced by\r
+#     F_CLOCK after it has run through any CPU prescalers. Note that this value\r
+#     does not *change* the processor frequency - it should merely be updated to\r
+#     reflect the processor speed set externally so that the code can use accurate\r
+#     software delays.\r
 F_CPU = 8000000\r
 \r
 \r
 # Input clock frequency.\r
 #     This will define a symbol, F_CLOCK, in all source code files equal to the \r
-#     input clock frequency (before any prescaling is performed). This value may\r
+#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
 #     differ from F_CPU if prescaling is used on the latter, and is required as the\r
 #     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
@@ -463,7 +456,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 \r
 \r
 # Default target.\r
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end\r
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end\r
 \r
 # Change the build target to build a HEX file or a library.\r
 build: elf hex eep lss sym\r
@@ -506,14 +499,17 @@ sizeafter:
        @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \\r
        2>/dev/null; echo; fi\r
 \r
-showeventhooks: build\r
-       @echo\r
-       @echo -------- Unhooked LUFA Events --------\r
-       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
-                  cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
-                          echo "(None)"\r
-       @echo --------------------------------------\r
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:\r
+       @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst\r
 \r
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst\r
+       @echo\r
+       @echo Checking for invalid events...\r
+       @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \\r
+                        grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true\r
+       @sed -n -e 's/^/  WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp\r
+       @if test -s InvalidEvents.tmp; then exit 1; fi\r
+       \r
 showliboptions:\r
        @echo\r
        @echo ---- Compile Time Library Options ----\r
@@ -530,16 +526,37 @@ showtarget:
        @echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master\r
        @echo --------------------------------------\r
        \r
+\r
 # Display compiler version information.\r
 gccversion : \r
        @$(CC) --version\r
 \r
 \r
-\r
 # Program the device.  \r
 program: $(TARGET).hex $(TARGET).eep\r
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)\r
 \r
+flip: $(TARGET).hex\r
+       batchisp -hardware usb -device $(MCU) -operation erase f\r
+       batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+\r
+dfu: $(TARGET).hex\r
+       dfu-programmer $(MCU) erase\r
+       dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex\r
+       dfu-programmer $(MCU) reset\r
+\r
+flip-ee: $(TARGET).hex $(TARGET).eep\r
+       $(COPY) $(TARGET).eep $(TARGET)eep.hex\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase\r
+       batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program\r
+       batchisp -hardware usb -device $(MCU) -operation start reset 0\r
+       $(REMOVE) $(TARGET)eep.hex\r
+\r
+dfu-ee: $(TARGET).hex $(TARGET).eep\r
+       dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep\r
+       dfu-programmer $(MCU) reset\r
+\r
 \r
 # Generate avr-gdb config/init file which does the following:\r
 #     define the reset signal, load the target file, connect to target, and set \r
@@ -694,9 +711,9 @@ clean_list:
        $(REMOVE) $(SRC:.c=.s)\r
        $(REMOVE) $(SRC:.c=.d)\r
        $(REMOVE) $(SRC:.c=.i)\r
+       $(REMOVE) InvalidEvents.tmp\r
        $(REMOVEDIR) .dep\r
 \r
-\r
 doxygen:\r
        @echo Generating Project Documentation...\r
        @doxygen Doxygen.conf\r
@@ -714,8 +731,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 \r
 \r
 # Listing of phony targets.\r
-.PHONY : all showeventhooks showliboptions showtarget  \\r
-begin finish end sizebefore sizeafter gccversion build \\r
-elf hex eep lss sym coff extcoff program clean debug   \\r
-clean_list clean_binary gdb-config doxygen dfu flip    \\r
-flip-ee dfu-ee\r
+.PHONY : all checkinvalidevents showliboptions    \\r
+showtarget begin finish end sizebefore sizeafter  \\r
+gccversion build elf hex eep lss sym coff extcoff \\r
+program dfu flip flip-ee dfu-ee clean debug       \\r
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file