From 1e35a55f5986a848731e0d3cb152354efd3ee90d Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 10 May 2012 19:24:58 +0000 Subject: Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros. git-svn-id: http://lufa-lib.googlecode.com/svn/branches/AppConfigHeaders@2192 d5102386-fcda-11dd-9fdb-3debd5008f28 --- Bootloaders/CDC/BootloaderCDC.c | 48 +++++++---- Bootloaders/CDC/BootloaderCDC.h | 5 ++ Bootloaders/CDC/BootloaderCDC.txt | 6 +- Bootloaders/CDC/Config/AppConfig.h | 50 ++++++++++++ Bootloaders/CDC/Config/LUFAConfig.h | 93 ++++++++++++++++++++++ Bootloaders/CDC/Descriptors.c | 10 +-- Bootloaders/CDC/Descriptors.h | 12 +-- Bootloaders/CDC/makefile | 21 +---- Bootloaders/DFU/BootloaderDFU.c | 24 ++++++ Bootloaders/DFU/BootloaderDFU.h | 5 ++ Bootloaders/DFU/BootloaderDFU.txt | 6 +- Bootloaders/DFU/Descriptors.c | 2 +- Bootloaders/DFU/makefile | 2 +- Bootloaders/HID/BootloaderHID.c | 30 ++++++- Bootloaders/HID/BootloaderHID.h | 5 ++ Bootloaders/HID/BootloaderHID.txt | 8 +- Bootloaders/HID/Descriptors.c | 4 +- Bootloaders/HID/Descriptors.h | 4 +- Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c | 4 - Bootloaders/HID/makefile | 2 +- 20 files changed, 274 insertions(+), 67 deletions(-) create mode 100644 Bootloaders/CDC/Config/AppConfig.h create mode 100644 Bootloaders/CDC/Config/LUFAConfig.h (limited to 'Bootloaders') diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index e9ea8ae3..211b054e 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -56,6 +56,28 @@ static uint32_t CurrAddress; */ static bool RunBootloader = true; +/** Magic lock for forced application start. If the HWBE fuse is programmed and BOOTRST is unprogrammed, the bootloader + * will start if the /HWB line of the AVR is held low and the system is reset. However, if the /HWB line is still held + * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value + * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start. + */ +uint32_t MagicBootKey ATTR_NO_INIT; + + +/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application + * start key has been loaded into \ref MagicBootKey. If the bootloader started via the watchdog and the key is valid, + * this will force the user application to start via a software jump. + */ +void Application_Jump_Check(void) +{ + /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ + if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) + { + MagicBootKey = 0; + // cppcheck-suppress constStatement + ((void (*)(void))0x0000)(); + } +} /** Main program entry point. This routine configures the hardware required by the bootloader, then continuously * runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start @@ -80,6 +102,9 @@ int main(void) /* Disconnect from the host - USB interface will be reset later along with the AVR */ USB_Detach(); + + /* Unlock the forced application start mode of the bootloader if it is restarted */ + MagicBootKey = MAGIC_BOOT_KEY; /* Enable the watchdog and force a timeout to reset the AVR */ wdt_enable(WDTO_250MS); @@ -122,17 +147,12 @@ ISR(TIMER1_OVF_vect, ISR_BLOCK) void EVENT_USB_Device_ConfigurationChanged(void) { /* Setup CDC Notification, Rx and Tx Endpoints */ - Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, - ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE, - ENDPOINT_BANK_SINGLE); + Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, + CDC_NOTIFICATION_EPSIZE, 1); - Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE, - ENDPOINT_BANK_SINGLE); + Endpoint_ConfigureEndpoint(CDC_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); - Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK, - ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE, - ENDPOINT_BANK_SINGLE); + Endpoint_ConfigureEndpoint(CDC_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); } /** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to @@ -303,7 +323,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command) static uint8_t FetchNextCommandByte(void) { /* Select the OUT endpoint so that the next data byte can be read */ - Endpoint_SelectEndpoint(CDC_RX_EPNUM); + Endpoint_SelectEndpoint(CDC_RX_EPADDR); /* If OUT endpoint empty, clear it and wait for the next packet from the host */ while (!(Endpoint_IsReadWriteAllowed())) @@ -329,7 +349,7 @@ static uint8_t FetchNextCommandByte(void) static void WriteNextResponseByte(const uint8_t Response) { /* Select the IN endpoint so that the next data byte can be written */ - Endpoint_SelectEndpoint(CDC_TX_EPNUM); + Endpoint_SelectEndpoint(CDC_TX_EPADDR); /* If IN endpoint full, clear it and wait until ready for the next packet to the host */ if (!(Endpoint_IsReadWriteAllowed())) @@ -353,7 +373,7 @@ static void WriteNextResponseByte(const uint8_t Response) static void CDC_Task(void) { /* Select the OUT endpoint */ - Endpoint_SelectEndpoint(CDC_RX_EPNUM); + Endpoint_SelectEndpoint(CDC_RX_EPADDR); /* Check if endpoint has a command in it sent from the host */ if (!(Endpoint_IsOUTReceived())) @@ -549,7 +569,7 @@ static void CDC_Task(void) } /* Select the IN endpoint */ - Endpoint_SelectEndpoint(CDC_TX_EPNUM); + Endpoint_SelectEndpoint(CDC_TX_EPADDR); /* Remember if the endpoint is completely full before clearing it */ bool IsEndpointFull = !(Endpoint_IsReadWriteAllowed()); @@ -577,7 +597,7 @@ static void CDC_Task(void) } /* Select the OUT endpoint */ - Endpoint_SelectEndpoint(CDC_RX_EPNUM); + Endpoint_SelectEndpoint(CDC_RX_EPADDR); /* Acknowledge the command from the host */ Endpoint_ClearOUT(); diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h index 4b9e7d6d..257e884e 100644 --- a/Bootloaders/CDC/BootloaderCDC.h +++ b/Bootloaders/CDC/BootloaderCDC.h @@ -67,6 +67,9 @@ /** Eight character bootloader firmware identifier reported to the host when requested */ #define SOFTWARE_IDENTIFIER "LUFACDC" + /** Magic bootloader key to unlock forced application start mode. */ + #define MAGIC_BOOT_KEY 0xDC42CACA + /* Type Defines: */ /** Type define for a non-returning pointer to the start of the loaded application in flash memory. */ typedef void (*AppPtr_t)(void) ATTR_NO_RETURN; @@ -75,6 +78,8 @@ static void CDC_Task(void); static void SetupHardware(void); + void Application_Jump_Check(void) ATTR_INIT_SECTION(3); + void EVENT_USB_Device_ConfigurationChanged(void); #if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__) diff --git a/Bootloaders/CDC/BootloaderCDC.txt b/Bootloaders/CDC/BootloaderCDC.txt index d6ab9451..618b95d2 100644 --- a/Bootloaders/CDC/BootloaderCDC.txt +++ b/Bootloaders/CDC/BootloaderCDC.txt @@ -47,9 +47,9 @@ * This bootloader enumerates to the host as a CDC Class device (virtual serial port), allowing for AVR109 * protocol compatible programming software to load firmware onto the AVR. * - * Out of the box this bootloader builds for the USB1287, and will fit into 4KB of bootloader space. If - * you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU - * values in the accompanying makefile. + * Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit + * into 4KB of bootloader space. If you wish to alter this size and/or change the AVR model, you will need to + * edit the MCU, FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the * bootloader from the normal user application. diff --git a/Bootloaders/CDC/Config/AppConfig.h b/Bootloaders/CDC/Config/AppConfig.h new file mode 100644 index 00000000..ae3e50e1 --- /dev/null +++ b/Bootloaders/CDC/Config/AppConfig.h @@ -0,0 +1,50 @@ +/* + 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 is a header file which is be 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 _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define NO_BLOCK_SUPPORT + #define NO_EEPROM_BYTE_SUPPORT + #define NO_FLASH_BYTE_SUPPORT + #define NO_LOCK_BYTE_WRITE_SUPPORT + +#endif \ No newline at end of file diff --git a/Bootloaders/CDC/Config/LUFAConfig.h b/Bootloaders/CDC/Config/LUFAConfig.h new file mode 100644 index 00000000..c5a01c2f --- /dev/null +++ b/Bootloaders/CDC/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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 is a header file which is be 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 {Insert Value Here} +// #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/Bootloaders/CDC/Descriptors.c b/Bootloaders/CDC/Descriptors.c index 4bf3eced..9c892f83 100644 --- a/Bootloaders/CDC/Descriptors.c +++ b/Bootloaders/CDC/Descriptors.c @@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM), + .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -157,20 +157,20 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM), + .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM), + .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Bootloaders/CDC/Descriptors.h b/Bootloaders/CDC/Descriptors.h index e5ef6410..0010fc69 100644 --- a/Bootloaders/CDC/Descriptors.h +++ b/Bootloaders/CDC/Descriptors.h @@ -92,14 +92,14 @@ #error The selected AVR part is not currently supported by this bootloader. #endif - /** Endpoint number for the CDC control interface event notification endpoint. */ - #define CDC_NOTIFICATION_EPNUM 2 + /** Endpoint address for the CDC control interface event notification endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - /** Endpoint number for the CDC data interface TX (data IN) endpoint. */ - #define CDC_TX_EPNUM 3 + /** Endpoint address for the CDC data interface TX (data IN) endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number for the CDC data interface RX (data OUT) endpoint. */ - #define CDC_RX_EPNUM 4 + /** Endpoint address for the CDC data interface RX (data OUT) endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size of the CDC data interface TX and RX data endpoint banks, in bytes. */ #define CDC_TXRX_EPSIZE 16 diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile index 066fb888..b449ff0c 100644 --- a/Bootloaders/CDC/makefile +++ b/Bootloaders/CDC/makefile @@ -95,7 +95,7 @@ F_USB = $(F_CPU) # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 4 +BOOT_SECTION_SIZE_KB = 8 # Formulas used to calculate the starting address of the Bootloader section, and the User Application @@ -124,22 +124,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -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_RAM_DESCRIPTORS -LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -LUFA_OPTS += -D NO_INTERNAL_SERIAL -LUFA_OPTS += -D NO_DEVICE_SELF_POWER -LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP -LUFA_OPTS += -D NO_SOF_EVENTS - -#LUFA_OPTS += -D NO_BLOCK_SUPPORT -#LUFA_OPTS += -D NO_EEPROM_BYTE_SUPPORT -#LUFA_OPTS += -D NO_FLASH_BYTE_SUPPORT -#LUFA_OPTS += -D NO_LOCK_BYTE_WRITE_SUPPORT +LUFA_OPTS = -D USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -184,7 +169,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 3ce2a628..233e145a 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -92,6 +92,27 @@ static uint16_t StartAddr = 0x0000; */ static uint16_t EndAddr = 0x0000; +/** Magic lock for forced application start. If the HWBE fuse is programmed and BOOTRST is unprogrammed, the bootloader + * will start if the /HWB line of the AVR is held low and the system is reset. However, if the /HWB line is still held + * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value + * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start. + */ +uint32_t MagicBootKey ATTR_NO_INIT; + + +/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application + * start key has been loaded into \ref MagicBootKey. If the bootloader started via the watchdog and the key is valid, + * this will force the user application to start via a software jump. + */ +void Application_Jump_Check(void) +{ + // If the reset source was the bootloader and the key is correct, clear it and jump to the application + if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) + { + MagicBootKey = 0; + AppStartPtr(); + } +} /** Main program entry point. This routine configures the hardware required by the bootloader, then continuously * runs the bootloader processing routine until instructed to soft-exit, or hard-reset via the watchdog to start @@ -695,6 +716,9 @@ static void ProcessWriteCommand(void) { if (SentCommand.Data[1] == 0x00) // Start via watchdog { + /* Unlock the forced application start mode of the bootloader if it is restarted */ + MagicBootKey = MAGIC_BOOT_KEY; + /* Start the watchdog to reset the AVR once the communications are finalized */ wdt_enable(WDTO_250MS); } diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h index a8077534..46b70c0e 100644 --- a/Bootloaders/DFU/BootloaderDFU.h +++ b/Bootloaders/DFU/BootloaderDFU.h @@ -66,6 +66,9 @@ /** Minor bootloader version number. */ #define BOOTLOADER_VERSION_REV 0 + + /** Magic bootloader key to unlock forced application start mode. */ + #define MAGIC_BOOT_KEY 0xDC42CACA /** Complete bootloader version number expressed as a packed byte, constructed from the * two individual bootloader version macros. @@ -206,6 +209,8 @@ static void ProcessWriteCommand(void); static void ProcessReadCommand(void); #endif + + void Application_Jump_Check(void) ATTR_INIT_SECTION(3); #endif diff --git a/Bootloaders/DFU/BootloaderDFU.txt b/Bootloaders/DFU/BootloaderDFU.txt index d0811b2a..2c9eaf1d 100644 --- a/Bootloaders/DFU/BootloaderDFU.txt +++ b/Bootloaders/DFU/BootloaderDFU.txt @@ -47,9 +47,9 @@ * This bootloader enumerates to the host as a DFU Class device, allowing for DFU-compatible programming * software to load firmware onto the AVR. * - * Out of the box this bootloader builds for the USB1287, and should fit into 4KB of bootloader space. If - * you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU - * values in the accompanying makefile. + * Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit + * into 4KB of bootloader space. If you wish to alter this size and/or change the AVR model, you will need to + * edit the MCU, FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the * bootloader from the normal user application. diff --git a/Bootloaders/DFU/Descriptors.c b/Bootloaders/DFU/Descriptors.c index d5515906..ff33b6b6 100644 --- a/Bootloaders/DFU/Descriptors.c +++ b/Bootloaders/DFU/Descriptors.c @@ -111,7 +111,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = .DetachTimeout = 0x0000, .TransferSize = 0x0C00, - .DFUSpecification = VERSION_BCD(01.01) + .DFUSpecification = VERSION_BCD(01.10) } }; diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile index 608564eb..f78ceb27 100644 --- a/Bootloaders/DFU/makefile +++ b/Bootloaders/DFU/makefile @@ -95,7 +95,7 @@ F_USB = $(F_CPU) # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 4 +BOOT_SECTION_SIZE_KB = 8 # Formulas used to calculate the starting address of the Bootloader section, and the User Application diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c index 928000f8..acc351a3 100644 --- a/Bootloaders/HID/BootloaderHID.c +++ b/Bootloaders/HID/BootloaderHID.c @@ -41,6 +41,29 @@ */ static bool RunBootloader = true; +/** Magic lock for forced application start. If the HWBE fuse is programmed and BOOTRST is unprogrammed, the bootloader + * will start if the /HWB line of the AVR is held low and the system is reset. However, if the /HWB line is still held + * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value + * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start. + */ +uint32_t MagicBootKey ATTR_NO_INIT; + + +/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application + * start key has been loaded into \ref MagicBootKey. If the bootloader started via the watchdog and the key is valid, + * this will force the user application to start via a software jump. + */ +void Application_Jump_Check(void) +{ + /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ + if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) + { + MagicBootKey = 0; + // cppcheck-suppress constStatement + ((void (*)(void))0x0000)(); + } +} + /** Main program entry point. This routine configures the hardware required by the bootloader, then continuously * runs the bootloader processing routine until instructed to soft-exit. */ @@ -58,6 +81,9 @@ int main(void) /* Disconnect from the host - USB interface will be reset later along with the AVR */ USB_Detach(); + /* Unlock the forced application start mode of the bootloader if it is restarted */ + MagicBootKey = MAGIC_BOOT_KEY; + /* Enable the watchdog and force a timeout to reset the AVR */ wdt_enable(WDTO_250MS); @@ -85,9 +111,7 @@ static void SetupHardware(void) void EVENT_USB_Device_ConfigurationChanged(void) { /* Setup HID Report Endpoint */ - Endpoint_ConfigureEndpoint(HID_IN_EPNUM, EP_TYPE_INTERRUPT, - ENDPOINT_DIR_IN, HID_IN_EPSIZE, - ENDPOINT_BANK_SINGLE); + Endpoint_ConfigureEndpoint(HID_IN_EPADDR, EP_TYPE_INTERRUPT, HID_IN_EPSIZE, 1); } /** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to diff --git a/Bootloaders/HID/BootloaderHID.h b/Bootloaders/HID/BootloaderHID.h index ab5752d3..af2812a7 100644 --- a/Bootloaders/HID/BootloaderHID.h +++ b/Bootloaders/HID/BootloaderHID.h @@ -52,9 +52,14 @@ /** Bootloader special address to start the user application */ #define COMMAND_STARTAPPLICATION 0xFFFF + /** Magic bootloader key to unlock forced application start mode. */ + #define MAGIC_BOOT_KEY 0xDC42CACA + /* Function Prototypes: */ static void SetupHardware(void); + void Application_Jump_Check(void) ATTR_INIT_SECTION(3); + void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_UnhandledControlRequest(void); diff --git a/Bootloaders/HID/BootloaderHID.txt b/Bootloaders/HID/BootloaderHID.txt index a774ab48..f6c084d6 100644 --- a/Bootloaders/HID/BootloaderHID.txt +++ b/Bootloaders/HID/BootloaderHID.txt @@ -51,10 +51,10 @@ * from PJRC (used with permission). This bootloader is deliberatley non-compatible with the properietary PJRC * HalfKay bootloader GUI; only the command line interface software accompanying this bootloader will work with it. * - * Out of the box this bootloader builds for the USB1287, and will fit into 2KB of bootloader space for the - * Series 2 USB AVRs (ATMEGAxxU2, AT90USBxx2) or 4KB of bootloader space for all other models. If you wish to - * enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU values in the - * accompanying makefile. + * Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit + * into 2KB of bootloader space for the Series 2 USB AVRs (ATMEGAxxU2, AT90USBxx2) or 4KB of bootloader space for + * all other models. If you wish to alter this size and/or change the AVR model, you will need to edit the MCU, + * FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile. * * \section Sec_Installation Driver Installation * diff --git a/Bootloaders/HID/Descriptors.c b/Bootloaders/HID/Descriptors.c index 5d4271e0..c1ea8e30 100644 --- a/Bootloaders/HID/Descriptors.c +++ b/Bootloaders/HID/Descriptors.c @@ -137,10 +137,10 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | HID_IN_EPNUM), + .EndpointAddress = HID_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_IN_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Bootloaders/HID/Descriptors.h b/Bootloaders/HID/Descriptors.h index 41c4ee40..ad216038 100644 --- a/Bootloaders/HID/Descriptors.h +++ b/Bootloaders/HID/Descriptors.h @@ -55,8 +55,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the HID data IN endpoint. */ - #define HID_IN_EPNUM 1 + /** Endpoint address of the HID data IN endpoint. */ + #define HID_IN_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the HID reporting IN endpoint. */ #define HID_IN_EPSIZE 64 diff --git a/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c b/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c index 6063e198..c86b0da9 100644 --- a/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c +++ b/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c @@ -970,13 +970,9 @@ void parse_options(int argc, char **argv) } else if (strncmp(arg, "-mmcu=", 6) == 0) { arg += 6; - uint8_t valid_prefix = 0; - if (strncmp(arg, "at90usb", 7) == 0) { - valid_prefix = 1; arg += 7; } else if (strncmp(arg, "atmega", 6) == 0) { - valid_prefix = 1; arg += 6; } else { die("Unknown MCU type\n"); diff --git a/Bootloaders/HID/makefile b/Bootloaders/HID/makefile index efbb6a64..bfefbf69 100644 --- a/Bootloaders/HID/makefile +++ b/Bootloaders/HID/makefile @@ -95,7 +95,7 @@ F_USB = $(F_CPU) # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. FLASH_SIZE_KB = 128 -BOOT_SECTION_SIZE_KB = 4 +BOOT_SECTION_SIZE_KB = 8 # Formulas used to calculate the starting address of the Bootloader section. These formulas -- cgit v1.2.3 From e5da5b72e5107b24d62fd8dccaee071112688f36 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 10 May 2012 19:42:42 +0000 Subject: AppConfigHeaders: Update bootloaders to use configuration header files, rather than makefile defines. git-svn-id: http://lufa-lib.googlecode.com/svn/branches/AppConfigHeaders@2194 d5102386-fcda-11dd-9fdb-3debd5008f28 --- Bootloaders/CDC/BootloaderCDC.h | 1 + Bootloaders/CDC/BootloaderCDC.txt | 8 ++-- Bootloaders/CDC/Config/AppConfig.h | 17 ++++--- Bootloaders/CDC/Config/LUFAConfig.h | 6 +-- Bootloaders/CDC/Doxygen.conf | 3 +- Bootloaders/DFU/BootloaderDFU.txt | 2 +- Bootloaders/DFU/Config/LUFAConfig.h | 93 +++++++++++++++++++++++++++++++++++++ Bootloaders/DFU/Doxygen.conf | 3 +- Bootloaders/DFU/makefile | 14 +----- Bootloaders/HID/Config/LUFAConfig.h | 93 +++++++++++++++++++++++++++++++++++++ Bootloaders/HID/makefile | 14 +----- LUFA.pnproj | 2 +- 12 files changed, 214 insertions(+), 42 deletions(-) create mode 100644 Bootloaders/DFU/Config/LUFAConfig.h create mode 100644 Bootloaders/HID/Config/LUFAConfig.h (limited to 'Bootloaders') diff --git a/Bootloaders/CDC/BootloaderCDC.h b/Bootloaders/CDC/BootloaderCDC.h index 257e884e..36af9621 100644 --- a/Bootloaders/CDC/BootloaderCDC.h +++ b/Bootloaders/CDC/BootloaderCDC.h @@ -47,6 +47,7 @@ #include "Descriptors.h" #include "BootloaderAPI.h" + #include "Config/AppConfig.h" #include #include diff --git a/Bootloaders/CDC/BootloaderCDC.txt b/Bootloaders/CDC/BootloaderCDC.txt index 618b95d2..9abd7b2f 100644 --- a/Bootloaders/CDC/BootloaderCDC.txt +++ b/Bootloaders/CDC/BootloaderCDC.txt @@ -133,25 +133,25 @@ * * * NO_BLOCK_SUPPORT - * Makefile LUFA_OPTS + * AppConfig.h * Define to disable memory block read/write support in the bootloader, requiring all reads and writes to be made * using the byte-level commands. * * * NO_EEPROM_BYTE_SUPPORT - * Makefile LUFA_OPTS + * AppConfig.h * Define to disable EEPROM memory byte read/write support in the bootloader, requiring all EEPROM reads and writes * to be made using the block-level commands. * * * NO_FLASH_BYTE_SUPPORT - * Makefile LUFA_OPTS + * AppConfig.h * Define to disable FLASH memory byte read/write support in the bootloader, requiring all FLASH reads and writes * to be made using the block-level commands. * * * NO_LOCK_BYTE_WRITE_SUPPORT - * Makefile LUFA_OPTS + * AppConfig.h * Define to disable lock byte write support in the bootloader, preventing the lock bits from being set programmatically. * * diff --git a/Bootloaders/CDC/Config/AppConfig.h b/Bootloaders/CDC/Config/AppConfig.h index ae3e50e1..9f9b1ce2 100644 --- a/Bootloaders/CDC/Config/AppConfig.h +++ b/Bootloaders/CDC/Config/AppConfig.h @@ -29,22 +29,25 @@ */ /** \file - * \brief LUFA Library Configuration Header File + * \brief Application Configuration Header File * * This is a header file which is be 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". + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. */ #ifndef _APP_CONFIG_H_ #define _APP_CONFIG_H_ - #define NO_BLOCK_SUPPORT - #define NO_EEPROM_BYTE_SUPPORT - #define NO_FLASH_BYTE_SUPPORT - #define NO_LOCK_BYTE_WRITE_SUPPORT +// #define NO_BLOCK_SUPPORT + +// #define NO_EEPROM_BYTE_SUPPORT + +// #define NO_FLASH_BYTE_SUPPORT + +// #define NO_LOCK_BYTE_WRITE_SUPPORT #endif \ No newline at end of file diff --git a/Bootloaders/CDC/Config/LUFAConfig.h b/Bootloaders/CDC/Config/LUFAConfig.h index c5a01c2f..15ab0599 100644 --- a/Bootloaders/CDC/Config/LUFAConfig.h +++ b/Bootloaders/CDC/Config/LUFAConfig.h @@ -31,9 +31,9 @@ /** \file * \brief LUFA Library Configuration Header File * - * This is a header file which is be used to configure LUFA's - * compile time options, as an alternative to the compile time - * constants supplied through a makefile. + * 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". diff --git a/Bootloaders/CDC/Doxygen.conf b/Bootloaders/CDC/Doxygen.conf index a5b4bd68..2c655dcf 100644 --- a/Bootloaders/CDC/Doxygen.conf +++ b/Bootloaders/CDC/Doxygen.conf @@ -1531,7 +1531,8 @@ INCLUDE_FILE_PATTERNS = # instead of the = operator. PREDEFINED = __DOXYGEN__ \ - PROGMEM + PROGMEM \ + ATTR_NO_INIT # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/Bootloaders/DFU/BootloaderDFU.txt b/Bootloaders/DFU/BootloaderDFU.txt index 2c9eaf1d..04f91161 100644 --- a/Bootloaders/DFU/BootloaderDFU.txt +++ b/Bootloaders/DFU/BootloaderDFU.txt @@ -139,7 +139,7 @@ * * SECURE_MODE * BootloaderDFU.h - * If defined to true, the bootloader will not accept any memory commands other than a chip erase on start-up, until an + * If defined to \c true, the bootloader will not accept any memory commands other than a chip erase on start-up, until an * erase has been performed. This can be used in conjunction with the AVR's lockbits to prevent the AVRs firmware from * being dumped by unauthorized persons. * diff --git a/Bootloaders/DFU/Config/LUFAConfig.h b/Bootloaders/DFU/Config/LUFAConfig.h new file mode 100644 index 00000000..59f67596 --- /dev/null +++ b/Bootloaders/DFU/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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 32 + #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 {Insert Value Here} +// #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/Bootloaders/DFU/Doxygen.conf b/Bootloaders/DFU/Doxygen.conf index 331b4b41..99c1769b 100644 --- a/Bootloaders/DFU/Doxygen.conf +++ b/Bootloaders/DFU/Doxygen.conf @@ -1531,7 +1531,8 @@ INCLUDE_FILE_PATTERNS = # instead of the = operator. PREDEFINED = __DOXYGEN__ \ - PROGMEM + PROGMEM \ + ATTR_NO_INIT # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile index f78ceb27..a6db9008 100644 --- a/Bootloaders/DFU/makefile +++ b/Bootloaders/DFU/makefile @@ -124,17 +124,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -LUFA_OPTS = -D USB_DEVICE_ONLY -LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 -LUFA_OPTS += -D CONTROL_ONLY_DEVICE -LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=32 -LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 -LUFA_OPTS += -D USE_RAM_DESCRIPTORS -LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -LUFA_OPTS += -D NO_INTERNAL_SERIAL -LUFA_OPTS += -D NO_DEVICE_SELF_POWER -LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP -LUFA_OPTS += -D NO_SOF_EVENTS +LUFA_OPTS = -D USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -179,7 +169,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. diff --git a/Bootloaders/HID/Config/LUFAConfig.h b/Bootloaders/HID/Config/LUFAConfig.h new file mode 100644 index 00000000..15ab0599 --- /dev/null +++ b/Bootloaders/HID/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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 {Insert Value Here} +// #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/Bootloaders/HID/makefile b/Bootloaders/HID/makefile index bfefbf69..b0ae6d6d 100644 --- a/Bootloaders/HID/makefile +++ b/Bootloaders/HID/makefile @@ -122,17 +122,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -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_RAM_DESCRIPTORS -LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -LUFA_OPTS += -D NO_INTERNAL_SERIAL -LUFA_OPTS += -D NO_DEVICE_SELF_POWER -LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP -LUFA_OPTS += -D NO_SOF_EVENTS +LUFA_OPTS = -D USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -176,7 +166,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. diff --git a/LUFA.pnproj b/LUFA.pnproj index 16ad85f3..be76ad96 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file -- cgit v1.2.3 From e028e9837810d68b5433d2354bc80ea36ce3ba56 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 10 May 2012 20:11:47 +0000 Subject: AppConfigHeaders: Update several user projects to use configuration header files, rather than makefile defines. git-svn-id: http://lufa-lib.googlecode.com/svn/branches/AppConfigHeaders@2195 d5102386-fcda-11dd-9fdb-3debd5008f28 --- Bootloaders/CDC/Config/AppConfig.h | 3 - LUFA.pnproj | 2 +- Projects/AVRISP-MKII/AVRISP-MKII.h | 1 + Projects/AVRISP-MKII/AVRISP-MKII.txt | 30 ++++----- Projects/AVRISP-MKII/Config/AppConfig.h | 64 ++++++++++++++++++ Projects/AVRISP-MKII/Config/LUFAConfig.h | 93 ++++++++++++++++++++++++++ Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.h | 3 +- Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h | 3 +- Projects/AVRISP-MKII/Lib/V2Protocol.h | 3 +- Projects/AVRISP-MKII/Lib/V2ProtocolParams.h | 3 +- Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h | 3 +- Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h | 3 +- Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h | 3 +- Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h | 3 +- Projects/AVRISP-MKII/makefile | 29 +------- Projects/Benito/Benito.h | 1 + Projects/Benito/Benito.txt | 14 ++-- Projects/Benito/Config/AppConfig.h | 56 ++++++++++++++++ Projects/Benito/Config/LUFAConfig.h | 93 ++++++++++++++++++++++++++ Projects/Benito/makefile | 19 +----- Projects/HIDReportViewer/Config/LUFAConfig.h | 93 ++++++++++++++++++++++++++ Projects/HIDReportViewer/makefile | 5 +- Projects/LEDNotifier/Config/LUFAConfig.h | 93 ++++++++++++++++++++++++++ Projects/LEDNotifier/makefile | 10 +-- Projects/Magstripe/Config/AppConfig.h | 57 ++++++++++++++++ Projects/Magstripe/Config/LUFAConfig.h | 93 ++++++++++++++++++++++++++ Projects/Magstripe/Lib/MagstripeHW.h | 1 + Projects/Magstripe/Magstripe.h | 1 + Projects/Magstripe/Magstripe.txt | 20 +++--- Projects/Magstripe/makefile | 21 +----- 30 files changed, 705 insertions(+), 118 deletions(-) create mode 100644 Projects/AVRISP-MKII/Config/AppConfig.h create mode 100644 Projects/AVRISP-MKII/Config/LUFAConfig.h create mode 100644 Projects/Benito/Config/AppConfig.h create mode 100644 Projects/Benito/Config/LUFAConfig.h create mode 100644 Projects/HIDReportViewer/Config/LUFAConfig.h create mode 100644 Projects/LEDNotifier/Config/LUFAConfig.h create mode 100644 Projects/Magstripe/Config/AppConfig.h create mode 100644 Projects/Magstripe/Config/LUFAConfig.h (limited to 'Bootloaders') diff --git a/Bootloaders/CDC/Config/AppConfig.h b/Bootloaders/CDC/Config/AppConfig.h index 9f9b1ce2..6baadf9a 100644 --- a/Bootloaders/CDC/Config/AppConfig.h +++ b/Bootloaders/CDC/Config/AppConfig.h @@ -43,11 +43,8 @@ #define _APP_CONFIG_H_ // #define NO_BLOCK_SUPPORT - // #define NO_EEPROM_BYTE_SUPPORT - // #define NO_FLASH_BYTE_SUPPORT - // #define NO_LOCK_BYTE_WRITE_SUPPORT #endif \ No newline at end of file diff --git a/LUFA.pnproj b/LUFA.pnproj index be76ad96..d616383c 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.h b/Projects/AVRISP-MKII/AVRISP-MKII.h index 21703052..e7b41841 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.h +++ b/Projects/AVRISP-MKII/AVRISP-MKII.h @@ -52,6 +52,7 @@ #include "Descriptors.h" #include "Lib/V2Protocol.h" + #include "Config/AppConfig.h" /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.txt b/Projects/AVRISP-MKII/AVRISP-MKII.txt index ad58dab1..a933f386 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.txt +++ b/Projects/AVRISP-MKII/AVRISP-MKII.txt @@ -214,60 +214,60 @@ * * * AUX_LINE_PORT - * Makefile LUFA_OPTS + * AppConfig.h * PORT register for the programmer's AUX target line. The use of this line varies between the programming protocols, * but is generally used for the target's /RESET line. * \n \n Ignored when compiled for the XPLAIN board. * * * AUX_LINE_PIN - * Makefile LUFA_OPTS + * AppConfig.h * PIN register for the programmer's AUX target line. The use of this line varies between the programming protocols, * but is generally used for the target's /RESET line. * \n \n Ignored when compiled for the XPLAIN board. * * * AUX_LINE_DDR - * Makefile LUFA_OPTS + * AppConfig.h * DDR register for the programmer's AUX target line. The use of this line varies between the programming protocols, * but is generally used for the target's /RESET line. * \n \n Ignored when compiled for the XPLAIN board. * * * AUX_LINE_MASK - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the programmer's AUX target line. The use of this line varies between the programming protocols, * but is generally used for the target's /RESET line. Must not be the AVR's /SS pin. * \n \n Ignored when compiled for the XPLAIN board. * * * VTARGET_ADC_CHANNEL - * Makefile LUFA_OPTS + * AppConfig.h * ADC channel number (on supported AVRs) to use for VTARGET level detection, if NO_VTARGET_DETECT is not defined. * \n \n Ignored when compiled for targets lacking an ADC. * * * ENABLE_ISP_PROTOCOL - * Makefile LUFA_OPTS + * AppConfig.h * Define to enable SPI programming protocol support. * \n \n Ignored when compiled for the XPLAIN board. * * * ENABLE_XPROG_PROTOCOL - * Makefile LUFA_OPTS + * AppConfig.h * Define to enable PDI and TPI programming protocol support. * \n \n Ignored when compiled for the XPLAIN board. * * * NO_VTARGET_DETECT - * Makefile LUFA_OPTS + * AppConfig.h * Define to disable VTARGET sampling and reporting on AVR models with an ADC converter. This will cause the programmer * to report a fixed 3.3V target voltage to the host regardless of the real target voltage. * \n \n Ignored when compiled for targets lacking an ADC. * * * VTARGET_REF_VOLTS - * Makefile LUFA_OPTS + * AppConfig.h * Indicates the programmer AVR's AVCC reference voltage when measuring the target's supply voltage. Note that the supply * voltage should never exceed the reference voltage on the programmer AVR without some form of protection to prevent damage * to the ADC. @@ -275,14 +275,14 @@ * * * VTARGET_USE_INTERNAL_REF - * Makefile LUFA_OPTS + * AppConfig.h * Selects the internal 2.56V ADC reference voltage, instead of using the AVR's VREF pin. When enabled, this option will * override the VTARGET_REF_VOLTS configuration option. * \n \n Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined. * * * VTARGET_SCALE_FACTOR - * Makefile LUFA_OPTS + * AppConfig.h * Indicates the target's supply voltage scale factor when applied to the ADC. A simple resistive divider can be used on the * ADC pin for measuring the target's supply voltage, so that voltages above the programmer AVR's AVCC reference voltage can be * measured. This should be the reciprocal of the division performed - e.g. if the VTARGET voltage is halved, this should be set @@ -291,25 +291,25 @@ * * * LIBUSB_DRIVER_COMPAT - * Makefile LUFA_OPTS + * AppConfig.h * Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making * the code compatible with software such as avrdude (all platforms) that use the libUSB driver. * * * XCK_RESCUE_CLOCK_ENABLE - * Makefile LUFA_OPTS + * AppConfig.h * Define to move the ISP rescue clock to the AVR's XCK pin instead of the OCR1A output pin. This is useful for existing programming * hardware that does not expose the OCR1A pin of the AVR, but may cause some issues with PDI programming mode. * * * INVERTED_ISP_MISO - * Makefile LUFA_OPTS + * AppConfig.h * Define to invert the received data on the ISP MISO line. This is sometimes needed depending on the level translation hardware used, * if the translator hardware inverts the received logic level. * * * FIRMWARE_VERSION_MINOR - * Makefile LUFA_OPTS + * 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 * with the latest Atmel IDE version, however if desired the reported minor value can be adjusted here. * diff --git a/Projects/AVRISP-MKII/Config/AppConfig.h b/Projects/AVRISP-MKII/Config/AppConfig.h new file mode 100644 index 00000000..88ed41f9 --- /dev/null +++ b/Projects/AVRISP-MKII/Config/AppConfig.h @@ -0,0 +1,64 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be 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 + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define AUX_LINE_PORT PORTB + #define AUX_LINE_PIN PINB + #define AUX_LINE_DDR DDRB + #define AUX_LINE_MASK (1 << 4) + + #define ENABLE_ISP_PROTOCOL + #define ENABLE_XPROG_PROTOCOL + + #define VTARGET_ADC_CHANNEL 2 + #define VTARGET_REF_VOLTS 5 + #define VTARGET_SCALE_FACTOR 1 +// #define VTARGET_USE_INTERNAL_REF +// #define NO_VTARGET_DETECT +// #define XCK_RESCUE_CLOCK_ENABLE +// #define INVERTED_ISP_MISO + +// #define LIBUSB_DRIVER_COMPAT +// #define FIRMWARE_VERSION_MINOR 0x11 + +#endif \ No newline at end of file diff --git a/Projects/AVRISP-MKII/Config/LUFAConfig.h b/Projects/AVRISP-MKII/Config/LUFAConfig.h new file mode 100644 index 00000000..0a7ca2a3 --- /dev/null +++ b/Projects/AVRISP-MKII/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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 16 + #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 {Insert Value Here} +// #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/AVRISP-MKII/Lib/ISP/ISPProtocol.h b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.h index 4ad52639..7f65e46b 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.h +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.h @@ -43,7 +43,8 @@ #include #include "../V2Protocol.h" - + #include "Config/AppConfig.h" + /* Preprocessor Checks: */ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) #undef ENABLE_ISP_PROTOCOL diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h index 9124b1a6..25d9720c 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h @@ -45,7 +45,8 @@ #include #include "../V2ProtocolParams.h" - + #include "Config/AppConfig.h" + /* Preprocessor Checks: */ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) #undef ENABLE_ISP_PROTOCOL diff --git a/Projects/AVRISP-MKII/Lib/V2Protocol.h b/Projects/AVRISP-MKII/Lib/V2Protocol.h index dca97cb2..0032dec6 100644 --- a/Projects/AVRISP-MKII/Lib/V2Protocol.h +++ b/Projects/AVRISP-MKII/Lib/V2Protocol.h @@ -48,7 +48,8 @@ #include "V2ProtocolParams.h" #include "ISP/ISPProtocol.h" #include "XPROG/XPROGProtocol.h" - + #include "Config/AppConfig.h" + /* Preprocessor Checks: */ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) #undef ENABLE_ISP_PROTOCOL diff --git a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h index ab47664d..55cb64dd 100644 --- a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h +++ b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h @@ -49,7 +49,8 @@ #include "V2Protocol.h" #include "V2ProtocolConstants.h" #include "ISP/ISPTarget.h" - + #include "Config/AppConfig.h" + /* Macros: */ /** Parameter privilege mask to allow the host PC to read the parameter's value. */ #define PARAM_PRIV_READ (1 << 0) diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h index c028321b..696e5f5b 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h +++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h @@ -45,7 +45,8 @@ #include "XPROGProtocol.h" #include "XPROGTarget.h" - + #include "Config/AppConfig.h" + /* Preprocessor Checks: */ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) #undef ENABLE_ISP_PROTOCOL diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h index a8704df3..2789d021 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h +++ b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h @@ -45,7 +45,8 @@ #include "XPROGProtocol.h" #include "XPROGTarget.h" - + #include "Config/AppConfig.h" + /* Preprocessor Checks: */ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) #undef ENABLE_ISP_PROTOCOL diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h index 60565358..2d99d565 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.h @@ -46,7 +46,8 @@ #include "../V2Protocol.h" #include "XMEGANVM.h" #include "TINYNVM.h" - + #include "Config/AppConfig.h" + /* Preprocessor Checks: */ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) /* On the XPLAIN board, we only need PDI programming diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h index 09c6ee58..2df1e38a 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h @@ -45,7 +45,8 @@ #include "../V2Protocol.h" #include "XPROGProtocol.h" - + #include "Config/AppConfig.h" + /* Preprocessor Checks: */ #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) #undef ENABLE_ISP_PROTOCOL diff --git a/Projects/AVRISP-MKII/makefile b/Projects/AVRISP-MKII/makefile index dbc38cae..d0c2567f 100644 --- a/Projects/AVRISP-MKII/makefile +++ b/Projects/AVRISP-MKII/makefile @@ -120,32 +120,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -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=16 -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_INTERNAL_SERIAL -LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP -LUFA_OPTS += -D NO_DEVICE_SELF_POWER - -LUFA_OPTS += -D AUX_LINE_PORT=PORTB -LUFA_OPTS += -D AUX_LINE_PIN=PINB -LUFA_OPTS += -D AUX_LINE_DDR=DDRB -LUFA_OPTS += -D AUX_LINE_MASK="(1 << 4)" -LUFA_OPTS += -D ENABLE_ISP_PROTOCOL -LUFA_OPTS += -D ENABLE_XPROG_PROTOCOL -LUFA_OPTS += -D VTARGET_ADC_CHANNEL=2 -LUFA_OPTS += -D VTARGET_REF_VOLTS=5 -LUFA_OPTS += -D VTARGET_SCALE_FACTOR=1 -#LUFA_OPTS += -D VTARGET_USE_INTERNAL_REF -#LUFA_OPTS += -D NO_VTARGET_DETECT -#LUFA_OPTS += -D LIBUSB_DRIVER_COMPAT -#LUFA_OPTS += -D XCK_RESCUE_CLOCK_ENABLE -#LUFA_OPTS += -D INVERTED_ISP_MISO -#LUFA_OPTS += -D FIRMWARE_VERSION_MINOR=0x11 +LUFA_OPTS = -D USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -197,7 +172,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. diff --git a/Projects/Benito/Benito.h b/Projects/Benito/Benito.h index 9b91c7c4..184c1738 100644 --- a/Projects/Benito/Benito.h +++ b/Projects/Benito/Benito.h @@ -42,6 +42,7 @@ #include #include "Descriptors.h" + #include "Config/AppConfig.h" #include #include diff --git a/Projects/Benito/Benito.txt b/Projects/Benito/Benito.txt index f1a4f6ac..bfa707a6 100644 --- a/Projects/Benito/Benito.txt +++ b/Projects/Benito/Benito.txt @@ -68,37 +68,37 @@ * * * AVR_RESET_LINE_PORT - * Makefile LUFA_OPTS + * AppConfig.h * Indicates the PORT register of the pin used to generate the target /RESET line pulse. * * * AVR_RESET_LINE_DDR - * Makefile LUFA_OPTS + * AppConfig.h * Indicates the DDR register of the pin used to generate the target /RESET line pulse. * * * AVR_RESET_LINE_MASK - * Makefile LUFA_OPTS + * AppConfig.h * Indicates the mask of the pin used to generate the target /RESET line pulse. * * * AVR_RESET_PULSE_MS - * Makefile LUFA_OPTS + * AppConfig.h * Pulse length in milliseconds for the target /RESET pulse. * * * TX_RX_LED_PULSE_MS - * Makefile LUFA_OPTS + * AppConfig.h * Pulse length in milliseconds for the activity Tx/Rx LEDs. * * * PING_PONG_LED_PULSE_MS - * Makefile LUFA_OPTS + * AppConfig.h * Pulse length in milliseconds for the enumeration LED ping-ponging between toggles. * * * RECEIVE_BUFFER_FLUSH_MS - * Makefile LUFA_OPTS + * AppConfig.h * Period between flushings of received data buffer to the attached USB host. * * diff --git a/Projects/Benito/Config/AppConfig.h b/Projects/Benito/Config/AppConfig.h new file mode 100644 index 00000000..c3aeb54d --- /dev/null +++ b/Projects/Benito/Config/AppConfig.h @@ -0,0 +1,56 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be 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 + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define AVR_RESET_LINE_PORT PORTD + #define AVR_RESET_LINE_DDR DDRD + #define AVR_RESET_LINE_MASK (1 << 4) + + #define AVR_RESET_PULSE_MS 10 + + #define TX_RX_LED_PULSE_MS 30 + #define PING_PONG_LED_PULSE_MS 100 + + #define RECEIVE_BUFFER_FLUSH_MS 10 + +#endif \ No newline at end of file diff --git a/Projects/Benito/Config/LUFAConfig.h b/Projects/Benito/Config/LUFAConfig.h new file mode 100644 index 00000000..3921cd68 --- /dev/null +++ b/Projects/Benito/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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 {Insert Value Here} +// #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/Benito/makefile b/Projects/Benito/makefile index d397d10a..86b875d4 100644 --- a/Projects/Benito/makefile +++ b/Projects/Benito/makefile @@ -120,22 +120,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -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 - -LUFA_OPTS += -D AVR_RESET_LINE_PORT="PORTD" -LUFA_OPTS += -D AVR_RESET_LINE_DDR="DDRD" -LUFA_OPTS += -D AVR_RESET_LINE_MASK="(1 << 4)" -LUFA_OPTS += -D AVR_RESET_PULSE_MS=10 -LUFA_OPTS += -D TX_RX_LED_PULSE_MS=30 -LUFA_OPTS += -D PING_PONG_LED_PULSE_MS=100 -LUFA_OPTS += -D RECEIVE_BUFFER_FLUSH_MS=10 +LUFA_OPTS = -D USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -180,7 +165,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. diff --git a/Projects/HIDReportViewer/Config/LUFAConfig.h b/Projects/HIDReportViewer/Config/LUFAConfig.h new file mode 100644 index 00000000..dab88310 --- /dev/null +++ b/Projects/HIDReportViewer/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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_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 {Insert Value Here} +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} +// #define FIXED_NUM_CONFIGURATIONS {Insert Value Here} +// #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 {Insert Value Here} +// #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/HIDReportViewer/makefile b/Projects/HIDReportViewer/makefile index 4894b2f7..4af54e32 100644 --- a/Projects/HIDReportViewer/makefile +++ b/Projects/HIDReportViewer/makefile @@ -120,8 +120,7 @@ LUFA_PATH = ../.. # 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 USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -166,7 +165,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. diff --git a/Projects/LEDNotifier/Config/LUFAConfig.h b/Projects/LEDNotifier/Config/LUFAConfig.h new file mode 100644 index 00000000..3e9c9b21 --- /dev/null +++ b/Projects/LEDNotifier/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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 {Insert Value Here} +// #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/LEDNotifier/makefile b/Projects/LEDNotifier/makefile index 4ccd01ed..d11ed0af 100644 --- a/Projects/LEDNotifier/makefile +++ b/Projects/LEDNotifier/makefile @@ -120,13 +120,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -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 USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -171,7 +165,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. diff --git a/Projects/Magstripe/Config/AppConfig.h b/Projects/Magstripe/Config/AppConfig.h new file mode 100644 index 00000000..3fe5456f --- /dev/null +++ b/Projects/Magstripe/Config/AppConfig.h @@ -0,0 +1,57 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be 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 + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define MAG_T1_CLOCK (1 << 0) + #define MAG_T1_DATA (1 << 1) + #define MAG_T2_CLOCK (1 << 2) + #define MAG_T2_DATA (1 << 3) + #define MAG_T3_CLOCK (1 << 4) + #define MAG_T3_DATA (1 << 5) + #define MAG_CARDPRESENT (1 << 6) + + #define MAG_PORT PORTC + #define MAG_PIN PINC + #define MAG_DDR DDRC + +#endif \ No newline at end of file diff --git a/Projects/Magstripe/Config/LUFAConfig.h b/Projects/Magstripe/Config/LUFAConfig.h new file mode 100644 index 00000000..095bac91 --- /dev/null +++ b/Projects/Magstripe/Config/LUFAConfig.h @@ -0,0 +1,93 @@ +/* + 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 {Insert Value Here} +// #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/Magstripe/Lib/MagstripeHW.h b/Projects/Magstripe/Lib/MagstripeHW.h index ef5e9084..177e26b0 100644 --- a/Projects/Magstripe/Lib/MagstripeHW.h +++ b/Projects/Magstripe/Lib/MagstripeHW.h @@ -65,6 +65,7 @@ #include #include + #include "Config/AppConfig.h" /* Private Interface - For use in library only: */ /* Macros: */ diff --git a/Projects/Magstripe/Magstripe.h b/Projects/Magstripe/Magstripe.h index 6e73dcb5..c7e9d052 100644 --- a/Projects/Magstripe/Magstripe.h +++ b/Projects/Magstripe/Magstripe.h @@ -46,6 +46,7 @@ #include "Descriptors.h" #include "Lib/MagstripeHW.h" #include "Lib/CircularBitBuffer.h" + #include "Config/AppConfig.h" #include #include diff --git a/Projects/Magstripe/Magstripe.txt b/Projects/Magstripe/Magstripe.txt index 34825ae6..d26b0edc 100644 --- a/Projects/Magstripe/Magstripe.txt +++ b/Projects/Magstripe/Magstripe.txt @@ -110,52 +110,52 @@ * * * MAG_T1_CLOCK - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the magnetic card reader's CLOCK line for the reader's track 1 output. * * * MAG_T1_DATA - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the magnetic card reader's DATA line for the reader's track 1 output. * * * MAG_T2_CLOCK - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the magnetic card reader's CLOCK line for the reader's track 2 output. * * * MAG_T2_DATA - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the magnetic card reader's DATA line for the reader's track 2 output. * * * MAG_T3_CLOCK - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the magnetic card reader's CLOCK line for the reader's track 3 output. * * * MAG_T3_DATA - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the magnetic card reader's DATA line for the reader's track 3 output. * * * MAG_CARDPRESENT - * Makefile LUFA_OPTS + * AppConfig.h * Mask for the magnetic card reader's card detection output. * * * MAG_PIN - * Makefile LUFA_OPTS + * AppConfig.h * PIN register that the magnetic card reader device is attached to. * * * MAG_PORT - * Makefile LUFA_OPTS + * AppConfig.h * PORT register that the magnetic card reader device is attached to. * * * MAG_DDR - * Makefile LUFA_OPTS + * AppConfig.h * DDR register that the magnetic card reader device is attached to. * * diff --git a/Projects/Magstripe/makefile b/Projects/Magstripe/makefile index cbf2197b..fda76eb2 100644 --- a/Projects/Magstripe/makefile +++ b/Projects/Magstripe/makefile @@ -120,24 +120,7 @@ LUFA_PATH = ../.. # LUFA library compile-time options and predefined tokens -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 MAG_T1_CLOCK="(1 << 0)" -LUFA_OPTS += -D MAG_T1_DATA="(1 << 1)" -LUFA_OPTS += -D MAG_T2_CLOCK="(1 << 2)" -LUFA_OPTS += -D MAG_T2_DATA="(1 << 3)" -LUFA_OPTS += -D MAG_T3_CLOCK="(1 << 4)" -LUFA_OPTS += -D MAG_T3_DATA="(1 << 5)" -LUFA_OPTS += -D MAG_CARDPRESENT="(1 << 6)" -LUFA_OPTS += -D MAG_PIN=PINB -LUFA_OPTS += -D MAG_DDR=DDRB -LUFA_OPTS += -D MAG_PORT=PORTB +LUFA_OPTS = -D USE_LUFA_CONFIG_HEADER # Create the LUFA source path variables by including the LUFA root makefile @@ -183,7 +166,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)/ +EXTRAINCDIRS = $(LUFA_PATH)/ Config/ # Compiler flag to set the C Standard level. -- cgit v1.2.3 From de64d3b8b2b1ca8f524aa7760b5ab807135dd21d Mon Sep 17 00:00:00 2001 From: Dean Date: Sun, 13 May 2012 21:01:23 +0000 Subject: AppConfigHeaders: Move out the last of the demo/app configurations into new AppConfig.h header files. git-svn-id: http://lufa-lib.googlecode.com/svn/branches/AppConfigHeaders@2217 d5102386-fcda-11dd-9fdb-3debd5008f28 --- Bootloaders/DFU/BootloaderDFU.h | 8 +-- Bootloaders/DFU/BootloaderDFU.txt | 4 +- Bootloaders/DFU/Config/AppConfig.h | 48 +++++++++++++++++ Demos/Device/ClassDriver/AudioInput/AudioInput.c | 2 +- Demos/Device/ClassDriver/AudioInput/AudioInput.h | 7 +-- Demos/Device/ClassDriver/AudioInput/AudioInput.txt | 5 ++ .../ClassDriver/AudioInput/Config/AppConfig.h | 2 + .../ClassDriver/GenericHID/Config/AppConfig.h | 48 +++++++++++++++++ Demos/Device/ClassDriver/GenericHID/Descriptors.h | 5 +- Demos/Device/ClassDriver/GenericHID/GenericHID.h | 3 +- Demos/Device/ClassDriver/GenericHID/GenericHID.txt | 6 +-- .../ClassDriver/MassStorage/Config/AppConfig.h | 50 ++++++++++++++++++ .../ClassDriver/MassStorage/Lib/DataflashManager.h | 3 ++ Demos/Device/ClassDriver/MassStorage/MassStorage.h | 10 +--- .../Device/ClassDriver/MassStorage/MassStorage.txt | 7 ++- .../MassStorageKeyboard/Config/AppConfig.h | 50 ++++++++++++++++++ .../MassStorageKeyboard/Lib/DataflashManager.h | 3 ++ .../MassStorageKeyboard/MassStorageKeyboard.h | 10 +--- .../MassStorageKeyboard/MassStorageKeyboard.txt | 8 ++- .../ClassDriver/RNDISEthernet/Config/AppConfig.h | 60 ++++++++++++++++++++++ .../RNDISEthernet/Config/NetworkConfig.h | 55 -------------------- .../ClassDriver/RNDISEthernet/Lib/Ethernet.h | 6 --- Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h | 2 +- .../RNDISEthernet/Lib/ProtocolDecoders.h | 2 +- .../ClassDriver/RNDISEthernet/RNDISEthernet.txt | 34 +++++++++--- .../VirtualSerialMassStorage/Config/AppConfig.h | 50 ++++++++++++++++++ .../Lib/DataflashManager.h | 3 ++ .../VirtualSerialMassStorage.h | 10 +--- .../VirtualSerialMassStorage.txt | 8 ++- Demos/Device/LowLevel/AudioInput/AudioInput.c | 2 +- Demos/Device/LowLevel/AudioInput/AudioInput.h | 6 --- .../Device/LowLevel/AudioInput/Config/AppConfig.h | 2 + .../Device/LowLevel/GenericHID/Config/AppConfig.h | 48 +++++++++++++++++ Demos/Device/LowLevel/GenericHID/Descriptors.h | 5 +- Demos/Device/LowLevel/GenericHID/GenericHID.h | 3 +- Demos/Device/LowLevel/GenericHID/GenericHID.txt | 6 +-- .../Device/LowLevel/MassStorage/Config/AppConfig.h | 50 ++++++++++++++++++ .../LowLevel/MassStorage/Lib/DataflashManager.h | 7 +-- Demos/Device/LowLevel/MassStorage/MassStorage.h | 4 +- Demos/Device/LowLevel/MassStorage/MassStorage.txt | 7 ++- Demos/Device/LowLevel/Mouse/Mouse.h | 1 + .../LowLevel/RNDISEthernet/Config/AppConfig.h | 60 ++++++++++++++++++++++ .../LowLevel/RNDISEthernet/Config/NetworkConfig.h | 55 -------------------- Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h | 6 --- Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h | 3 +- .../LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h | 3 +- .../LowLevel/RNDISEthernet/RNDISEthernet.txt | 32 ++++++++---- .../ClassDriver/AudioOutputHost/AudioOutputHost.c | 3 ++ .../ClassDriver/AudioOutputHost/AudioOutputHost.h | 14 +---- .../AudioOutputHost/AudioOutputHost.txt | 9 +++- .../ClassDriver/AudioOutputHost/Config/AppConfig.h | 51 ++++++++++++++++++ .../LowLevel/AudioOutputHost/AudioOutputHost.c | 3 ++ .../LowLevel/AudioOutputHost/AudioOutputHost.h | 13 +---- .../LowLevel/AudioOutputHost/AudioOutputHost.txt | 9 +++- .../LowLevel/AudioOutputHost/Config/AppConfig.h | 51 ++++++++++++++++++ LUFA.pnproj | 2 +- Projects/MIDIToneGenerator/Config/AppConfig.h | 48 +++++++++++++++++ Projects/MIDIToneGenerator/MIDIToneGenerator.h | 4 +- Projects/MIDIToneGenerator/MIDIToneGenerator.txt | 2 +- 59 files changed, 760 insertions(+), 258 deletions(-) create mode 100644 Bootloaders/DFU/Config/AppConfig.h create mode 100644 Demos/Device/ClassDriver/GenericHID/Config/AppConfig.h create mode 100644 Demos/Device/ClassDriver/MassStorage/Config/AppConfig.h create mode 100644 Demos/Device/ClassDriver/MassStorageKeyboard/Config/AppConfig.h create mode 100644 Demos/Device/ClassDriver/RNDISEthernet/Config/AppConfig.h delete mode 100644 Demos/Device/ClassDriver/RNDISEthernet/Config/NetworkConfig.h create mode 100644 Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/AppConfig.h create mode 100644 Demos/Device/LowLevel/GenericHID/Config/AppConfig.h create mode 100644 Demos/Device/LowLevel/MassStorage/Config/AppConfig.h create mode 100644 Demos/Device/LowLevel/RNDISEthernet/Config/AppConfig.h delete mode 100644 Demos/Device/LowLevel/RNDISEthernet/Config/NetworkConfig.h create mode 100644 Demos/Host/ClassDriver/AudioOutputHost/Config/AppConfig.h create mode 100644 Demos/Host/LowLevel/AudioOutputHost/Config/AppConfig.h create mode 100644 Projects/MIDIToneGenerator/Config/AppConfig.h (limited to 'Bootloaders') diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h index 46b70c0e..ffd330d7 100644 --- a/Bootloaders/DFU/BootloaderDFU.h +++ b/Bootloaders/DFU/BootloaderDFU.h @@ -49,18 +49,12 @@ #include "Descriptors.h" #include "BootloaderAPI.h" + #include "Config/AppConfig.h" #include #include /* Macros: */ - /** Configuration define. Define this token to true to case the bootloader to reject all memory commands - * until a memory erase has been performed. When used in conjunction with the lockbits of the AVR, this - * can protect the AVR's firmware from being dumped from a secured AVR. When false, memory operations are - * allowed at any time. - */ - #define SECURE_MODE false - /** Major bootloader version number. */ #define BOOTLOADER_VERSION_MINOR 2 diff --git a/Bootloaders/DFU/BootloaderDFU.txt b/Bootloaders/DFU/BootloaderDFU.txt index c7e1b1ed..a4cc6e20 100644 --- a/Bootloaders/DFU/BootloaderDFU.txt +++ b/Bootloaders/DFU/BootloaderDFU.txt @@ -140,10 +140,10 @@ * * * SECURE_MODE - * BootloaderDFU.h + * AppConfig.h * If defined to \c true, the bootloader will not accept any memory commands other than a chip erase on start-up, until an * erase has been performed. This can be used in conjunction with the AVR's lockbits to prevent the AVRs firmware from - * being dumped by unauthorized persons. + * being dumped by unauthorized persons. When false, all memory operations are allowed at any time. * * */ diff --git a/Bootloaders/DFU/Config/AppConfig.h b/Bootloaders/DFU/Config/AppConfig.h new file mode 100644 index 00000000..26a79b42 --- /dev/null +++ b/Bootloaders/DFU/Config/AppConfig.h @@ -0,0 +1,48 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define SECURE_MODE false + +#endif \ No newline at end of file diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index 867a09ee..953ecf8b 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -94,7 +94,7 @@ void SetupHardware(void) USB_Init(); /* Start the ADC conversion in free running mode */ - ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | MIC_IN_ADC_MUX_MASK); + ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL)); } /** ISR to handle the reloading of the data endpoint with the next sample. */ diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.h b/Demos/Device/ClassDriver/AudioInput/AudioInput.h index 6bf5e882..fb5e69c8 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.h +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.h @@ -49,14 +49,9 @@ #include #include "Descriptors.h" + #include "Config/AppConfig.h" /* Macros: */ - /** ADC channel number for the microphone input. */ - #define MIC_IN_ADC_CHANNEL 2 - - /** ADC channel MUX mask for the microphone input. */ - #define MIC_IN_ADC_MUX_MASK ADC_CHANNEL2 - /** Maximum audio sample value for the microphone input. */ #define SAMPLE_MAX_RANGE 0xFFFF diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.txt b/Demos/Device/ClassDriver/AudioInput/AudioInput.txt index 17b476e2..654536c8 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.txt +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.txt @@ -72,6 +72,11 @@ * Description: * * + * MIC_IN_ADC_CHANNEL + * AppConfig.h + * Sets the ADC channel used by the demo for the input audio samples from an attached microphone. + * + * * USE_TEST_TONE * AppConfig.h * When defined, this alters the demo to produce a square wave test tone when the first board button is pressed diff --git a/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h b/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h index 01101649..7702e259 100644 --- a/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h +++ b/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h @@ -43,6 +43,8 @@ #ifndef _APP_CONFIG_H_ #define _APP_CONFIG_H_ + #define MIC_IN_ADC_CHANNEL 2 + #define MICROPHONE_BIASED_TO_HALF_RAIL #define USE_TEST_TONE diff --git a/Demos/Device/ClassDriver/GenericHID/Config/AppConfig.h b/Demos/Device/ClassDriver/GenericHID/Config/AppConfig.h new file mode 100644 index 00000000..fccd16e3 --- /dev/null +++ b/Demos/Device/ClassDriver/GenericHID/Config/AppConfig.h @@ -0,0 +1,48 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define GENERIC_REPORT_SIZE 8 + +#endif \ No newline at end of file diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.h b/Demos/Device/ClassDriver/GenericHID/Descriptors.h index 0b9ec8f7..5e274047 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.h +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.h @@ -40,6 +40,8 @@ #include #include + + #include "Config/AppConfig.h" /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the @@ -63,9 +65,6 @@ /** Size in bytes of the Generic HID reporting endpoint. */ #define GENERIC_EPSIZE 8 - /** Size in bytes of the Generic HID reports (including report ID byte). */ - #define GENERIC_REPORT_SIZE 8 - /* Function Prototypes: */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.h b/Demos/Device/ClassDriver/GenericHID/GenericHID.h index ed3bb535..7512fa91 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.h +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.h @@ -44,7 +44,8 @@ #include #include "Descriptors.h" - + #include "Config/AppConfig.h" + #include #include #include diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.txt b/Demos/Device/ClassDriver/GenericHID/GenericHID.txt index db8eb1ce..998471a2 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.txt +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.txt @@ -67,9 +67,9 @@ * * * GENERIC_REPORT_SIZE - * Descriptors.h - * This token defines the size of the device reports, both sent and received. The value must be an - * integer ranging from 1 to 255. + * AppConfig.h + * This token defines the size of the device reports, both sent and received (including report ID byte). The value + * must be an integer ranging from 1 to 255. * * */ diff --git a/Demos/Device/ClassDriver/MassStorage/Config/AppConfig.h b/Demos/Device/ClassDriver/MassStorage/Config/AppConfig.h new file mode 100644 index 00000000..2582279e --- /dev/null +++ b/Demos/Device/ClassDriver/MassStorage/Config/AppConfig.h @@ -0,0 +1,50 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define TOTAL_LUNS 1 + + #define DISK_READ_ONLY false + +#endif \ No newline at end of file diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h index 18606eaf..a7c6105f 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h @@ -65,6 +65,9 @@ */ #define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE) + /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ + #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) + /* Function Prototypes: */ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.h b/Demos/Device/ClassDriver/MassStorage/MassStorage.h index da01449d..bd55dabf 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.h +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.h @@ -47,6 +47,7 @@ #include "Lib/SCSI.h" #include "Lib/DataflashManager.h" + #include "Config/AppConfig.h" #include #include @@ -68,15 +69,6 @@ /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ #define LEDMASK_USB_BUSY LEDS_LED2 - /** Total number of logical drives within the device - must be non-zero. */ - #define TOTAL_LUNS 1 - - /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ - #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) - - /** Indicates if the disk is write protected or not. */ - #define DISK_READ_ONLY false - /* Function Prototypes: */ void SetupHardware(void); diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.txt b/Demos/Device/ClassDriver/MassStorage/MassStorage.txt index e84e5842..c2761a38 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.txt +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.txt @@ -83,10 +83,15 @@ * * * TOTAL_LUNS - * MassStorage.h + * AppConfig.h * 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. * + * + * DISK_READ_ONLY + * AppConfig.h + * Configuration define, indicating if the disk should be write protected or not. + * * */ diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Config/AppConfig.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Config/AppConfig.h new file mode 100644 index 00000000..2582279e --- /dev/null +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Config/AppConfig.h @@ -0,0 +1,50 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define TOTAL_LUNS 1 + + #define DISK_READ_ONLY false + +#endif \ No newline at end of file diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h index f7552dc4..e5d25e0a 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h @@ -63,6 +63,9 @@ /** Total number of blocks of the virtual memory for reporting to the host as the device's total capacity. */ #define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE) + /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ + #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) + /* Function Prototypes: */ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h index 8f8fa002..dae07f9f 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h @@ -50,6 +50,7 @@ #include "Lib/SCSI.h" #include "Lib/DataflashManager.h" + #include "Config/AppConfig.h" #include #include @@ -73,15 +74,6 @@ /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ #define LEDMASK_USB_BUSY LEDS_LED2 - /** Total number of logical drives within the device - must be non-zero. */ - #define TOTAL_LUNS 1 - - /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ - #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) - - /** Indicates if the disk is write protected or not. */ - #define DISK_READ_ONLY false - /* Function Prototypes: */ void SetupHardware(void); diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt index ba0415b8..01bf5772 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.txt @@ -84,10 +84,14 @@ * * * TOTAL_LUNS - * MassStorage.h + * AppConfig.h * 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. * - * + * + * DISK_READ_ONLY + * AppConfig.h + * Configuration define, indicating if the disk should be write protected or not. + * */ diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Config/AppConfig.h b/Demos/Device/ClassDriver/RNDISEthernet/Config/AppConfig.h new file mode 100644 index 00000000..3b1ca536 --- /dev/null +++ b/Demos/Device/ClassDriver/RNDISEthernet/Config/AppConfig.h @@ -0,0 +1,60 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define CLIENT_IP_ADDRESS { 10, 0, 0, 1} + #define SERVER_IP_ADDRESS { 10, 0, 0, 2} + + #define ADAPTER_MAC_ADDRESS {0x02, 0x00, 0x02, 0x00, 0x02, 0x00} + #define SERVER_MAC_ADDRESS {0x00, 0x01, 0x00, 0x01, 0x00, 0x01} + + #define NO_DECODE_ETHERNET + #define NO_DECODE_ARP + #define NO_DECODE_IP + #define NO_DECODE_ICMP + #define NO_DECODE_TCP + #define NO_DECODE_UDP + #define NO_DECODE_DHCP + +#endif diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Config/NetworkConfig.h b/Demos/Device/ClassDriver/RNDISEthernet/Config/NetworkConfig.h deleted file mode 100644 index e6ac093a..00000000 --- a/Demos/Device/ClassDriver/RNDISEthernet/Config/NetworkConfig.h +++ /dev/null @@ -1,55 +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 Network Configuration Header File - * - * This header file is used to configure various portions of the - * network stack used by the application. - * - * For information on what each token does, refer to the LUFA - * manual section "Summary of Compile Tokens". - */ - -#ifndef _NETWORK_CONFIG_H_ -#define _NETWORK_CONFIG_H_ - - #define CLIENT_IP_ADDRESS { 10, 0, 0, 1} - #define SERVER_IP_ADDRESS { 10, 0, 0, 2} - - #define NO_DECODE_ETHERNET - #define NO_DECODE_ARP - #define NO_DECODE_IP - #define NO_DECODE_ICMP - #define NO_DECODE_TCP - #define NO_DECODE_UDP - #define NO_DECODE_DHCP - -#endif diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h index aeebd0ac..86e1a403 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h @@ -52,12 +52,6 @@ #include "IP.h" /* Macros: */ - /** Physical MAC address of the USB RNDIS network adapter. */ - #define ADAPTER_MAC_ADDRESS {0x02, 0x00, 0x02, 0x00, 0x02, 0x00} - - /** Physical MAC address of the virtual server on the network. */ - #define SERVER_MAC_ADDRESS {0x00, 0x01, 0x00, 0x01, 0x00, 0x01} - /** Physical MAC address of the network broadcast address. */ #define BROADCAST_MAC_ADDRESS {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h index 2d89ad52..d1a709fb 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h @@ -43,7 +43,7 @@ #include "EthernetProtocols.h" #include "Ethernet.h" #include "ProtocolDecoders.h" - #include "Config/NetworkConfig.h" + #include "Config/AppConfig.h" /* Macros: */ /** Protocol IP address of the broadcast address. */ diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h index aadbed82..bb640928 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h @@ -45,7 +45,7 @@ #include "EthernetProtocols.h" #include "Ethernet.h" - #include "Config/NetworkConfig.h" + #include "Config/AppConfig.h" /* Function Prototypes: */ void DecodeEthernetFrameHeader(void* InDataStart); diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt index f05ec65c..a458370d 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.txt @@ -84,38 +84,58 @@ * Description: * * + * CLIENT_IP_ADDRESS + * AppConfig.h + * Configures the IP address given to the client (PC) via the DHCP server. + * + * + * SERVER_IP_ADDRESS + * AppConfig.h + * Configures the IP address of the virtual server. + * + * + * ADAPTER_MAC_ADDRESS + * AppConfig.h + * Configures the MAC address of the RNDIS adapter on the host (PC) side. + * + * + * SERVER_MAC_ADDRESS + * AppConfig.h + * Configures the MAC address of the virtual server on the network. + * + * * NO_DECODE_ETHERNET - * NetworkConfig.h + * AppConfig.h * When defined, received Ethernet headers will not be decoded and printed to the device serial port. * * * NO_DECODE_ARP - * NetworkConfig.h + * AppConfig.h * When defined, received ARP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_IP - * NetworkConfig.h + * AppConfig.h * When defined, received IP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_ICMP - * NetworkConfig.h + * AppConfig.h * When defined, received ICMP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_TCP - * NetworkConfig.h + * AppConfig.h * When defined, received TCP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_UDP - * NetworkConfig.h + * AppConfig.h * When defined, received UDP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_DHCP - * NetworkConfig.h + * AppConfig.h * When defined, received DHCP headers will not be decoded and printed to the device serial port. * * diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/AppConfig.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/AppConfig.h new file mode 100644 index 00000000..2582279e --- /dev/null +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Config/AppConfig.h @@ -0,0 +1,50 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define TOTAL_LUNS 1 + + #define DISK_READ_ONLY false + +#endif \ No newline at end of file diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h index 1d123865..4b26c245 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h @@ -65,6 +65,9 @@ */ #define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE) + /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ + #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) + /* Function Prototypes: */ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h index 486351b2..49d63d08 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h @@ -47,6 +47,7 @@ #include "Lib/SCSI.h" #include "Lib/DataflashManager.h" + #include "Config/AppConfig.h" #include #include @@ -69,15 +70,6 @@ /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ #define LEDMASK_USB_BUSY LEDS_LED2 - /** Total number of logical drives within the device - must be non-zero. */ - #define TOTAL_LUNS 1 - - /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ - #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) - - /** Indicates if the disk is write protected or not. */ - #define DISK_READ_ONLY false - /* Function Prototypes: */ void SetupHardware(void); void CheckJoystickMovement(void); diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt index ff1d3c26..088f20ac 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.txt @@ -77,10 +77,14 @@ * * * TOTAL_LUNS - * MassStorage.h + * AppConfig.h * 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. * - * + * + * DISK_READ_ONLY + * AppConfig.h + * Configuration define, indicating if the disk should be write protected or not. + * */ diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index eb9c4b57..925517b3 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -77,7 +77,7 @@ void SetupHardware(void) USB_Init(); /* Start the ADC conversion in free running mode */ - ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | MIC_IN_ADC_MUX_MASK); + ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL)); } /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.h b/Demos/Device/LowLevel/AudioInput/AudioInput.h index fc209371..0539e069 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.h +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.h @@ -52,12 +52,6 @@ #include /* Macros: */ - /** ADC channel number for the microphone input. */ - #define MIC_IN_ADC_CHANNEL 2 - - /** ADC channel MUX mask for the microphone input. */ - #define MIC_IN_ADC_MUX_MASK ADC_CHANNEL2 - /** Maximum audio sample value for the microphone input. */ #define SAMPLE_MAX_RANGE 0xFFFF diff --git a/Demos/Device/LowLevel/AudioInput/Config/AppConfig.h b/Demos/Device/LowLevel/AudioInput/Config/AppConfig.h index 01101649..7702e259 100644 --- a/Demos/Device/LowLevel/AudioInput/Config/AppConfig.h +++ b/Demos/Device/LowLevel/AudioInput/Config/AppConfig.h @@ -43,6 +43,8 @@ #ifndef _APP_CONFIG_H_ #define _APP_CONFIG_H_ + #define MIC_IN_ADC_CHANNEL 2 + #define MICROPHONE_BIASED_TO_HALF_RAIL #define USE_TEST_TONE diff --git a/Demos/Device/LowLevel/GenericHID/Config/AppConfig.h b/Demos/Device/LowLevel/GenericHID/Config/AppConfig.h new file mode 100644 index 00000000..fccd16e3 --- /dev/null +++ b/Demos/Device/LowLevel/GenericHID/Config/AppConfig.h @@ -0,0 +1,48 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define GENERIC_REPORT_SIZE 8 + +#endif \ No newline at end of file diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.h b/Demos/Device/LowLevel/GenericHID/Descriptors.h index e47220a1..d9b7d42d 100644 --- a/Demos/Device/LowLevel/GenericHID/Descriptors.h +++ b/Demos/Device/LowLevel/GenericHID/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the * application code, as the configuration descriptor contains several sub-descriptors which @@ -67,9 +69,6 @@ /** Size in bytes of the Generic HID reporting endpoint. */ #define GENERIC_EPSIZE 8 - /** Size in bytes of the Generic HID reports (including report ID byte). */ - #define GENERIC_REPORT_SIZE 8 - /* Function Prototypes: */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.h b/Demos/Device/LowLevel/GenericHID/GenericHID.h index 0fe06bb6..29bcabcb 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.h +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.h @@ -45,7 +45,8 @@ #include #include "Descriptors.h" - + #include "Config/AppConfig.h" + #include #include #include diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.txt b/Demos/Device/LowLevel/GenericHID/GenericHID.txt index db8eb1ce..998471a2 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.txt +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.txt @@ -67,9 +67,9 @@ * * * GENERIC_REPORT_SIZE - * Descriptors.h - * This token defines the size of the device reports, both sent and received. The value must be an - * integer ranging from 1 to 255. + * AppConfig.h + * This token defines the size of the device reports, both sent and received (including report ID byte). The value + * must be an integer ranging from 1 to 255. * * */ diff --git a/Demos/Device/LowLevel/MassStorage/Config/AppConfig.h b/Demos/Device/LowLevel/MassStorage/Config/AppConfig.h new file mode 100644 index 00000000..2582279e --- /dev/null +++ b/Demos/Device/LowLevel/MassStorage/Config/AppConfig.h @@ -0,0 +1,50 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define TOTAL_LUNS 1 + + #define DISK_READ_ONLY false + +#endif \ No newline at end of file diff --git a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h index d70a86c1..7612ddad 100644 --- a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h +++ b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h @@ -45,7 +45,7 @@ #include #include #include - + /* Preprocessor Checks: */ #if (DATAFLASH_PAGE_SIZE % 16) #error Dataflash page size must be a multiple of 16 bytes. @@ -65,11 +65,6 @@ */ #define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE) - /** 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. - */ - #define TOTAL_LUNS 1 - /** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */ #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h index c1573706..e457a6ed 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.h +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h @@ -46,6 +46,7 @@ #include "Lib/SCSI.h" #include "Lib/DataflashManager.h" + #include "Config/AppConfig.h" #include #include @@ -68,9 +69,6 @@ /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ #define LEDMASK_USB_BUSY LEDS_LED2 - /** Indicates if the disk is write protected or not. */ - #define DISK_READ_ONLY false - /* Global Variables: */ extern MS_CommandBlockWrapper_t CommandBlock; extern MS_CommandStatusWrapper_t CommandStatus; diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.txt b/Demos/Device/LowLevel/MassStorage/MassStorage.txt index 8d048826..35b47a46 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.txt +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.txt @@ -83,10 +83,15 @@ * * * TOTAL_LUNS - * MassStorage.h + * AppConfig.h * 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. * + * + * DISK_READ_ONLY + * AppConfig.h + * Indicates if the disk should be write protected or not. + * * */ diff --git a/Demos/Device/LowLevel/Mouse/Mouse.h b/Demos/Device/LowLevel/Mouse/Mouse.h index c04f457a..182ea251 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.h +++ b/Demos/Device/LowLevel/Mouse/Mouse.h @@ -45,6 +45,7 @@ #include #include "Descriptors.h" + #include "Config/AppConfig.h" #include #include diff --git a/Demos/Device/LowLevel/RNDISEthernet/Config/AppConfig.h b/Demos/Device/LowLevel/RNDISEthernet/Config/AppConfig.h new file mode 100644 index 00000000..3b1ca536 --- /dev/null +++ b/Demos/Device/LowLevel/RNDISEthernet/Config/AppConfig.h @@ -0,0 +1,60 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define CLIENT_IP_ADDRESS { 10, 0, 0, 1} + #define SERVER_IP_ADDRESS { 10, 0, 0, 2} + + #define ADAPTER_MAC_ADDRESS {0x02, 0x00, 0x02, 0x00, 0x02, 0x00} + #define SERVER_MAC_ADDRESS {0x00, 0x01, 0x00, 0x01, 0x00, 0x01} + + #define NO_DECODE_ETHERNET + #define NO_DECODE_ARP + #define NO_DECODE_IP + #define NO_DECODE_ICMP + #define NO_DECODE_TCP + #define NO_DECODE_UDP + #define NO_DECODE_DHCP + +#endif diff --git a/Demos/Device/LowLevel/RNDISEthernet/Config/NetworkConfig.h b/Demos/Device/LowLevel/RNDISEthernet/Config/NetworkConfig.h deleted file mode 100644 index e6ac093a..00000000 --- a/Demos/Device/LowLevel/RNDISEthernet/Config/NetworkConfig.h +++ /dev/null @@ -1,55 +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 Network Configuration Header File - * - * This header file is used to configure various portions of the - * network stack used by the application. - * - * For information on what each token does, refer to the LUFA - * manual section "Summary of Compile Tokens". - */ - -#ifndef _NETWORK_CONFIG_H_ -#define _NETWORK_CONFIG_H_ - - #define CLIENT_IP_ADDRESS { 10, 0, 0, 1} - #define SERVER_IP_ADDRESS { 10, 0, 0, 2} - - #define NO_DECODE_ETHERNET - #define NO_DECODE_ARP - #define NO_DECODE_IP - #define NO_DECODE_ICMP - #define NO_DECODE_TCP - #define NO_DECODE_UDP - #define NO_DECODE_DHCP - -#endif diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h index 37d482de..06be6892 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h @@ -50,12 +50,6 @@ #include "IP.h" /* Macros: */ - /** Physical MAC address of the USB RNDIS network adapter. */ - #define ADAPTER_MAC_ADDRESS {0x02, 0x00, 0x02, 0x00, 0x02, 0x00} - - /** Physical MAC address of the virtual server on the network. */ - #define SERVER_MAC_ADDRESS {0x00, 0x01, 0x00, 0x01, 0x00, 0x01} - /** Physical MAC address of the network broadcast address. */ #define BROADCAST_MAC_ADDRESS {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h index b878693b..18c1c812 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h @@ -43,8 +43,7 @@ #include "EthernetProtocols.h" #include "Ethernet.h" #include "ProtocolDecoders.h" - - #include "Config/NetworkConfig.h" + #include "Config/AppConfig.h" /* Macros: */ /** Protocol IP address of the broadcast address. */ diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h index b3ad1aff..bb640928 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.h @@ -45,8 +45,7 @@ #include "EthernetProtocols.h" #include "Ethernet.h" - - #include "Config/NetworkConfig.h" + #include "Config/AppConfig.h" /* Function Prototypes: */ void DecodeEthernetFrameHeader(void* InDataStart); diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt index 08cb0532..a458370d 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.txt @@ -85,47 +85,57 @@ * * * CLIENT_IP_ADDRESS - * NetworkConfig.h + * AppConfig.h * Configures the IP address given to the client (PC) via the DHCP server. * * - * HOST_IP_ADDRESS - * NetworkConfig.h - * Configures the IP address used in the virtual server for communications to/from the client. + * SERVER_IP_ADDRESS + * AppConfig.h + * Configures the IP address of the virtual server. + * + * + * ADAPTER_MAC_ADDRESS + * AppConfig.h + * Configures the MAC address of the RNDIS adapter on the host (PC) side. + * + * + * SERVER_MAC_ADDRESS + * AppConfig.h + * Configures the MAC address of the virtual server on the network. * * * NO_DECODE_ETHERNET - * NetworkConfig.h + * AppConfig.h * When defined, received Ethernet headers will not be decoded and printed to the device serial port. * * * NO_DECODE_ARP - * NetworkConfig.h + * AppConfig.h * When defined, received ARP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_IP - * NetworkConfig.h + * AppConfig.h * When defined, received IP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_ICMP - * NetworkConfig.h + * AppConfig.h * When defined, received ICMP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_TCP - * NetworkConfig.h + * AppConfig.h * When defined, received TCP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_UDP - * NetworkConfig.h + * AppConfig.h * When defined, received UDP headers will not be decoded and printed to the device serial port. * * * NO_DECODE_DHCP - * NetworkConfig.h + * AppConfig.h * When defined, received DHCP headers will not be decoded and printed to the device serial port. * * diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c index 833be1b2..5f00568f 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c @@ -128,6 +128,9 @@ void SetupHardware(void) /* Create a stdio stream for the serial port for stdin and stdout */ Serial_CreateStream(NULL); + + /* Start the ADC conversion in free running mode */ + ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL)); } /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h index 41a4e9f1..fa4801bf 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h @@ -51,26 +51,16 @@ #include #include #include + + #include "Config/AppConfig.h" /* Macros: */ - /** ADC channel number for the microphone input. */ - #define MIC_IN_ADC_CHANNEL 2 - - /** ADC channel MUX mask for the microphone input. */ - #define MIC_IN_ADC_MUX_MASK ADC_CHANNEL2 - /** Maximum audio sample value for the microphone input. */ #define SAMPLE_MAX_RANGE 0xFFFF /** Maximum ADC range for the microphone input. */ #define ADC_MAX_RANGE 0x3FF - /** Defined to indicate that the microphone input voltage is biased to half the ADC reference voltage. */ - #define MICROPHONE_BIASED_TO_HALF_RAIL - - /** Defined to generate test tone when a button is pressed, rather than use a microphone for audio samples. */ - #define USE_TEST_TONE - /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.txt b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.txt index c28b61e4..b2cd2a8c 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.txt +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.txt @@ -63,14 +63,19 @@ * Description: * * + * MIC_IN_ADC_CHANNEL + * AppConfig.h + * Sets the ADC channel used by the demo for the input audio samples from an attached microphone. + * + * * USE_TEST_TONE - * AudioOutputHost.h + * AppConfig.h * When defined, this alters the demo to produce a square wave test tone when the first board button is pressed * instead of sampling the board microphone. * * * MICROPHONE_BIASED_TO_HALF_RAIL - * AudioOutputHost.h + * AppConfig.h * When defined, this alters the demo so that the half VCC bias of the microphone input is subtracted. * * diff --git a/Demos/Host/ClassDriver/AudioOutputHost/Config/AppConfig.h b/Demos/Host/ClassDriver/AudioOutputHost/Config/AppConfig.h new file mode 100644 index 00000000..7702e259 --- /dev/null +++ b/Demos/Host/ClassDriver/AudioOutputHost/Config/AppConfig.h @@ -0,0 +1,51 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define MIC_IN_ADC_CHANNEL 2 + + #define MICROPHONE_BIASED_TO_HALF_RAIL + #define USE_TEST_TONE + +#endif \ No newline at end of file diff --git a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c index a1f255f1..eddd38f9 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c +++ b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.c @@ -74,6 +74,9 @@ void SetupHardware(void) /* Create a stdio stream for the serial port for stdin and stdout */ Serial_CreateStream(NULL); + + /* Start the ADC conversion in free running mode */ + ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL)); } /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and diff --git a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h index 7f980cd8..2c475821 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h +++ b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h @@ -53,26 +53,15 @@ #include #include "ConfigDescriptor.h" + #include "Config/AppConfig.h" /* Macros: */ - /** ADC channel number for the microphone input. */ - #define MIC_IN_ADC_CHANNEL 2 - - /** ADC channel MUX mask for the microphone input. */ - #define MIC_IN_ADC_MUX_MASK ADC_CHANNEL2 - /** Maximum audio sample value for the microphone input. */ #define SAMPLE_MAX_RANGE 0xFFFF /** Maximum ADC range for the microphone input. */ #define ADC_MAX_RANGE 0x3FF - /** Defined to indicate that the microphone input voltage is biased to half the ADC reference voltage. */ - #define MICROPHONE_BIASED_TO_HALF_RAIL - - /** Defined to generate test tone when a button is pressed, rather than use a microphone for audio samples. */ - #define USE_TEST_TONE - /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ #define LEDMASK_USB_NOTREADY LEDS_LED1 diff --git a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.txt b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.txt index c28b61e4..b2cd2a8c 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.txt +++ b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.txt @@ -63,14 +63,19 @@ * Description: * * + * MIC_IN_ADC_CHANNEL + * AppConfig.h + * Sets the ADC channel used by the demo for the input audio samples from an attached microphone. + * + * * USE_TEST_TONE - * AudioOutputHost.h + * AppConfig.h * When defined, this alters the demo to produce a square wave test tone when the first board button is pressed * instead of sampling the board microphone. * * * MICROPHONE_BIASED_TO_HALF_RAIL - * AudioOutputHost.h + * AppConfig.h * When defined, this alters the demo so that the half VCC bias of the microphone input is subtracted. * * diff --git a/Demos/Host/LowLevel/AudioOutputHost/Config/AppConfig.h b/Demos/Host/LowLevel/AudioOutputHost/Config/AppConfig.h new file mode 100644 index 00000000..7702e259 --- /dev/null +++ b/Demos/Host/LowLevel/AudioOutputHost/Config/AppConfig.h @@ -0,0 +1,51 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define MIC_IN_ADC_CHANNEL 2 + + #define MICROPHONE_BIASED_TO_HALF_RAIL + #define USE_TEST_TONE + +#endif \ No newline at end of file diff --git a/LUFA.pnproj b/LUFA.pnproj index e2b9f394..520063da 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Projects/MIDIToneGenerator/Config/AppConfig.h b/Projects/MIDIToneGenerator/Config/AppConfig.h new file mode 100644 index 00000000..381efe08 --- /dev/null +++ b/Projects/MIDIToneGenerator/Config/AppConfig.h @@ -0,0 +1,48 @@ +/* + 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 Application Configuration Header File + * + * This is a header file which is be used to configure some of + * the application's compile time options, as an alternative to + * specifying the compile time constants supplied through a + * makefile or build system. + * + * For information on what each token does, refer to the + * \ref Sec_Options section of the application documentation. + */ + +#ifndef _APP_CONFIG_H_ +#define _APP_CONFIG_H_ + + #define MAX_SIMULTANEOUS_NOTES 3 + +#endif \ No newline at end of file diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.h b/Projects/MIDIToneGenerator/MIDIToneGenerator.h index 540c59a1..db11d5e0 100644 --- a/Projects/MIDIToneGenerator/MIDIToneGenerator.h +++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.h @@ -45,6 +45,7 @@ #include #include "Descriptors.h" + #include "Config/AppConfig.h" #include #include @@ -76,9 +77,6 @@ /** Lowest valid MIDI pitch index */ #define BASE_PITCH_INDEX 21 - /** Maximum number of MIDI notes that can be played simultaneously */ - #define MAX_SIMULTANEOUS_NOTES 3 - /** Number of samples in the virtual sample table (can be expanded to lower maximum frequency, but allow for * more simultaneous notes due to the reduced amount of processing time needed when the samples are spaced out) */ diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.txt b/Projects/MIDIToneGenerator/MIDIToneGenerator.txt index 6332a244..2650a9c0 100644 --- a/Projects/MIDIToneGenerator/MIDIToneGenerator.txt +++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.txt @@ -64,7 +64,7 @@ * * * MAX_SIMULTANEOUS_NOTES - * MIDIToneGenerator.h + * AppConfig.h * Sets the maximum number of MIDI notes that can be generated simultaneously. More notes require more processing time, * and thus a value that is too high will cause audiable sound distortion due to insufficient CPU time. * -- cgit v1.2.3 From cdca61a75407cd15e708e3db76bf91ef147740a3 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 15 May 2012 19:51:41 +0000 Subject: AppConfigHeaders: Make sure that in applications using an AppConfig.h configuration file, all application headers include the configuration file. git-svn-id: http://lufa-lib.googlecode.com/svn/branches/AppConfigHeaders@2218 d5102386-fcda-11dd-9fdb-3debd5008f28 --- Bootloaders/CDC/BootloaderAPI.h | 2 ++ Bootloaders/CDC/Descriptors.h | 2 ++ Bootloaders/DFU/BootloaderAPI.h | 2 ++ Bootloaders/DFU/Descriptors.h | 2 ++ Demos/Device/ClassDriver/AudioInput/AudioInput.h | 1 - Demos/Device/ClassDriver/AudioInput/Descriptors.h | 2 ++ Demos/Device/ClassDriver/AudioOutput/AudioOutput.h | 1 - Demos/Device/ClassDriver/AudioOutput/Descriptors.h | 2 ++ Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h | 1 - Demos/Device/ClassDriver/GenericHID/GenericHID.h | 1 - Demos/Device/ClassDriver/Joystick/Joystick.h | 1 - Demos/Device/ClassDriver/Keyboard/Keyboard.h | 1 - Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h | 1 - .../ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h | 1 - Demos/Device/ClassDriver/MIDI/MIDI.h | 1 - Demos/Device/ClassDriver/MassStorage/Descriptors.h | 2 ++ Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h | 3 ++- Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h | 3 ++- Demos/Device/ClassDriver/MassStorage/MassStorage.h | 1 - Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h | 2 ++ Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h | 3 ++- Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h | 3 ++- Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h | 1 - Demos/Device/ClassDriver/Mouse/Mouse.h | 1 - Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h | 2 ++ Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h | 2 ++ Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h | 4 ++-- Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h | 1 - Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h | 2 ++ .../ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h | 1 + Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h | 3 ++- .../ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h | 1 - Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h | 1 - Demos/Device/Incomplete/Sideshow/Sideshow.h | 1 - Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h | 1 - Demos/Device/LowLevel/AudioInput/AudioInput.h | 1 - Demos/Device/LowLevel/AudioInput/Descriptors.h | 2 ++ Demos/Device/LowLevel/AudioOutput/AudioOutput.h | 1 - Demos/Device/LowLevel/AudioOutput/Descriptors.h | 2 ++ Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h | 1 - Demos/Device/LowLevel/GenericHID/GenericHID.h | 1 - Demos/Device/LowLevel/Joystick/Joystick.h | 1 - Demos/Device/LowLevel/Keyboard/Keyboard.h | 1 - Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h | 1 - Demos/Device/LowLevel/MIDI/MIDI.h | 1 - Demos/Device/LowLevel/MassStorage/Descriptors.h | 2 ++ Demos/Device/LowLevel/MassStorage/MassStorage.h | 1 - Demos/Device/LowLevel/Mouse/Mouse.h | 1 - Demos/Device/LowLevel/RNDISEthernet/Descriptors.h | 2 ++ Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h | 2 ++ Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h | 4 ++-- Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h | 1 - Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h | 1 - Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h | 1 - Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h | 1 - Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h | 1 - .../Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h | 1 - Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h | 1 - .../Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h | 1 - Demos/Host/ClassDriver/MIDIHost/MIDIHost.h | 1 - Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h | 1 - Demos/Host/ClassDriver/MouseHost/MouseHost.h | 1 - Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h | 1 - Demos/Host/ClassDriver/PrinterHost/PrinterHost.h | 1 - Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h | 1 - Demos/Host/ClassDriver/StillImageHost/StillImageHost.h | 1 - Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h | 1 - Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h | 1 - Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h | 1 - Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h | 1 - Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h | 3 ++- Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h | 1 - Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h | 1 - Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h | 1 - Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h | 1 - Demos/Host/LowLevel/MIDIHost/MIDIHost.h | 1 - Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h | 1 - Demos/Host/LowLevel/MouseHost/MouseHost.h | 1 - Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h | 1 - Demos/Host/LowLevel/PrinterHost/PrinterHost.h | 1 - Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h | 1 - Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h | 1 - LUFA.pnproj | 2 +- Projects/AVRISP-MKII/AVRISP-MKII.h | 1 - Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h | 3 ++- Projects/AVRISP-MKII/Lib/V2Protocol.h | 2 +- Projects/AVRISP-MKII/Lib/V2ProtocolParams.h | 2 -- Projects/Benito/Benito.h | 1 - Projects/HIDReportViewer/HIDReportViewer.h | 1 - Projects/LEDNotifier/LEDNotifier.h | 1 - Projects/MIDIToneGenerator/Descriptors.h | 2 ++ Projects/MIDIToneGenerator/MIDIToneGenerator.h | 1 - Projects/Magstripe/Magstripe.h | 1 - Projects/MediaController/MediaController.h | 1 - Projects/MissileLauncher/MissileLauncher.h | 1 - Projects/RelayBoard/RelayBoard.h | 1 - Projects/SerialToLCD/SerialToLCD.h | 1 - Projects/TempDataLogger/Descriptors.h | 1 + Projects/TempDataLogger/TempDataLogger.h | 1 - Projects/USBtoSerial/USBtoSerial.h | 1 - Projects/Webserver/Descriptors.h | 2 ++ Projects/Webserver/USBDeviceMode.h | 5 +++-- Projects/Webserver/USBHostMode.h | 1 + Projects/Webserver/Webserver.h | 2 +- Projects/XPLAINBridge/AVRISPDescriptors.h | 2 ++ Projects/XPLAINBridge/Lib/SoftUART.h | 3 ++- Projects/XPLAINBridge/USARTDescriptors.h | 2 ++ Projects/XPLAINBridge/XPLAINBridge.h | 1 - 108 files changed, 69 insertions(+), 89 deletions(-) (limited to 'Bootloaders') diff --git a/Bootloaders/CDC/BootloaderAPI.h b/Bootloaders/CDC/BootloaderAPI.h index bd721842..d47c2efc 100644 --- a/Bootloaders/CDC/BootloaderAPI.h +++ b/Bootloaders/CDC/BootloaderAPI.h @@ -43,6 +43,8 @@ #include + #include "Config/AppConfig.h" + /* Function Prototypes: */ void BootloaderAPI_ErasePage(const uint32_t Address); void BootloaderAPI_WritePage(const uint32_t Address); diff --git a/Bootloaders/CDC/Descriptors.h b/Bootloaders/CDC/Descriptors.h index 0010fc69..6eec9d37 100644 --- a/Bootloaders/CDC/Descriptors.h +++ b/Bootloaders/CDC/Descriptors.h @@ -39,6 +39,8 @@ /* Includes: */ #include + #include "Config/AppConfig.h" + /* Macros: */ #if defined(__AVR_AT90USB1287__) #define AVR_SIGNATURE_1 0x1E diff --git a/Bootloaders/DFU/BootloaderAPI.h b/Bootloaders/DFU/BootloaderAPI.h index bd721842..8d040497 100644 --- a/Bootloaders/DFU/BootloaderAPI.h +++ b/Bootloaders/DFU/BootloaderAPI.h @@ -43,6 +43,8 @@ #include + #include "Config/AppConfig.h" + /* Function Prototypes: */ void BootloaderAPI_ErasePage(const uint32_t Address); void BootloaderAPI_WritePage(const uint32_t Address); diff --git a/Bootloaders/DFU/Descriptors.h b/Bootloaders/DFU/Descriptors.h index ce9cc937..e1ad51a8 100644 --- a/Bootloaders/DFU/Descriptors.h +++ b/Bootloaders/DFU/Descriptors.h @@ -39,6 +39,8 @@ /* Includes: */ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Descriptor type value for a DFU class functional descriptor. */ #define DTYPE_DFUFunctional 0x21 diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.h b/Demos/Device/ClassDriver/AudioInput/AudioInput.h index fb5e69c8..6af4a1ef 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.h +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.h @@ -42,7 +42,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.h b/Demos/Device/ClassDriver/AudioInput/Descriptors.h index 359a2873..a3f7f261 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Audio isochronous streaming data IN endpoint. */ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_IN | 1) diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h index 061cb051..19ba276f 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.h @@ -46,7 +46,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h index d5c8a2b8..4b294b80 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Audio isochronous streaming data OUT endpoint. */ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_OUT | 1) diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h index 320f7dc3..e29fdee3 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.h b/Demos/Device/ClassDriver/GenericHID/GenericHID.h index 7512fa91..4c4e33b2 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.h +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.h @@ -46,7 +46,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.h b/Demos/Device/ClassDriver/Joystick/Joystick.h index 4bc50565..8c51ae62 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.h +++ b/Demos/Device/ClassDriver/Joystick/Joystick.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.h b/Demos/Device/ClassDriver/Keyboard/Keyboard.h index f7995512..ed6600a3 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.h +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.h @@ -46,7 +46,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h index 14db865c..d86a4338 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h @@ -41,7 +41,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h index 14db865c..d86a4338 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.h @@ -41,7 +41,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.h b/Demos/Device/ClassDriver/MIDI/MIDI.h index b4d78272..fe49e89f 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.h +++ b/Demos/Device/ClassDriver/MIDI/MIDI.h @@ -46,7 +46,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.h b/Demos/Device/ClassDriver/MassStorage/Descriptors.h index 84879e82..643747b3 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3) diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h index a7c6105f..65c4f60b 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h @@ -41,7 +41,8 @@ #include "../MassStorage.h" #include "../Descriptors.h" - + #include "Config/AppConfig.h" + #include #include #include diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h index d4466238..610d3672 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h @@ -45,7 +45,8 @@ #include "../MassStorage.h" #include "../Descriptors.h" #include "DataflashManager.h" - + #include "Config/AppConfig.h" + /* Macros: */ /** Macro to set the current SCSI sense data to the given key, additional sense code and additional sense qualifier. This * is for convenience, as it allows for all three sense values (returned upon request to the host to give information about diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.h b/Demos/Device/ClassDriver/MassStorage/MassStorage.h index bd55dabf..957a880d 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.h +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.h @@ -49,7 +49,6 @@ #include "Lib/DataflashManager.h" #include "Config/AppConfig.h" - #include #include #include diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h index fb1a3794..f79cd2ee 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h @@ -42,6 +42,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Keyboard HID reporting IN endpoint. */ #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1) diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h index e5d25e0a..68356b2c 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h @@ -41,7 +41,8 @@ #include "../MassStorageKeyboard.h" #include "../Descriptors.h" - + #include "Config/AppConfig.h" + #include #include #include diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h index 5c3d3bf9..55ead069 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h @@ -45,7 +45,8 @@ #include "../MassStorageKeyboard.h" #include "../Descriptors.h" #include "DataflashManager.h" - + #include "Config/AppConfig.h" + /* Macros: */ /** Macro to set the current SCSI sense data to the given key, additional sense code and additional sense qualifier. This * is for convenience, as it allows for all three sense values (returned upon request to the host to give information about diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h index dae07f9f..6c0f1d9e 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h @@ -52,7 +52,6 @@ #include "Lib/DataflashManager.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.h b/Demos/Device/ClassDriver/Mouse/Mouse.h index 73f9742a..4d6c27e5 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.h +++ b/Demos/Device/ClassDriver/Mouse/Mouse.h @@ -47,7 +47,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h index 6301b83a..9baae86e 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3) diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h index 86e1a403..4e91bc26 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h @@ -42,6 +42,8 @@ #include + #include "Config/AppConfig.h" + #include "EthernetProtocols.h" #include "ProtocolDecoders.h" #include "ICMP.h" diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h index 6ff08964..e70fd5d6 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h @@ -49,8 +49,8 @@ #include "Lib/TCP.h" #include "Lib/ARP.h" #include "Lib/Webserver.h" - - #include + #include "Config/AppConfig.h" + #include #include #include diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h index ce7de149..3baeafeb 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h +++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.h @@ -46,7 +46,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h index 544a2b5c..e2d85626 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 1) diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h index 4b26c245..e9e2ef97 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/DataflashManager.h @@ -41,6 +41,7 @@ #include "../VirtualSerialMassStorage.h" #include "../Descriptors.h" + #include "Config/AppConfig.h" #include #include diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h index 83d5646c..01614cc1 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Lib/SCSI.h @@ -45,7 +45,8 @@ #include "../VirtualSerialMassStorage.h" #include "../Descriptors.h" #include "DataflashManager.h" - + #include "Config/AppConfig.h" + /* Macros: */ /** Macro to set the current SCSI sense data to the given key, additional sense code and additional sense qualifier. This * is for convenience, as it allows for all three sense values (returned upon request to the host to give information about diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h index 49d63d08..3d17971d 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.h @@ -49,7 +49,6 @@ #include "Lib/DataflashManager.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h index 22f86e59..7a5c1d76 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.h b/Demos/Device/Incomplete/Sideshow/Sideshow.h index 71ebe3f2..dc404ba8 100644 --- a/Demos/Device/Incomplete/Sideshow/Sideshow.h +++ b/Demos/Device/Incomplete/Sideshow/Sideshow.h @@ -40,7 +40,6 @@ #include "Descriptors.h" #include "Lib/SideshowCommands.h" - #include #include #include #include diff --git a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h index a688baeb..bd93154f 100644 --- a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h +++ b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h @@ -39,7 +39,6 @@ #include "Descriptors.h" - #include #include #include diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.h b/Demos/Device/LowLevel/AudioInput/AudioInput.h index 0539e069..f534e819 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.h +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.h @@ -45,7 +45,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.h b/Demos/Device/LowLevel/AudioInput/Descriptors.h index 4680294c..7c419a2f 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Audio isochronous streaming data IN endpoint. */ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_IN | 1) diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h index 3bcfc239..fad49ec0 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h @@ -45,7 +45,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.h b/Demos/Device/LowLevel/AudioOutput/Descriptors.h index e0c75674..c8b7feaf 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Audio isochronous streaming data OUT endpoint. */ #define AUDIO_STREAM_EPADDR (ENDPOINT_DIR_OUT | 1) diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h index cf7316ca..5edbb18f 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.h b/Demos/Device/LowLevel/GenericHID/GenericHID.h index 29bcabcb..26e63ce9 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.h +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.h @@ -47,7 +47,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include diff --git a/Demos/Device/LowLevel/Joystick/Joystick.h b/Demos/Device/LowLevel/Joystick/Joystick.h index f3cdf36b..7a7cf611 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.h +++ b/Demos/Device/LowLevel/Joystick/Joystick.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.h b/Demos/Device/LowLevel/Keyboard/Keyboard.h index 4936527e..140fa026 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.h +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.h @@ -47,7 +47,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h index a50a29e2..fe0c6501 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h @@ -42,7 +42,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/MIDI/MIDI.h b/Demos/Device/LowLevel/MIDI/MIDI.h index 8b08ddc1..f270c09f 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.h +++ b/Demos/Device/LowLevel/MIDI/MIDI.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.h b/Demos/Device/LowLevel/MassStorage/Descriptors.h index 34a85f6d..3732ee87 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.h +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3) diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h index e457a6ed..37f3ae5a 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.h +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h @@ -48,7 +48,6 @@ #include "Lib/DataflashManager.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/Mouse/Mouse.h b/Demos/Device/LowLevel/Mouse/Mouse.h index 182ea251..b304a61b 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.h +++ b/Demos/Device/LowLevel/Mouse/Mouse.h @@ -47,7 +47,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h index 6337335a..dd9bdd01 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the CDC device-to-host data IN endpoint. */ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1) diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h index 06be6892..45ba0cfd 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h @@ -40,6 +40,8 @@ #include #include + #include "Config/AppConfig.h" + #include "EthernetProtocols.h" #include "ProtocolDecoders.h" #include "ICMP.h" diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h index 6a91586a..155544cc 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h @@ -50,8 +50,8 @@ #include "Lib/TCP.h" #include "Lib/ARP.h" #include "Lib/Webserver.h" - - #include + #include "Config/AppConfig.h" + #include #include #include diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h index a62b468e..311f5090 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h index 990f2818..1e6971d9 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/MouseHostDevice.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h index b1a8bc15..95cecca5 100644 --- a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h +++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h index b7e1f5ad..f3424bdc 100644 --- a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h +++ b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h index fa4801bf..4c0d39fb 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h index 7ee25ec2..08047b00 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h index 8920ff88..730b49c8 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h index 2ad4171b..20b6356e 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h index 3607f016..907335f9 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h index 991cb77d..28791a2b 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h @@ -45,7 +45,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.h b/Demos/Host/ClassDriver/MouseHost/MouseHost.h index f8e8cf53..f3efe7f2 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.h +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h index 416d17dd..fd7f0a7c 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h index 13650cd7..e450aa16 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h index f0ef9033..e91b70c7 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h index c70a0c73..61de790b 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h index 5592db25..571c5bdf 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h index c699e251..454e389f 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h @@ -48,7 +48,6 @@ #include "ConfigDescriptor.h" #include "Lib/AndroidAccessoryCommands.h" - #include #include #include #include diff --git a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h index 4568ddd5..10b9d8bb 100644 --- a/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h +++ b/Demos/Host/LowLevel/AudioInputHost/AudioInputHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h index 2c475821..189abcfd 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h +++ b/Demos/Host/LowLevel/AudioOutputHost/AudioOutputHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h index 0c4f0676..0292ea45 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h @@ -40,7 +40,8 @@ #include #include "AudioOutputHost.h" - + #include "Config/AppConfig.h" + /* Macros: */ /** Pipe address for the Audio data OUT pipe. */ #define AUDIO_DATA_OUT_PIPE (PIPE_DIR_OUT | 1) diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h index 3e9d9fa5..22dd516d 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h index 8fc539e9..89a073c5 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h index 68d4bed6..e0b32684 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h index 680bc47a..547bd857 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -39,7 +39,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h index 780e6155..93a6869d 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h index 45baa558..db15af6a 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h @@ -50,7 +50,6 @@ #include "Lib/MassStoreCommands.h" - #include #include #include #include diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.h b/Demos/Host/LowLevel/MouseHost/MouseHost.h index 9c5d87c7..d5010564 100644 --- a/Demos/Host/LowLevel/MouseHost/MouseHost.h +++ b/Demos/Host/LowLevel/MouseHost/MouseHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h index 0c05efcc..ca18449d 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h index dcb826dd..581edd75 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h @@ -48,7 +48,6 @@ #include "ConfigDescriptor.h" #include "Lib/PrinterCommands.h" - #include #include #include #include diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h index a1dc414c..1a15f9a9 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h index c9395102..75cee27c 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h @@ -44,7 +44,6 @@ #include #include - #include #include #include #include diff --git a/LUFA.pnproj b/LUFA.pnproj index 520063da..afe7a9b9 100644 --- a/LUFA.pnproj +++ b/LUFA.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.h b/Projects/AVRISP-MKII/AVRISP-MKII.h index e7b41841..86e30d6c 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.h +++ b/Projects/AVRISP-MKII/AVRISP-MKII.h @@ -42,7 +42,6 @@ #include #include - #include #include #include diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h index 25d9720c..4c0ea824 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h @@ -44,7 +44,8 @@ #include #include - #include "../V2ProtocolParams.h" + #include "../V2Protocol.h" + #include "ISPProtocol.h" #include "Config/AppConfig.h" /* Preprocessor Checks: */ diff --git a/Projects/AVRISP-MKII/Lib/V2Protocol.h b/Projects/AVRISP-MKII/Lib/V2Protocol.h index 0032dec6..35cd1392 100644 --- a/Projects/AVRISP-MKII/Lib/V2Protocol.h +++ b/Projects/AVRISP-MKII/Lib/V2Protocol.h @@ -46,7 +46,7 @@ #include "../Descriptors.h" #include "V2ProtocolConstants.h" #include "V2ProtocolParams.h" - #include "ISP/ISPProtocol.h" +// #include "ISP/ISPProtocol.h" #include "XPROG/XPROGProtocol.h" #include "Config/AppConfig.h" diff --git a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h index 55cb64dd..53cad8de 100644 --- a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h +++ b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h @@ -40,8 +40,6 @@ #include #include - #include - #if defined(ADC) #include #endif diff --git a/Projects/Benito/Benito.h b/Projects/Benito/Benito.h index 184c1738..8585fc4a 100644 --- a/Projects/Benito/Benito.h +++ b/Projects/Benito/Benito.h @@ -44,7 +44,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Projects/HIDReportViewer/HIDReportViewer.h b/Projects/HIDReportViewer/HIDReportViewer.h index 64f5843a..79440b2a 100644 --- a/Projects/HIDReportViewer/HIDReportViewer.h +++ b/Projects/HIDReportViewer/HIDReportViewer.h @@ -45,7 +45,6 @@ #include #include - #include #include #include #include diff --git a/Projects/LEDNotifier/LEDNotifier.h b/Projects/LEDNotifier/LEDNotifier.h index 8e724915..8b775414 100644 --- a/Projects/LEDNotifier/LEDNotifier.h +++ b/Projects/LEDNotifier/LEDNotifier.h @@ -46,7 +46,6 @@ #include "Descriptors.h" - #include #include #include diff --git a/Projects/MIDIToneGenerator/Descriptors.h b/Projects/MIDIToneGenerator/Descriptors.h index 83844449..549eeb54 100644 --- a/Projects/MIDIToneGenerator/Descriptors.h +++ b/Projects/MIDIToneGenerator/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */ #define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 2) diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.h b/Projects/MIDIToneGenerator/MIDIToneGenerator.h index db11d5e0..9ebd828c 100644 --- a/Projects/MIDIToneGenerator/MIDIToneGenerator.h +++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.h @@ -47,7 +47,6 @@ #include "Descriptors.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Projects/Magstripe/Magstripe.h b/Projects/Magstripe/Magstripe.h index c7e9d052..2e2f63a7 100644 --- a/Projects/Magstripe/Magstripe.h +++ b/Projects/Magstripe/Magstripe.h @@ -48,7 +48,6 @@ #include "Lib/CircularBitBuffer.h" #include "Config/AppConfig.h" - #include #include /* Macros: */ diff --git a/Projects/MediaController/MediaController.h b/Projects/MediaController/MediaController.h index aeb91e77..fcfa7807 100644 --- a/Projects/MediaController/MediaController.h +++ b/Projects/MediaController/MediaController.h @@ -46,7 +46,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Projects/MissileLauncher/MissileLauncher.h b/Projects/MissileLauncher/MissileLauncher.h index 49036d39..c333f0f7 100644 --- a/Projects/MissileLauncher/MissileLauncher.h +++ b/Projects/MissileLauncher/MissileLauncher.h @@ -45,7 +45,6 @@ #include #include - #include #include #include #include diff --git a/Projects/RelayBoard/RelayBoard.h b/Projects/RelayBoard/RelayBoard.h index 709c009c..40f57064 100644 --- a/Projects/RelayBoard/RelayBoard.h +++ b/Projects/RelayBoard/RelayBoard.h @@ -45,7 +45,6 @@ #include "Descriptors.h" - #include #include #include diff --git a/Projects/SerialToLCD/SerialToLCD.h b/Projects/SerialToLCD/SerialToLCD.h index 52efe440..cd893058 100644 --- a/Projects/SerialToLCD/SerialToLCD.h +++ b/Projects/SerialToLCD/SerialToLCD.h @@ -46,7 +46,6 @@ #include "Descriptors.h" #include "Lib/HD44780.h" - #include #include #include diff --git a/Projects/TempDataLogger/Descriptors.h b/Projects/TempDataLogger/Descriptors.h index 5f981430..d48978c4 100644 --- a/Projects/TempDataLogger/Descriptors.h +++ b/Projects/TempDataLogger/Descriptors.h @@ -15,6 +15,7 @@ #include #include "TempDataLogger.h" + #include "Config/AppConfig.h" /* Macros: */ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ diff --git a/Projects/TempDataLogger/TempDataLogger.h b/Projects/TempDataLogger/TempDataLogger.h index b9c45fc5..cf212350 100644 --- a/Projects/TempDataLogger/TempDataLogger.h +++ b/Projects/TempDataLogger/TempDataLogger.h @@ -51,7 +51,6 @@ #include "Lib/DS1307.h" #include "Config/AppConfig.h" - #include #include #include #include diff --git a/Projects/USBtoSerial/USBtoSerial.h b/Projects/USBtoSerial/USBtoSerial.h index d094863e..ee2bd2f2 100644 --- a/Projects/USBtoSerial/USBtoSerial.h +++ b/Projects/USBtoSerial/USBtoSerial.h @@ -44,7 +44,6 @@ #include "Descriptors.h" - #include #include #include #include diff --git a/Projects/Webserver/Descriptors.h b/Projects/Webserver/Descriptors.h index 591947c8..969f47b1 100644 --- a/Projects/Webserver/Descriptors.h +++ b/Projects/Webserver/Descriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3) diff --git a/Projects/Webserver/USBDeviceMode.h b/Projects/Webserver/USBDeviceMode.h index 617c2627..86b3e919 100644 --- a/Projects/Webserver/USBDeviceMode.h +++ b/Projects/Webserver/USBDeviceMode.h @@ -40,10 +40,11 @@ #include #include "Webserver.h" - #include "Lib/uIPManagement.h" #include "Descriptors.h" + #include "Lib/uIPManagement.h" #include "Lib/SCSI.h" - + #include "Config/AppConfig.h" + /* External Variables: */ extern USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface_Device; diff --git a/Projects/Webserver/USBHostMode.h b/Projects/Webserver/USBHostMode.h index c9186589..d084e098 100644 --- a/Projects/Webserver/USBHostMode.h +++ b/Projects/Webserver/USBHostMode.h @@ -41,6 +41,7 @@ #include "Webserver.h" #include "Lib/uIPManagement.h" + #include "Config/AppConfig.h" /* External Variables: */ extern USB_ClassInfo_RNDIS_Host_t Ethernet_RNDIS_Interface_Host; diff --git a/Projects/Webserver/Webserver.h b/Projects/Webserver/Webserver.h index 199bc8ec..8c477116 100644 --- a/Projects/Webserver/Webserver.h +++ b/Projects/Webserver/Webserver.h @@ -43,7 +43,6 @@ #include #include - #include #include #include #include @@ -51,6 +50,7 @@ #include "USBDeviceMode.h" #include "USBHostMode.h" + #include "Config/AppConfig.h" /* Macros: */ /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */ diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.h b/Projects/XPLAINBridge/AVRISPDescriptors.h index c0eeedf7..b3541c82 100644 --- a/Projects/XPLAINBridge/AVRISPDescriptors.h +++ b/Projects/XPLAINBridge/AVRISPDescriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ #if !defined(LIBUSB_DRIVER_COMPAT) || defined(__DOXYGEN__) /** Endpoint address of the AVRISP data OUT endpoint. */ diff --git a/Projects/XPLAINBridge/Lib/SoftUART.h b/Projects/XPLAINBridge/Lib/SoftUART.h index c30ad651..e2492ce7 100644 --- a/Projects/XPLAINBridge/Lib/SoftUART.h +++ b/Projects/XPLAINBridge/Lib/SoftUART.h @@ -44,7 +44,8 @@ #include #include "../XPLAINBridge.h" - + #include "Config/AppConfig.h" + /* Macros: */ #define SRX PD0 #define SRXPIN PIND diff --git a/Projects/XPLAINBridge/USARTDescriptors.h b/Projects/XPLAINBridge/USARTDescriptors.h index 4bb771be..cc8db29c 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.h +++ b/Projects/XPLAINBridge/USARTDescriptors.h @@ -41,6 +41,8 @@ #include + #include "Config/AppConfig.h" + /* Macros: */ /** Endpoint address of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) diff --git a/Projects/XPLAINBridge/XPLAINBridge.h b/Projects/XPLAINBridge/XPLAINBridge.h index 7bba40fe..688ac7bd 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.h +++ b/Projects/XPLAINBridge/XPLAINBridge.h @@ -50,7 +50,6 @@ #include "Lib/SoftUART.h" #include "Config/AppConfig.h" - #include #include #include #include -- cgit v1.2.3