diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-06 05:58:40 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-09-06 05:58:40 +0000 |
commit | 0486f12e3eab71e75273b774bb13eeb5937c544d (patch) | |
tree | d1d5db9c50805e92aa8c55958e2c833ca500bc65 /Demos/Host/Incomplete | |
parent | f6700c0ea58f61e4413dfe416a526f6e9eb0fb73 (diff) | |
download | lufa-0486f12e3eab71e75273b774bb13eeb5937c544d.tar.gz lufa-0486f12e3eab71e75273b774bb13eeb5937c544d.tar.bz2 lufa-0486f12e3eab71e75273b774bb13eeb5937c544d.zip |
Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names are used in a project.
Re-add in flip, flip-ee, dfu and dfu-ee targets to project makefiles (thanks to Opendous Inc.)
Fix allowable F_CPU values comment in project makefiles.
Diffstat (limited to 'Demos/Host/Incomplete')
-rw-r--r-- | Demos/Host/Incomplete/BluetoothHost/makefile | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/makefile b/Demos/Host/Incomplete/BluetoothHost/makefile index e16fd4022..019554293 100644 --- a/Demos/Host/Incomplete/BluetoothHost/makefile +++ b/Demos/Host/Incomplete/BluetoothHost/makefile @@ -466,7 +466,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) # Default target.
-all: begin gccversion sizebefore build showeventhooks showliboptions showtarget sizeafter end
+all: begin gccversion sizebefore build checkinvalidevents showliboptions showtarget sizeafter end
# Change the build target to build a HEX file or a library.
build: elf hex eep lss sym
@@ -509,14 +509,17 @@ sizeafter: @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
-showeventhooks: build
- @echo
- @echo -------- Unhooked LUFA Events --------
- @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
- cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
- echo "(None)"
- @echo --------------------------------------
+$(LUFA_PATH)/LUFA/LUFA_Events.lst:
+ @make -C $(LUFA_PATH)/LUFA/ LUFA_Events.lst
+checkinvalidevents: $(LUFA_PATH)/LUFA/LUFA_Events.lst
+ @echo
+ @echo Checking for invalid events...
+ @$(shell) avr-nm $(TARGET).elf | sed -n -e 's/^.*EVENT_/EVENT_/p' | \
+ grep -F -v --file=$(LUFA_PATH)/LUFA/LUFA_Events.lst > InvalidEvents.tmp || true
+ @sed -n -e 's/^/ WARNING - INVALID EVENT NAME: /p' InvalidEvents.tmp
+ @if test -s InvalidEvents.tmp; then exit 1; fi
+
showliboptions:
@echo
@echo ---- Compile Time Library Options ----
@@ -533,16 +536,37 @@ showtarget: @echo Clock: $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
@echo --------------------------------------
+
# Display compiler version information.
gccversion :
@$(CC) --version
-
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+flip: $(TARGET).hex
+ batchisp -hardware usb -device $(MCU) -operation erase f
+ batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+
+dfu: $(TARGET).hex
+ dfu-programmer $(MCU) erase
+ dfu-programmer $(MCU) flash --debug 1 $(TARGET).hex
+ dfu-programmer $(MCU) reset
+
+flip-ee: $(TARGET).hex $(TARGET).eep
+ $(COPY) $(TARGET).eep $(TARGET)eep.hex
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
+ batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
+ batchisp -hardware usb -device $(MCU) -operation start reset 0
+ $(REMOVE) $(TARGET)eep.hex
+
+dfu-ee: $(TARGET).hex $(TARGET).eep
+ dfu-programmer $(MCU) flash-eeprom --debug 1 --suppress-bootloader-mem $(TARGET).eep
+ dfu-programmer $(MCU) reset
+
# Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set
@@ -697,9 +721,9 @@ clean_list: $(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i)
+ $(REMOVE) InvalidEvents.tmp
$(REMOVEDIR) .dep
-
doxygen:
@echo Generating Project Documentation...
@doxygen Doxygen.conf
@@ -717,8 +741,8 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets.
-.PHONY : all showeventhooks showliboptions showtarget \
-begin finish end sizebefore sizeafter gccversion build \
-elf hex eep lss sym coff extcoff program clean debug \
-clean_list clean_binary gdb-config doxygen dfu flip \
-flip-ee dfu-ee
\ No newline at end of file +.PHONY : all checkinvalidevents showliboptions \
+showtarget begin finish end sizebefore sizeafter \
+gccversion build elf hex eep lss sym coff extcoff \
+program dfu flip flip-ee dfu-ee clean debug \
+clean_list clean_binary gdb-config doxygen
\ No newline at end of file |