From: Dean Camera Date: Sun, 27 May 2012 19:12:07 +0000 (+0000) Subject: Merge in AppConfigHeaders branch to trunk, altering all projects and demos to use... X-Git-Tag: LUFA-120730~6 X-Git-Url: http://git.linex4red.de/pub/USBasp.git/commitdiff_plain/2ff1370221d3650a6bc0523c93c2f0d37508f408?hp=1e42f7bd46fbef1e67f50741e4fe1a5ea3a70869 Merge in AppConfigHeaders branch to trunk, altering all projects and demos to use configuration headers for application and LUFA compile time settings, rather than defines in the project makefiles. --- diff --git a/BuildTests/BoardDriverTest/makefile b/BuildTests/BoardDriverTest/makefile index c1adc67a9..cb1ed62bc 100644 --- a/BuildTests/BoardDriverTest/makefile +++ b/BuildTests/BoardDriverTest/makefile @@ -31,23 +31,23 @@ makeboardlist: testboards: @echo "buildtest:" > BuildMakefile - @while read line; \ - do \ + @while read line; \ + do \ build_cfg=`grep "$$line " BoardDeviceMap.cfg | grep -v "#" | cut -d'=' -f2- | sed 's/ //g'`; \ - \ - build_board=$$line; \ - build_arch=`echo $$build_cfg | cut -d':' -f1`; \ - build_mcu=`echo $$build_cfg | cut -d':' -f2`; \ - \ - if ( test -z "$$build_cfg" ); then \ - echo "No matching information set for board $$build_board"; \ - else \ - echo "Found board configuration for $$build_board - $$build_arch, $$build_mcu"; \ - \ - printf "\t@echo Building dummy project for $$build_board...\n" >> BuildMakefile; \ - printf "\tmake -s -f makefile.%s clean\n" $$build_arch >> BuildMakefile; \ + \ + build_board=$$line; \ + build_arch=`echo $$build_cfg | cut -d':' -f1`; \ + build_mcu=`echo $$build_cfg | cut -d':' -f2`; \ + \ + if ( test -z "$$build_cfg" ); then \ + echo "No matching information set for board $$build_board"; \ + else \ + echo "Found board configuration for $$build_board - $$build_arch, $$build_mcu"; \ + \ + printf "\t@echo Building dummy project for $$build_board...\n" >> BuildMakefile; \ + printf "\tmake -s -f makefile.%s clean\n" $$build_arch >> BuildMakefile; \ printf "\tmake -s -f makefile.%s MCU=%s BOARD=%s elf\n\n" $$build_arch $$build_mcu $$build_board >> BuildMakefile; \ - fi; \ + fi; \ done < BoardList.txt $(MAKE) -f BuildMakefile buildtest diff --git a/LUFA.pnproj b/LUFA.pnproj index 3cf240cd2..c3a61185b 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1688,4 +1688,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/Maintenance/makefile b/Maintenance/makefile index 19ea32b67..0f126eb77 100644 --- a/Maintenance/makefile +++ b/Maintenance/makefile @@ -17,12 +17,12 @@ all: # Update all Doxygen configuration files to the latest Doxygen version - force Markdown support to be disabled upgrade-doxygen: @echo Upgrading Doxygen.conf files... - @for doxygen_conf in `find $(LUFA_ROOT) -name Doxygen.conf`; do \ - doxygen -u $$doxygen_conf; \ + @for doxygen_conf in `find $(LUFA_ROOT) -name Doxygen.conf`; do \ + doxygen -u $$doxygen_conf; \ sed "s/MARKDOWN_SUPPORT *= *YES/MARKDOWN_SUPPORT = NO/1" $$doxygen_conf > $$doxygen_conf.new; \ - sed "s/DISABLE_INDEX *= *NO/DISABLE_INDEX = YES/1" $$doxygen_conf.new > $$doxygen_conf.new2; \ - mv -u $$doxygen_conf.new2 $$doxygen_conf; \ - rm $$doxygen_conf.new; \ + sed "s/DISABLE_INDEX *= *NO/DISABLE_INDEX = YES/1" $$doxygen_conf.new > $$doxygen_conf.new2; \ + mv -u $$doxygen_conf.new2 $$doxygen_conf; \ + rm $$doxygen_conf.new; \ done; @echo Doxygen configuration update complete. @@ -31,33 +31,39 @@ make-as4-projects: @echo Creating AVR Studio 4 project files for Demos... @for project_makefile in `find $(LUFA_ROOT)/Demos $(LUFA_ROOT)/Projects $(LUFA_ROOT)/Bootloaders -name makefile*`; do \ target_name=`grep "TARGET *=" $$project_makefile | cut -d'=' -f2 | sed 's/ //g'`; \ - target_folder=`dirname $$project_makefile`; \ - as4_date=`date "+%e-%b-%Y %H:%M:%S"`; \ - \ - if ( test -n "$$target_name" ); then \ - echo Creating AS4 project for project $$target_name; \ - \ - source_files="`basename $$project_makefile`<\/OTHERFILE>"; \ - gcc_source_files=""; \ - for c_source_file in `find $$target_folder -name *.c`; do \ - source_files="$$source_files`basename $$c_source_file`<\/SOURCEFILE>"; \ - gcc_source_files="$$gcc_source_files`basename $$c_source_file`<\/Name>"; \ - done; \ - for c_header_file in `find $$target_folder -name *.h`; do \ - source_files="$$source_files`basename $$c_header_file`<\/HEADERFILE>"; \ - gcc_source_files="$$gcc_source_files`basename $$c_header_file`<\/Name>"; \ - done; \ - for assembly_file in `find $$target_folder -name *.S`; do \ - source_files="$$source_files`basename $$assembly_file`<\/OTHERFILE>"; \ - gcc_source_files="$$gcc_source_files`basename $$assembly_file`<\/Name>"; \ - done; \ - \ - sed "s/%TARGET%/$$target_name/g" AS4Template.aps > $$target_folder/$$target_name.aps.new; \ - sed "s/%CREATED%/$$as4_date/g" $$target_folder/$$target_name.aps.new > $$target_folder/$$target_name.aps.new2; \ - sed "s/%FILE_LIST%/$$source_files/g" $$target_folder/$$target_name.aps.new2 > $$target_folder/$$target_name.aps.new3; \ + target_folder=`dirname $$project_makefile`; \ + as4_date=`date "+%e-%b-%Y %H:%M:%S"`; \ + \ + if ( test -n "$$target_name" ); then \ + echo Creating AS4 project for project $$target_name; \ + \ + source_files="`basename $$project_makefile`<\/OTHERFILE>"; \ + gcc_source_files=""; \ + for c_source_file in `find $$target_folder -name *.c`; do \ + source_filename=`basename $$c_source_file`; \ + \ + source_files="$$source_files$$source_filename<\/SOURCEFILE>"; \ + gcc_source_files="$$gcc_source_files$$source_filename<\/Name>"; \ + done; \ + for c_header_file in `find $$target_folder -name *.h`; do \ + source_filename=`basename $$c_header_file`; \ + \ + source_files="$$source_files$$source_filename<\/HEADERFILE>"; \ + gcc_source_files="$$gcc_source_files$$source_filename<\/Name>"; \ + done; \ + for assembly_file in `find $$target_folder -name *.S`; do \ + source_filename=`basename $$assembly_file`; \ + \ + source_files="$$source_files$$source_filename<\/OTHERFILE>"; \ + gcc_source_files="$$gcc_source_files$$source_filename<\/Name>"; \ + done; \ + \ + sed "s/%TARGET%/$$target_name/g" AS4Template.aps > $$target_folder/$$target_name.aps.new; \ + sed "s/%CREATED%/$$as4_date/g" $$target_folder/$$target_name.aps.new > $$target_folder/$$target_name.aps.new2; \ + sed "s/%FILE_LIST%/$$source_files/g" $$target_folder/$$target_name.aps.new2 > $$target_folder/$$target_name.aps.new3; \ sed "s/%GCC_FILE_LIST%/$$gcc_source_files/g" $$target_folder/$$target_name.aps.new3 > $$target_folder/$$target_name.aps.new4; \ - mv $$target_folder/$$target_name.aps.new4 $$target_folder/$$target_name.aps; \ - rm $$target_folder/$$target_name.aps.new $$target_folder/$$target_name.aps.new2 $$target_folder/$$target_name.aps.new3; \ + mv $$target_folder/$$target_name.aps.new4 $$target_folder/$$target_name.aps; \ + rm $$target_folder/$$target_name.aps.new $$target_folder/$$target_name.aps.new2 $$target_folder/$$target_name.aps.new3; \ fi; \ done; @echo AVR Studio 4 project generation complete. @@ -66,12 +72,12 @@ make-as4-projects: check-documentation-placeholders: @echo Checking for release suitability... @if ( grep "XXXXXX" $(LUFA_ROOT)/LUFA/DoxygenPages/*.txt > /dev/null ;); then \ - echo " ERROR: Doxygen documentation has not been updated for release!"; \ - exit 1; \ + echo " ERROR: Doxygen documentation has not been updated for release!"; \ + exit 1; \ fi; - @if ( grep "000000" $(LUFA_ROOT)/LUFA/Version.h > /dev/null ;); then \ - echo " ERROR: Version header has not been updated for release!"; \ - exit 1; \ + @if ( grep "000000" $(LUFA_ROOT)/LUFA/Version.h > /dev/null ;); then \ + echo " ERROR: Version header has not been updated for release!"; \ + exit 1; \ fi; @echo Done. diff --git a/Projects/SerialToLCD/Config/LUFAConfig.h b/Projects/SerialToLCD/Config/LUFAConfig.h deleted file mode 100644 index 4637da529..000000000 --- a/Projects/SerialToLCD/Config/LUFAConfig.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2012. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * \brief LUFA Library Configuration Header File - * - * This header file is used to configure LUFA's compile time options, - * as an alternative to the compile time constants supplied through - * a makefile. - * - * For information on what each token does, refer to the LUFA - * manual section "Summary of Compile Tokens". - */ - -#ifndef _LUFA_CONFIG_H_ -#define _LUFA_CONFIG_H_ - - #if (ARCH == ARCH_AVR8) - - /* Non-USB Related Configuration Tokens: */ -// #define DISABLE_TERMINAL_CODES - - /* USB Class Driver Related Tokens: */ -// #define HID_HOST_BOOT_PROTOCOL_ONLY -// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} -// #define HID_USAGE_STACK_DEPTH {Insert Value Here} -// #define HID_MAX_COLLECTIONS {Insert Value Here} -// #define HID_MAX_REPORTITEMS {Insert Value Here} -// #define HID_MAX_REPORT_IDS {Insert Value Here} -// #define NO_CLASS_DRIVER_AUTOFLUSH - - /* General USB Driver Related Tokens: */ -// #define ORDERED_EP_CONFIG - #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) - #define USB_DEVICE_ONLY -// #define USB_HOST_ONLY -// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} -// #define NO_LIMITED_CONTROLLER_CONNECT -// #define NO_SOF_EVENTS - - /* USB Device Mode Driver Related Tokens: */ -// #define USE_RAM_DESCRIPTORS - #define USE_FLASH_DESCRIPTORS -// #define USE_EEPROM_DESCRIPTORS -// #define NO_INTERNAL_SERIAL - #define FIXED_CONTROL_ENDPOINT_SIZE 8 - #define DEVICE_STATE_AS_GPIOR 0 - #define FIXED_NUM_CONFIGURATIONS 1 -// #define CONTROL_ONLY_DEVICE - #define INTERRUPT_CONTROL_ENDPOINT -// #define NO_DEVICE_REMOTE_WAKEUP -// #define NO_DEVICE_SELF_POWER - - /* USB Host Mode Driver Related Tokens: */ -// #define HOST_STATE_AS_GPIOR 0 -// #define USB_HOST_TIMEOUT_MS {Insert Value Here} -// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} -// #define NO_AUTO_VBUS_MANAGEMENT -// #define INVERTED_VBUS_ENABLE_LINE - - #else - - #error Unsupported architecture for this LUFA configuration file. - - #endif -#endif diff --git a/Projects/SerialToLCD/Descriptors.c b/Projects/SerialToLCD/Descriptors.c index f9a1c7a06..ea8ce8c94 100644 --- a/Projects/SerialToLCD/Descriptors.c +++ b/Projects/SerialToLCD/Descriptors.c @@ -38,6 +38,17 @@ #include "Descriptors.h" +/* On some devices, there is a factory set internal serial number which can be automatically sent to the host as + * the device's serial number when the Device Descriptor's .SerialNumStrIndex entry is set to USE_INTERNAL_SERIAL. + * This allows the host to track a device across insertions on different ports, allowing them to retain allocated + * resources like COM port numbers and drivers. On demos using this feature, give a warning on unsupported devices + * so that the user can supply their own serial number descriptor instead or remove the USE_INTERNAL_SERIAL value + * from the Device Descriptor (forcing the host to generate a serial number for each device from the VID, PID and + * port location). + */ +#if (USE_INTERNAL_SERIAL == NO_DESCRIPTOR) + #warning USE_INTERNAL_SERIAL is not available on this AVR - please manually construct a device serial descriptor. +#endif /** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall * device characteristics, including the supported USB version, control endpoint size and the diff --git a/Projects/SerialToLCD/SerialToLCD.h b/Projects/SerialToLCD/SerialToLCD.h index cd893058e..52efe4401 100644 --- a/Projects/SerialToLCD/SerialToLCD.h +++ b/Projects/SerialToLCD/SerialToLCD.h @@ -46,6 +46,7 @@ #include "Descriptors.h" #include "Lib/HD44780.h" + #include #include #include diff --git a/Projects/SerialToLCD/makefile b/Projects/SerialToLCD/makefile index ba7b5aad3..337f249e0 100644 --- a/Projects/SerialToLCD/makefile +++ b/Projects/SerialToLCD/makefile @@ -120,7 +120,14 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -LUFA_OPTS = -D USE_LUFA_CONFIG_HEADER +LUFA_OPTS = -D USB_DEVICE_ONLY +LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 +LUFA_OPTS += -D ORDERED_EP_CONFIG +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 @@ -166,7 +173,7 @@ DEBUG = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = $(LUFA_PATH)/ Config/ +EXTRAINCDIRS = $(LUFA_PATH)/ # Compiler flag to set the C Standard level. diff --git a/Projects/XPLAINBridge/XPLAINBridge.txt b/Projects/XPLAINBridge/XPLAINBridge.txt index bc0ca37d8..3074b7b2f 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.txt +++ b/Projects/XPLAINBridge/XPLAINBridge.txt @@ -99,6 +99,18 @@ * \note This option is incompatible with \c LIBUSB_DRIVER_COMPAT. * * + * RESET_TOGGLES_LIBUSB_COMPAT + * Makefile LUFA_OPTS + * Define to make the /RESET line of the AVR toggle between Jungo and libUSB driver compatibility modes. Each time the AVR is + * reset externally via the reset pin, the compatibility mode will be toggled. The compatibility mode is preserved between + * power cycles and is not toggled via other forms of reset such as Watchdog or Brown Out. + * + * When this option is enabled, all board LEDs will flash twice on startup for Jungo compatibility mode, and five times for + * libUSB compatibility mode. + * + * \note This option is incompatible with \c LIBUSB_DRIVER_COMPAT. + * + * * FIRMWARE_VERSION_MINOR * AppConfig.h * Define to set the minor firmware revision nunber reported to the host on request. By default this will use a firmware version compatible