Update makefiles to use the latest WinAVR/Atmel toolchain makefile template.
Add new module source variables to the library core makefile, so that module sources can be added to a project's makefile on a per-module rather than per-file basis.
This commit is contained in:
		
							parent
							
								
									42ac34b484
								
							
						
					
					
						commit
						6b5e684c77
					
				
					 116 changed files with 2969 additions and 4241 deletions
				
			
		| 
						 | 
				
			
			@ -71,7 +71,7 @@
 | 
			
		|||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>MICROPHONE_BIASED_TO_HALF_RAIL</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this alters the demo so that the half VCC bias of the microphone input is subtracted.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,25 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
LUFA_OPTS += -D MICROPHONE_BIASED_TO_HALF_RAIL
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/Audio.c          \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +179,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +220,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +246,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +323,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +335,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +415,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +461,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +492,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,23 +501,8 @@ sizebefore:
 | 
			
		|||
sizeafter:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
	
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +592,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +604,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +666,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +686,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +705,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,17 +73,17 @@
 | 
			
		|||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>AUDIO_OUT_STEREO</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this outputs the audio samples in stereo to the timer output pins of the microcontroller.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>AUDIO_OUT_MONO</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this outputs the audio samples in mono to the timer output pin of the microcontroller.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>AUDIO_OUT_PORTC</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this outputs the audio samples in mono to port C of the microcontroller, for connection to an
 | 
			
		||||
 *        external DAC.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,27 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
LUFA_OPTS += -D AUDIO_OUT_STEREO
 | 
			
		||||
#LUFA_OPTS += -D AUDIO_OUT_MONO
 | 
			
		||||
#LUFA_OPTS += -D AUDIO_OUT_PORTC
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/Audio.c          \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,16 +181,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS += -DAUDIO_OUT_STEREO
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +222,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +248,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +325,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +337,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +417,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +463,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +494,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +504,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +594,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +606,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +668,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +688,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +707,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,22 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/CDC.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/CDC.c              \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -184,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,23 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -185,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -218,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -320,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -332,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -414,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -490,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -502,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -607,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -619,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -681,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -703,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -723,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,23 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -185,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -218,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -320,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -332,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -414,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -490,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -502,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -607,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -619,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -681,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -703,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -723,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,23 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -185,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -218,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -320,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -332,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -414,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -490,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -502,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -607,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -619,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -681,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -703,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -723,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,23 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -185,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -218,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -320,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -332,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -414,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -490,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -502,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -607,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -619,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -681,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -703,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -723,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,21 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/MIDI.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -249,14 +249,8 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI
 | 
			
		|||
 */
 | 
			
		||||
static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const bool IsDataRead)
 | 
			
		||||
{
 | 
			
		||||
	uint32_t BlockAddress;
 | 
			
		||||
	uint16_t TotalBlocks;
 | 
			
		||||
	
 | 
			
		||||
	/* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */
 | 
			
		||||
	BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
 | 
			
		||||
 | 
			
		||||
	/* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */
 | 
			
		||||
	TotalBlocks  = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
 | 
			
		||||
	uint32_t BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
 | 
			
		||||
	uint16_t TotalBlocks  = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
 | 
			
		||||
	
 | 
			
		||||
	/* Check if the block address is outside the maximum allowable value for the LUN */
 | 
			
		||||
	if (BlockAddress >= LUN_MEDIA_BLOCKS)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,8 +85,8 @@
 | 
			
		|||
 *   <tr>
 | 
			
		||||
 *    <td>TOTAL_LUNS</td>
 | 
			
		||||
 *    <td>MassStorage.h</td>
 | 
			
		||||
 *    <td>Total number of Logical Units (drives) in the device. The total device capacity is shared equally between each drive
 | 
			
		||||
 *        - this can be set to any positive non-zero amount.</td>
 | 
			
		||||
 *    <td>Total number of Logical Units (drives) in the device. The total device capacity is shared equally between each drive -
 | 
			
		||||
 *        this can be set to any positive non-zero amount.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,33 +115,25 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  Lib/SCSI.c                                                  \
 | 
			
		||||
	  Lib/DataflashManager.c                                      \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/MassStorage.c    \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/MassStorage.c      \
 | 
			
		||||
	  Lib/SCSI.c                                                  \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -187,15 +179,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -220,8 +220,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -245,7 +246,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -322,7 +323,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -334,9 +335,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -416,6 +415,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -461,7 +461,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -492,9 +492,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -504,22 +502,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -609,7 +592,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -621,7 +604,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -683,18 +666,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -705,7 +686,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -725,8 +705,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,8 +85,8 @@
 | 
			
		|||
 *   <tr>
 | 
			
		||||
 *    <td>TOTAL_LUNS</td>
 | 
			
		||||
 *    <td>MassStorage.h</td>
 | 
			
		||||
 *    <td>Total number of Logical Units (drives) in the device. The total device capacity is shared equally between each drive
 | 
			
		||||
 *        - this can be set to any positive non-zero amount.</td>
 | 
			
		||||
 *    <td>Total number of Logical Units (drives) in the device. The total device capacity is shared equally between each drive -
 | 
			
		||||
 *        this can be set to any positive non-zero amount.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,28 +71,21 @@ BOARD  = USBKEY
 | 
			
		|||
 | 
			
		||||
# Processor frequency.
 | 
			
		||||
#     This will define a symbol, F_CPU, in all source code files equal to the 
 | 
			
		||||
#     processor frequency. You can then use this symbol in your source code to 
 | 
			
		||||
#     processor frequency in Hz. You can then use this symbol in your source code to 
 | 
			
		||||
#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
 | 
			
		||||
#     automatically to create a 32-bit value in your source code.
 | 
			
		||||
#     Typical values are:
 | 
			
		||||
#         F_CPU =  1000000
 | 
			
		||||
#         F_CPU =  1843200
 | 
			
		||||
#         F_CPU =  2000000
 | 
			
		||||
#         F_CPU =  3686400
 | 
			
		||||
#         F_CPU =  4000000
 | 
			
		||||
#         F_CPU =  7372800
 | 
			
		||||
#         F_CPU =  8000000
 | 
			
		||||
#         F_CPU = 11059200
 | 
			
		||||
#         F_CPU = 14745600
 | 
			
		||||
#         F_CPU = 16000000
 | 
			
		||||
#         F_CPU = 18432000
 | 
			
		||||
#         F_CPU = 20000000
 | 
			
		||||
#
 | 
			
		||||
#     This will be an integer division of F_CLOCK below, as it is sourced by
 | 
			
		||||
#     F_CLOCK after it has run through any CPU prescalers. Note that this value
 | 
			
		||||
#     does not *change* the processor frequency - it should merely be updated to
 | 
			
		||||
#     reflect the processor speed set externally so that the code can use accurate
 | 
			
		||||
#     software delays.
 | 
			
		||||
F_CPU = 8000000
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Input clock frequency.
 | 
			
		||||
#     This will define a symbol, F_CLOCK, in all source code files equal to the 
 | 
			
		||||
#     input clock frequency (before any prescaling is performed). This value may
 | 
			
		||||
#     input clock frequency (before any prescaling is performed) in Hz. This value may
 | 
			
		||||
#     differ from F_CPU if prescaling is used on the latter, and is required as the
 | 
			
		||||
#     raw input clock is fed directly to the PLL sections of the AVR for high speed
 | 
			
		||||
#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
 | 
			
		||||
| 
						 | 
				
			
			@ -122,36 +115,25 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  Lib/SCSI.c                                                  \
 | 
			
		||||
	  Lib/DataflashManager.c                                      \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/MassStorage.c    \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	  Lib/SCSI.c                                                  \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -197,15 +179,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -230,8 +220,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -255,7 +246,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -332,8 +323,8 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
 | 
			
		||||
| 
						 | 
				
			
			@ -344,9 +335,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -426,6 +415,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -471,7 +461,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 sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -502,9 +492,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -514,40 +502,38 @@ 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 --------------------------------------
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@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 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +592,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +604,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +666,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +686,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +705,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,23 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -185,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -218,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -320,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -332,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -414,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -490,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -502,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -607,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -619,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -681,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -703,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -723,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,37 +85,37 @@
 | 
			
		|||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_ETHERNET</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received Ethernet headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_ARP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received ARP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_IP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received IP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_ICMP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received ICMP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_TCP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received TCP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_UDP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received UDP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_DHCP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received DHCP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,17 +115,29 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_ETHERNET
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_ARP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_IP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_ICMP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_TCP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_UDP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_DHCP
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
      Descriptors.c                                               \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  Lib/Ethernet.c                                              \
 | 
			
		||||
	  Lib/ProtocolDecoders.c                                      \
 | 
			
		||||
	  Lib/ICMP.c                                                  \
 | 
			
		||||
| 
						 | 
				
			
			@ -135,20 +147,10 @@ SRC = $(TARGET).c                                                 \
 | 
			
		|||
	  Lib/ARP.c                                                   \
 | 
			
		||||
	  Lib/IP.c                                                    \
 | 
			
		||||
	  Lib/Webserver.c                                             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/RNDIS.c          \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -194,17 +196,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS += -DNO_DECODE_ETHERNET -DNO_DECODE_ARP -DNO_DECODE_ICMP
 | 
			
		||||
CDEFS += -DNO_DECODE_IP -DNO_DECODE_TCP -DNO_DECODE_UDP -DNO_DECODE_DHCP -DNO_DECODE_DNS
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -229,8 +237,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -254,7 +263,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -331,7 +340,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -343,9 +352,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -425,6 +432,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -470,7 +478,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -501,9 +509,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -513,22 +519,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +609,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -630,7 +621,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -692,18 +683,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -714,7 +703,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -734,8 +722,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,22 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/CDC.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/CDC.c              \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -184,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,7 +115,7 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
| 
						 | 
				
			
			@ -123,24 +123,15 @@ LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		|||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/CDC.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/CDC.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -186,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -219,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -244,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -321,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -333,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -415,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -460,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -491,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -503,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -608,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -620,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -682,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -704,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -724,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,35 +115,29 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  Lib/SideshowCommon.c                                        \
 | 
			
		||||
	  Lib/SideshowCommands.c                                      \
 | 
			
		||||
	  Lib/SideshowApplications.c                                  \
 | 
			
		||||
	  Lib/SideshowCommands.c                                      \
 | 
			
		||||
	  Lib/SideshowCommon.c                                        \
 | 
			
		||||
	  Lib/SideshowContent.c                                       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -185,19 +179,27 @@ EXTRAINCDIRS = $(LUFA_PATH)/
 | 
			
		|||
#     gnu89 = c89 plus GCC extensions
 | 
			
		||||
#     c99   = ISO C99 standard (not yet fully implemented)
 | 
			
		||||
#     gnu99 = c99 plus GCC extensions
 | 
			
		||||
CSTANDARD = -std=c99
 | 
			
		||||
CSTANDARD = -std=gnu99
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -222,8 +224,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -247,7 +250,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -324,7 +327,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -336,9 +339,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -418,6 +419,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -463,7 +465,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -494,9 +496,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -506,22 +506,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -611,7 +596,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -623,7 +608,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -685,18 +670,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -707,7 +690,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -727,8 +709,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,7 +71,7 @@
 | 
			
		|||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>MICROPHONE_BIASED_TO_HALF_RAIL</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this alters the demo so that the half VCC bias of the microphone input is subtracted.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,24 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
LUFA_OPTS += -D MICROPHONE_BIASED_TO_HALF_RAIL
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +178,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +219,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +245,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +322,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +334,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +414,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +460,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +491,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +501,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +591,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +603,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +665,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +685,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +704,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,17 +73,17 @@
 | 
			
		|||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>AUDIO_OUT_STEREO</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this outputs the audio samples in stereo to the timer output pins of the microcontroller.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>AUDIO_OUT_MONO</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this outputs the audio samples in mono to the timer output pin of the microcontroller.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>AUDIO_OUT_PORTC</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, this outputs the audio samples in mono to port C of the microcontroller, for connection to an
 | 
			
		||||
 *        external DAC.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,26 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
LUFA_OPTS += -D AUDIO_OUT_STEREO
 | 
			
		||||
#LUFA_OPTS += -D AUDIO_OUT_MONO
 | 
			
		||||
#LUFA_OPTS += -D AUDIO_OUT_PORTC
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,16 +180,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS += -DAUDIO_OUT_STEREO
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +221,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +247,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +324,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +336,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +416,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +462,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +493,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +503,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +593,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +605,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +667,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +687,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +706,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,23 +499,8 @@ sizebefore:
 | 
			
		|||
sizeafter:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
	
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -252,14 +252,8 @@ static void SCSI_Command_Send_Diagnostic(void)
 | 
			
		|||
 */
 | 
			
		||||
static void SCSI_Command_ReadWrite_10(const bool IsDataRead)
 | 
			
		||||
{
 | 
			
		||||
	uint32_t BlockAddress;
 | 
			
		||||
	uint16_t TotalBlocks;
 | 
			
		||||
	
 | 
			
		||||
	/* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */
 | 
			
		||||
	BlockAddress = SwapEndian_32(*(uint32_t*)&CommandBlock.SCSICommandData[2]);
 | 
			
		||||
 | 
			
		||||
	/* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */
 | 
			
		||||
	TotalBlocks  = SwapEndian_16(*(uint16_t*)&CommandBlock.SCSICommandData[7]);
 | 
			
		||||
	uint32_t BlockAddress = SwapEndian_32(*(uint32_t*)&CommandBlock.SCSICommandData[2]);
 | 
			
		||||
	uint16_t TotalBlocks  = SwapEndian_16(*(uint16_t*)&CommandBlock.SCSICommandData[7]);
 | 
			
		||||
 | 
			
		||||
	/* Check if the block address is outside the maximum allowable value for the LUN */
 | 
			
		||||
	if (BlockAddress >= LUN_MEDIA_BLOCKS)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,31 +115,24 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY 
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  Lib/SCSI.c                                                  \
 | 
			
		||||
	  Lib/DataflashManager.c                                      \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  Lib/SCSI.c                                                  \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -185,15 +178,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -218,8 +219,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +245,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -320,7 +322,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -332,9 +334,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -414,6 +414,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -459,7 +460,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -490,9 +491,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,23 +500,8 @@ sizebefore:
 | 
			
		|||
sizeafter:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
	
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -607,7 +591,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -619,7 +603,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -681,18 +665,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -703,7 +685,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -723,8 +704,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,25 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
 
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +219,8 @@ CFLAGS += -fno-strict-aliasing
 | 
			
		|||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,37 +85,37 @@
 | 
			
		|||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_ETHERNET</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received Ethernet headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_ARP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received ARP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_IP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received IP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_ICMP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received ICMP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_TCP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received TCP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_UDP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received UDP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>NO_DECODE_DHCP</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Makefile LUFA_OPTS</td>
 | 
			
		||||
 *    <td>When defined, received DHCP headers will not be decoded and printed to the device serial port.</td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,19 +115,30 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_ETHERNET
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_ARP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_IP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_ICMP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_TCP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_UDP
 | 
			
		||||
LUFA_OPTS += -D NO_DECODE_DHCP
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
      Descriptors.c                                               \
 | 
			
		||||
      Lib/RNDIS.c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  Lib/Ethernet.c                                              \
 | 
			
		||||
	  Lib/ProtocolDecoders.c                                      \
 | 
			
		||||
	  Lib/ICMP.c                                                  \
 | 
			
		||||
| 
						 | 
				
			
			@ -137,19 +148,10 @@ SRC = $(TARGET).c                                                 \
 | 
			
		|||
	  Lib/ARP.c                                                   \
 | 
			
		||||
	  Lib/IP.c                                                    \
 | 
			
		||||
	  Lib/Webserver.c                                             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  Lib/RNDIS.c                                                 \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -195,16 +197,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS += -DNO_DECODE_ETHERNET -DNO_DECODE_ARP -DNO_DECODE_ICMP -DNO_DECODE_IP -DNO_DECODE_TCP -DNO_DECODE_UDP -DNO_DECODE_DHCP
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -229,8 +238,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -254,7 +264,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -331,7 +341,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -343,9 +353,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -425,6 +433,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -470,7 +479,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -501,9 +510,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -513,22 +520,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +610,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -630,7 +622,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -692,18 +684,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -714,7 +704,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -734,8 +723,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_DEVICE_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_DEVICE_ONLY
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,35 +115,27 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
 | 
			
		||||
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
 | 
			
		||||
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  Descriptors.c                                               \
 | 
			
		||||
	  DeviceFunctions.c                                           \
 | 
			
		||||
	  HostFunctions.c                                             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -188,15 +180,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -221,8 +221,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -246,7 +247,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -323,7 +324,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -335,9 +336,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -417,6 +416,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -462,7 +462,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -493,9 +493,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -505,22 +503,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -610,7 +593,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -622,7 +605,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -684,18 +667,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -706,7 +687,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -726,8 +706,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D HID_HOST_BOOT_PROTOCOL_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/MIDI.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/MIDI.c             \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -215,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -317,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -329,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -411,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -456,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -487,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -616,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -678,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -720,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY -Wextra
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=5000
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/MassStorage.c    \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/MassStorage.c      \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +176,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +217,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +243,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +320,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +332,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +412,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +489,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +499,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +589,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +601,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +663,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +683,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +702,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D HID_HOST_BOOT_PROTOCOL_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c              \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,28 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/Printer.c          \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -181,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -214,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -239,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -316,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -328,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -410,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -455,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -486,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -498,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -603,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -615,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -677,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -699,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -719,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/RNDIS.c          \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/RNDIS.c            \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -215,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -317,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -329,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -411,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -456,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -487,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -616,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -678,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -720,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,28 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/StillImage.c       \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -181,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -214,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -239,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -316,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -328,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -410,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -455,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -486,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -498,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -603,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -615,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -677,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -699,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -719,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/CDC.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/CDC.c              \
 | 
			
		||||
	  
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_USBCLASS)                                        \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
CPPSRC = 
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +175,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -215,8 +216,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +242,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -317,7 +319,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -329,9 +331,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -411,6 +411,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -456,7 +457,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -487,9 +488,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,22 +498,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +588,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -616,7 +600,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -678,18 +662,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +682,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -720,8 +701,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,28 +71,21 @@ BOARD  = USBKEY
 | 
			
		|||
 | 
			
		||||
# Processor frequency.
 | 
			
		||||
#     This will define a symbol, F_CPU, in all source code files equal to the 
 | 
			
		||||
#     processor frequency. You can then use this symbol in your source code to 
 | 
			
		||||
#     processor frequency in Hz. You can then use this symbol in your source code to 
 | 
			
		||||
#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
 | 
			
		||||
#     automatically to create a 32-bit value in your source code.
 | 
			
		||||
#     Typical values are:
 | 
			
		||||
#         F_CPU =  1000000
 | 
			
		||||
#         F_CPU =  1843200
 | 
			
		||||
#         F_CPU =  2000000
 | 
			
		||||
#         F_CPU =  3686400
 | 
			
		||||
#         F_CPU =  4000000
 | 
			
		||||
#         F_CPU =  7372800
 | 
			
		||||
#         F_CPU =  8000000
 | 
			
		||||
#         F_CPU = 11059200
 | 
			
		||||
#         F_CPU = 14745600
 | 
			
		||||
#         F_CPU = 16000000
 | 
			
		||||
#         F_CPU = 18432000
 | 
			
		||||
#         F_CPU = 20000000
 | 
			
		||||
#
 | 
			
		||||
#     This will be an integer division of F_CLOCK below, as it is sourced by
 | 
			
		||||
#     F_CLOCK after it has run through any CPU prescalers. Note that this value
 | 
			
		||||
#     does not *change* the processor frequency - it should merely be updated to
 | 
			
		||||
#     reflect the processor speed set externally so that the code can use accurate
 | 
			
		||||
#     software delays.
 | 
			
		||||
F_CPU = 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'
 | 
			
		||||
| 
						 | 
				
			
			@ -122,12 +115,16 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  BluetoothEvents.c                                           \
 | 
			
		||||
| 
						 | 
				
			
			@ -140,19 +137,9 @@ SRC = $(TARGET).c                                                 \
 | 
			
		|||
	  Lib/SDPServices.c                                           \
 | 
			
		||||
	  Lib/RFCOMM.c                                                \
 | 
			
		||||
	  Lib/RFCOMMControl.c                                         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -198,15 +185,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -231,8 +226,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -256,7 +252,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -333,7 +329,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -345,9 +341,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -427,6 +421,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -472,7 +467,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -503,9 +498,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -515,22 +508,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -620,7 +598,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -632,7 +610,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -694,18 +672,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -716,7 +692,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -736,8 +711,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +176,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +217,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +243,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +320,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +332,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +412,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +489,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +499,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +589,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +601,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +663,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +683,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +702,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  HIDReport.c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -184,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,28 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +176,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -215,8 +217,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +243,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -317,7 +320,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -329,9 +332,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -411,6 +412,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -456,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -487,9 +489,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,22 +499,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +589,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -616,7 +601,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -678,18 +663,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +683,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -720,8 +702,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  HIDReport.c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -184,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,28 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +176,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -215,8 +217,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +243,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -317,7 +320,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -329,9 +332,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -411,6 +412,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -456,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -487,9 +489,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,22 +499,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +589,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -616,7 +601,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -678,18 +663,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +683,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -720,8 +702,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,24 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=5000
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  Lib/MassStoreCommands.c                                     \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -184,15 +178,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +219,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +245,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +322,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +334,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +414,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +460,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +491,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +501,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +591,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +603,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +665,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +685,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +704,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,28 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +176,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -215,8 +217,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +243,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -317,7 +320,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -329,9 +332,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -411,6 +412,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -456,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -487,9 +489,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,22 +499,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +589,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -616,7 +601,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -678,18 +663,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +683,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -720,8 +702,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,30 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  HIDReport.c                                                 \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c        \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -184,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -242,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -319,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -331,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -413,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -458,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -501,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -606,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -618,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -680,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -702,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -722,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  Lib/PrinterCommands.c                                       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  Lib/RNDISCommands.c                                         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,29 +115,23 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
LUFA_OPTS  = -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USB_HOST_ONLY
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  Lib/StillImageCommands.c                                    \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -183,15 +177,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -216,8 +218,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,7 +244,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +321,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -330,9 +333,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -412,6 +413,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -457,7 +459,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -488,9 +490,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -500,22 +500,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -605,7 +590,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -617,7 +602,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -679,18 +664,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -701,7 +684,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -721,8 +703,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,28 +115,22 @@ OBJDIR = .
 | 
			
		|||
LUFA_PATH = ../../../..
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# LUFA library compile-time options
 | 
			
		||||
# LUFA library compile-time options and predefined tokens
 | 
			
		||||
LUFA_OPTS  = -D USB_HOST_ONLY
 | 
			
		||||
LUFA_OPTS += -D NO_STREAM_CALLBACKS
 | 
			
		||||
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Create the LUFA source path variables by including the LUFA root makefile
 | 
			
		||||
include $(LUFA_PATH)/LUFA/makefile
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C source files here. (C dependencies are automatically generated.)
 | 
			
		||||
SRC = $(TARGET).c                                                 \
 | 
			
		||||
	  ConfigDescriptor.c                                          \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/SerialStream.c         \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/Peripheral/Serial.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/DevChapter9.c        \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Device.c             \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Endpoint.c           \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Host.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/HostChapter9.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/LowLevel.c           \
 | 
			
		||||
 	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/Pipe.c               \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/LowLevel/USBInterrupt.c       \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c  \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/Events.c            \
 | 
			
		||||
	  $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c           \
 | 
			
		||||
	  $(LUFA_SRC_USB)                                             \
 | 
			
		||||
	  $(LUFA_SRC_SERIAL)                                          \
 | 
			
		||||
	  $(LUFA_SRC_SERIALSTREAM)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# List C++ source files here. (C dependencies are automatically generated.)
 | 
			
		||||
| 
						 | 
				
			
			@ -182,15 +176,23 @@ CSTANDARD = -std=c99
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CDEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for ASM sources
 | 
			
		||||
ADEFS = -DF_CPU=$(F_CPU)
 | 
			
		||||
 | 
			
		||||
ADEFS  = -DF_CPU=$(F_CPU)
 | 
			
		||||
ADEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
ADEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
ADEFS += $(LUFA_OPTS)
 | 
			
		||||
 | 
			
		||||
# Place -D or -U options here for C++ sources
 | 
			
		||||
CPPDEFS = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS  = -DF_CPU=$(F_CPU)UL
 | 
			
		||||
CPPDEFS += -DF_CLOCK=$(F_CLOCK)UL
 | 
			
		||||
CPPDEFS += -DBOARD=BOARD_$(BOARD)
 | 
			
		||||
CPPDEFS += $(LUFA_OPTS)
 | 
			
		||||
#CPPDEFS += -D__STDC_LIMIT_MACROS
 | 
			
		||||
#CPPDEFS += -D__STDC_CONSTANT_MACROS
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -215,8 +217,9 @@ CFLAGS += -fshort-enums
 | 
			
		|||
CFLAGS += -fno-strict-aliasing
 | 
			
		||||
CFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wstrict-prototypes
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -mshort-calls
 | 
			
		||||
#CFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CFLAGS += -Wundef
 | 
			
		||||
#CFLAGS += -Wunreachable-code
 | 
			
		||||
#CFLAGS += -Wsign-compare
 | 
			
		||||
CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 | 
			
		||||
| 
						 | 
				
			
			@ -240,7 +243,7 @@ CPPFLAGS += -fpack-struct
 | 
			
		|||
CPPFLAGS += -fshort-enums
 | 
			
		||||
CPPFLAGS += -fno-exceptions
 | 
			
		||||
CPPFLAGS += -Wall
 | 
			
		||||
CFLAGS += -Wundef
 | 
			
		||||
CPPFLAGS += -Wundef
 | 
			
		||||
#CPPFLAGS += -mshort-calls
 | 
			
		||||
#CPPFLAGS += -fno-unit-at-a-time
 | 
			
		||||
#CPPFLAGS += -Wstrict-prototypes
 | 
			
		||||
| 
						 | 
				
			
			@ -317,7 +320,7 @@ EXTMEMOPTS =
 | 
			
		|||
#  -Wl,...:     tell GCC to pass this to linker.
 | 
			
		||||
#    -Map:      create map file
 | 
			
		||||
#    --cref:    add cross reference to  map file
 | 
			
		||||
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 | 
			
		||||
LDFLAGS += -Wl,--relax 
 | 
			
		||||
LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
LDFLAGS += $(EXTMEMOPTS)
 | 
			
		||||
| 
						 | 
				
			
			@ -329,9 +332,7 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 | 
			
		|||
 | 
			
		||||
#---------------- Programming Options (avrdude) ----------------
 | 
			
		||||
 | 
			
		||||
# Programming hardware: alf avr910 avrisp bascom bsd 
 | 
			
		||||
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
 | 
			
		||||
#
 | 
			
		||||
# Programming hardware
 | 
			
		||||
# Type: avrdude -c ?
 | 
			
		||||
# to get a full listing.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -411,6 +412,7 @@ REMOVEDIR = rm -rf
 | 
			
		|||
COPY = cp
 | 
			
		||||
WINSHELL = cmd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define Messages
 | 
			
		||||
# English
 | 
			
		||||
MSG_ERRORS_NONE = Errors: none
 | 
			
		||||
| 
						 | 
				
			
			@ -456,7 +458,7 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Default target.
 | 
			
		||||
all: begin gccversion sizebefore build showliboptions showtarget sizeafter end
 | 
			
		||||
all: begin gccversion sizebefore build sizeafter end
 | 
			
		||||
 | 
			
		||||
# Change the build target to build a HEX file or a library.
 | 
			
		||||
build: elf hex eep lss sym
 | 
			
		||||
| 
						 | 
				
			
			@ -487,9 +489,7 @@ end:
 | 
			
		|||
 | 
			
		||||
# Display size of file.
 | 
			
		||||
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 | 
			
		||||
ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
 | 
			
		||||
MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
 | 
			
		||||
FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
 | 
			
		||||
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
 | 
			
		||||
 | 
			
		||||
sizebefore:
 | 
			
		||||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
 | 
			
		||||
| 
						 | 
				
			
			@ -499,22 +499,7 @@ sizeafter:
 | 
			
		|||
	@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
 | 
			
		||||
	2>/dev/null; echo; fi
 | 
			
		||||
 | 
			
		||||
showliboptions:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo ---- Compile Time Library Options ----
 | 
			
		||||
	@for i in $(LUFA_OPTS:-D%=%); do \
 | 
			
		||||
		echo $$i; \
 | 
			
		||||
	done
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
 | 
			
		||||
showtarget:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo --------- Target Information ---------
 | 
			
		||||
	@echo AVR Model: $(MCU)
 | 
			
		||||
	@echo Board:     $(BOARD)
 | 
			
		||||
	@echo Clock:     $(F_CPU)Hz CPU, $(F_CLOCK)Hz Master
 | 
			
		||||
	@echo --------------------------------------
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
# Display compiler version information.
 | 
			
		||||
gccversion : 
 | 
			
		||||
| 
						 | 
				
			
			@ -604,7 +589,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.hex: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_FLASH) $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 | 
			
		||||
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@
 | 
			
		||||
 | 
			
		||||
%.eep: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
| 
						 | 
				
			
			@ -616,7 +601,7 @@ extcoff: $(TARGET).elf
 | 
			
		|||
%.lss: %.elf
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_EXTENDED_LISTING) $@
 | 
			
		||||
	$(OBJDUMP) -h -z -S $< > $@
 | 
			
		||||
	$(OBJDUMP) -h -S -z $< > $@
 | 
			
		||||
 | 
			
		||||
# Create a symbol table from ELF output file.
 | 
			
		||||
%.sym: %.elf
 | 
			
		||||
| 
						 | 
				
			
			@ -678,18 +663,16 @@ $(OBJDIR)/%.o : %.S
 | 
			
		|||
# Create preprocessed source for use in sending a bug report.
 | 
			
		||||
%.i : %.c
 | 
			
		||||
	$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ 
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Target: clean project.
 | 
			
		||||
clean: begin clean_list clean_binary end
 | 
			
		||||
clean: begin clean_list end
 | 
			
		||||
 | 
			
		||||
clean_binary:
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	
 | 
			
		||||
clean_list:
 | 
			
		||||
clean_list :
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo $(MSG_CLEANING)
 | 
			
		||||
	$(REMOVE) $(TARGET).hex
 | 
			
		||||
	$(REMOVE) $(TARGET).eep
 | 
			
		||||
	$(REMOVE) $(TARGET)eep.hex
 | 
			
		||||
	$(REMOVE) $(TARGET).cof
 | 
			
		||||
	$(REMOVE) $(TARGET).elf
 | 
			
		||||
	$(REMOVE) $(TARGET).map
 | 
			
		||||
| 
						 | 
				
			
			@ -700,7 +683,6 @@ clean_list:
 | 
			
		|||
	$(REMOVE) $(SRC:.c=.s)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.d)
 | 
			
		||||
	$(REMOVE) $(SRC:.c=.i)
 | 
			
		||||
	$(REMOVE) InvalidEvents.tmp
 | 
			
		||||
	$(REMOVEDIR) .dep
 | 
			
		||||
 | 
			
		||||
doxygen:
 | 
			
		||||
| 
						 | 
				
			
			@ -720,8 +702,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# Listing of phony targets.
 | 
			
		||||
.PHONY : all 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 \
 | 
			
		||||
clean_doxygen gdb-config doxygen
 | 
			
		||||
.PHONY : all begin finish end sizebefore sizeafter gccversion \
 | 
			
		||||
build elf hex eep lss sym coff extcoff doxygen clean          \
 | 
			
		||||
clean_list clean_doxygen program dfu flip flip-ee dfu-ee      \
 | 
			
		||||
debug gdb-config
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue