summaryrefslogtreecommitdiff
path: root/software
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2014-03-15 21:33:43 +0000
committerChristian Pointner <equinox@mur.at>2014-03-15 21:33:43 +0000
commit2f0ec3589ac3bda7970c9c055b19d0fe1ccc1c4c (patch)
tree45a01020263db914fbb0383c19fae7114c76ff48 /software
parentupdated avr utils (diff)
upgraded avr utils
git-svn-id: https://svn.spreadspace.org/mur.sat@881 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software')
-rw-r--r--software/avr.lib/anyio.c2
-rw-r--r--software/avr.lib/lufa-descriptor-keyboardmouse.c6
-rw-r--r--software/avr.lib/lufa-descriptor-midi.c337
-rw-r--r--software/avr.lib/lufa-descriptor-midi.h87
-rw-r--r--software/avr.lib/lufa-descriptor-rndis.c6
-rw-r--r--software/avr.lib/lufa-descriptor-usbdualserial.c6
-rw-r--r--software/avr.lib/lufa-descriptor-usbserial.c6
-rw-r--r--software/avr.lib/usbio.c2
-rw-r--r--software/avr.lib/util.c2
-rw-r--r--software/avr.lib/util.h2
-rw-r--r--software/hhd70dongle/Makefile4
-rw-r--r--software/idm-test/Makefile6
-rw-r--r--software/rda1846dongle/Makefile8
13 files changed, 458 insertions, 16 deletions
diff --git a/software/avr.lib/anyio.c b/software/avr.lib/anyio.c
index aaa5f47..6322feb 100644
--- a/software/avr.lib/anyio.c
+++ b/software/avr.lib/anyio.c
@@ -83,10 +83,12 @@ void anyio_init(const uint32_t baudrate, const uint8_t doublespeed)
void anyio_task(void)
{
+#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
if(USB_DeviceState == DEVICE_STATE_Unattached && USB_VBUS_GetStatus()) {
USB_Disable();
USB_Init();
}
+#endif
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
diff --git a/software/avr.lib/lufa-descriptor-keyboardmouse.c b/software/avr.lib/lufa-descriptor-keyboardmouse.c
index ca19381..acc319b 100644
--- a/software/avr.lib/lufa-descriptor-keyboardmouse.c
+++ b/software/avr.lib/lufa-descriptor-keyboardmouse.c
@@ -208,10 +208,11 @@ const USB_Descriptor_String_t PROGMEM LanguageString =
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
- .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
#ifndef USB_MANUFACTURER
+ .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_MANUFACTURER_LEN), .Type = DTYPE_String},
.UnicodeString = USB_MANUFACTURER
#endif
};
@@ -222,10 +223,11 @@ const USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
const USB_Descriptor_String_t PROGMEM ProductString =
{
- .Header = {.Size = USB_STRING_LEN(28), .Type = DTYPE_String},
#ifndef USB_PRODUCT
+ .Header = {.Size = USB_STRING_LEN(28), .Type = DTYPE_String},
.UnicodeString = L"LUFA Mouse and Keyboard Demo"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_PRODUCT_LEN), .Type = DTYPE_String},
.UnicodeString = USB_PRODUCT
#endif
};
diff --git a/software/avr.lib/lufa-descriptor-midi.c b/software/avr.lib/lufa-descriptor-midi.c
new file mode 100644
index 0000000..99fab41
--- /dev/null
+++ b/software/avr.lib/lufa-descriptor-midi.c
@@ -0,0 +1,337 @@
+/*
+ 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
+ *
+ * USB Device Descriptors, for library use when in USB device mode. Descriptors are special
+ * computer-readable structures which the host requests upon device enumeration, to determine
+ * the device's capabilities and functions.
+ */
+
+#include "lufa-descriptor-midi.h"
+
+/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
+ * device characteristics, including the supported USB version, control endpoint size and the
+ * number of device configurations. The descriptor is read out by the USB host when the enumeration
+ * process begins.
+ */
+const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+{
+ .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
+
+ .USBSpecification = VERSION_BCD(01.10),
+ .Class = USB_CSCP_NoDeviceClass,
+ .SubClass = USB_CSCP_NoDeviceSubclass,
+ .Protocol = USB_CSCP_NoDeviceProtocol,
+
+ .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
+
+ .VendorID = 0x03EB,
+ .ProductID = 0x2048,
+ .ReleaseNumber = VERSION_BCD(00.01),
+
+ .ManufacturerStrIndex = 0x01,
+ .ProductStrIndex = 0x02,
+ .SerialNumStrIndex = NO_DESCRIPTOR,
+
+ .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
+};
+
+/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
+ * of the device in one of its supported configurations, including information about any device interfaces
+ * and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
+ * a configuration so that the host may correctly communicate with the USB device.
+ */
+const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+{
+ .Config =
+ {
+ .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
+
+ .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
+ .TotalInterfaces = 2,
+
+ .ConfigurationNumber = 1,
+ .ConfigurationStrIndex = NO_DESCRIPTOR,
+
+ .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED),
+
+ .MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
+ },
+
+ .Audio_ControlInterface =
+ {
+ .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
+
+ .InterfaceNumber = 0,
+ .AlternateSetting = 0,
+
+ .TotalEndpoints = 0,
+
+ .Class = AUDIO_CSCP_AudioClass,
+ .SubClass = AUDIO_CSCP_ControlSubclass,
+ .Protocol = AUDIO_CSCP_ControlProtocol,
+
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+
+ .Audio_ControlInterface_SPC =
+ {
+ .Header = {.Size = sizeof(USB_Audio_Descriptor_Interface_AC_t), .Type = DTYPE_CSInterface},
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_Header,
+
+ .ACSpecification = VERSION_BCD(01.00),
+ .TotalLength = sizeof(USB_Audio_Descriptor_Interface_AC_t),
+
+ .InCollection = 1,
+ .InterfaceNumber = 1,
+ },
+
+ .Audio_StreamInterface =
+ {
+ .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
+
+ .InterfaceNumber = 1,
+ .AlternateSetting = 0,
+
+ .TotalEndpoints = 2,
+
+ .Class = AUDIO_CSCP_AudioClass,
+ .SubClass = AUDIO_CSCP_MIDIStreamingSubclass,
+ .Protocol = AUDIO_CSCP_StreamingProtocol,
+
+ .InterfaceStrIndex = NO_DESCRIPTOR
+ },
+
+ .Audio_StreamInterface_SPC =
+ {
+ .Header = {.Size = sizeof(USB_MIDI_Descriptor_AudioInterface_AS_t), .Type = DTYPE_CSInterface},
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_General,
+
+ .AudioSpecification = VERSION_BCD(01.00),
+
+ .TotalLength = (sizeof(USB_Descriptor_Configuration_t) -
+ offsetof(USB_Descriptor_Configuration_t, Audio_StreamInterface_SPC))
+ },
+
+ .MIDI_In_Jack_Emb =
+ {
+ .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
+
+ .JackType = MIDI_JACKTYPE_Embedded,
+ .JackID = 0x01,
+
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+
+ .MIDI_In_Jack_Ext =
+ {
+ .Header = {.Size = sizeof(USB_MIDI_Descriptor_InputJack_t), .Type = DTYPE_CSInterface},
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_InputTerminal,
+
+ .JackType = MIDI_JACKTYPE_External,
+ .JackID = 0x02,
+
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+
+ .MIDI_Out_Jack_Emb =
+ {
+ .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
+
+ .JackType = MIDI_JACKTYPE_Embedded,
+ .JackID = 0x03,
+
+ .NumberOfPins = 1,
+ .SourceJackID = {0x02},
+ .SourcePinID = {0x01},
+
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+
+ .MIDI_Out_Jack_Ext =
+ {
+ .Header = {.Size = sizeof(USB_MIDI_Descriptor_OutputJack_t), .Type = DTYPE_CSInterface},
+ .Subtype = AUDIO_DSUBTYPE_CSInterface_OutputTerminal,
+
+ .JackType = MIDI_JACKTYPE_External,
+ .JackID = 0x04,
+
+ .NumberOfPins = 1,
+ .SourceJackID = {0x01},
+ .SourcePinID = {0x01},
+
+ .JackStrIndex = NO_DESCRIPTOR
+ },
+
+ .MIDI_In_Jack_Endpoint =
+ {
+ .Endpoint =
+ {
+ .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
+
+ .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM),
+ .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = MIDI_STREAM_EPSIZE,
+ .PollingIntervalMS = 0x01
+ },
+
+ .Refresh = 0,
+ .SyncEndpointNumber = 0
+ },
+
+ .MIDI_In_Jack_Endpoint_SPC =
+ {
+ .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
+ .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
+
+ .TotalEmbeddedJacks = 0x01,
+ .AssociatedJackID = {0x01}
+ },
+
+ .MIDI_Out_Jack_Endpoint =
+ {
+ .Endpoint =
+ {
+ .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint},
+
+ .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM),
+ .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
+ .EndpointSize = MIDI_STREAM_EPSIZE,
+ .PollingIntervalMS = 0x01
+ },
+
+ .Refresh = 0,
+ .SyncEndpointNumber = 0
+ },
+
+ .MIDI_Out_Jack_Endpoint_SPC =
+ {
+ .Header = {.Size = sizeof(USB_MIDI_Descriptor_Jack_Endpoint_t), .Type = DTYPE_CSEndpoint},
+ .Subtype = AUDIO_DSUBTYPE_CSEndpoint_General,
+
+ .TotalEmbeddedJacks = 0x01,
+ .AssociatedJackID = {0x03}
+ }
+};
+
+/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
+ * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
+ * via the language ID table available at USB.org what languages the device supports for its string descriptors.
+ */
+const USB_Descriptor_String_t PROGMEM LanguageString =
+{
+ .Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
+
+ .UnicodeString = {LANGUAGE_ID_ENG}
+};
+
+/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
+ * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+const USB_Descriptor_String_t PROGMEM ManufacturerString =
+{
+#ifndef USB_MANUFACTURER
+ .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
+ .UnicodeString = L"Dean Camera"
+#else
+ .Header = {.Size = USB_STRING_LEN(USB_MANUFACTURER_LEN), .Type = DTYPE_String},
+ .UnicodeString = USB_MANUFACTURER
+#endif
+};
+
+/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
+ * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
+ * Descriptor.
+ */
+const USB_Descriptor_String_t PROGMEM ProductString =
+{
+#ifndef USB_PRODUCT
+ .Header = {.Size = USB_STRING_LEN(14), .Type = DTYPE_String},
+ .UnicodeString = L"LUFA MIDI Demo"
+#else
+ .Header = {.Size = USB_STRING_LEN(USB_PRODUCT_LEN), .Type = DTYPE_String},
+ .UnicodeString = USB_PRODUCT
+#endif
+};
+
+/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
+ * documentation) by the application code so that the address and size of a requested descriptor can be given
+ * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function
+ * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
+ * USB host.
+ */
+uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
+ const uint8_t wIndex,
+ const void** const DescriptorAddress)
+{
+ const uint8_t DescriptorType = (wValue >> 8);
+ const uint8_t DescriptorNumber = (wValue & 0xFF);
+
+ const void* Address = NULL;
+ uint16_t Size = NO_DESCRIPTOR;
+
+ switch (DescriptorType)
+ {
+ case DTYPE_Device:
+ Address = &DeviceDescriptor;
+ Size = sizeof(USB_Descriptor_Device_t);
+ break;
+ case DTYPE_Configuration:
+ Address = &ConfigurationDescriptor;
+ Size = sizeof(USB_Descriptor_Configuration_t);
+ break;
+ case DTYPE_String:
+ switch (DescriptorNumber)
+ {
+ case 0x00:
+ Address = &LanguageString;
+ Size = pgm_read_byte(&LanguageString.Header.Size);
+ break;
+ case 0x01:
+ Address = &ManufacturerString;
+ Size = pgm_read_byte(&ManufacturerString.Header.Size);
+ break;
+ case 0x02:
+ Address = &ProductString;
+ Size = pgm_read_byte(&ProductString.Header.Size);
+ break;
+ }
+
+ break;
+ }
+
+ *DescriptorAddress = Address;
+ return Size;
+}
+
diff --git a/software/avr.lib/lufa-descriptor-midi.h b/software/avr.lib/lufa-descriptor-midi.h
new file mode 100644
index 0000000..592ac9f
--- /dev/null
+++ b/software/avr.lib/lufa-descriptor-midi.h
@@ -0,0 +1,87 @@
+/*
+ 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
+ *
+ * Header file for Descriptors.c.
+ */
+
+#ifndef _DESCRIPTORS_H_
+#define _DESCRIPTORS_H_
+
+ /* Includes: */
+ #include <LUFA/Drivers/USB/USB.h>
+
+ #include <avr/pgmspace.h>
+
+ /* Macros: */
+ /** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */
+ #define MIDI_STREAM_IN_EPNUM 2
+
+ /** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */
+ #define MIDI_STREAM_OUT_EPNUM 1
+
+ /** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */
+ #define MIDI_STREAM_EPSIZE 64
+
+ /* 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
+ * vary between devices, and which describe the device's usage to the host.
+ */
+ typedef struct
+ {
+ USB_Descriptor_Configuration_Header_t Config;
+
+ // MIDI Audio Control Interface
+ USB_Descriptor_Interface_t Audio_ControlInterface;
+ USB_Audio_Descriptor_Interface_AC_t Audio_ControlInterface_SPC;
+
+ // MIDI Audio Streaming Interface
+ USB_Descriptor_Interface_t Audio_StreamInterface;
+ USB_MIDI_Descriptor_AudioInterface_AS_t Audio_StreamInterface_SPC;
+ USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Emb;
+ USB_MIDI_Descriptor_InputJack_t MIDI_In_Jack_Ext;
+ USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Emb;
+ USB_MIDI_Descriptor_OutputJack_t MIDI_Out_Jack_Ext;
+ USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_In_Jack_Endpoint;
+ USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_In_Jack_Endpoint_SPC;
+ USB_Audio_Descriptor_StreamEndpoint_Std_t MIDI_Out_Jack_Endpoint;
+ USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
+ } USB_Descriptor_Configuration_t;
+
+ /* Function Prototypes: */
+ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
+ const uint8_t wIndex,
+ const void** const DescriptorAddress)
+ ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+
+#endif
+
diff --git a/software/avr.lib/lufa-descriptor-rndis.c b/software/avr.lib/lufa-descriptor-rndis.c
index 28ea637..ba29037 100644
--- a/software/avr.lib/lufa-descriptor-rndis.c
+++ b/software/avr.lib/lufa-descriptor-rndis.c
@@ -191,10 +191,11 @@ const USB_Descriptor_String_t PROGMEM LanguageString =
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
- .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
#ifndef USB_MANUFACTURER
+ .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_MANUFACTURER_LEN), .Type = DTYPE_String},
.UnicodeString = USB_MANUFACTURER
#endif
};
@@ -205,10 +206,11 @@ const USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
const USB_Descriptor_String_t PROGMEM ProductString =
{
- .Header = {.Size = USB_STRING_LEN(23), .Type = DTYPE_String},
#ifndef USB_PRODUCT
+ .Header = {.Size = USB_STRING_LEN(23), .Type = DTYPE_String},
.UnicodeString = L"LUFA USB-RS232 Adapter"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_PRODUCT_LEN), .Type = DTYPE_String},
.UnicodeString = USB_PRODUCT
#endif
};
diff --git a/software/avr.lib/lufa-descriptor-usbdualserial.c b/software/avr.lib/lufa-descriptor-usbdualserial.c
index 0d506c7..639391c 100644
--- a/software/avr.lib/lufa-descriptor-usbdualserial.c
+++ b/software/avr.lib/lufa-descriptor-usbdualserial.c
@@ -318,10 +318,11 @@ const USB_Descriptor_String_t PROGMEM LanguageString =
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
- .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
#ifndef USB_MANUFACTURER
+ .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_MANUFACTURER_LEN), .Type = DTYPE_String},
.UnicodeString = USB_MANUFACTURER
#endif
};
@@ -332,10 +333,11 @@ const USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
const USB_Descriptor_String_t PROGMEM ProductString =
{
- .Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
#ifndef USB_PRODUCT
+ .Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
.UnicodeString = L"LUFA Dual CDC Demo"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_PRODUCT_LEN), .Type = DTYPE_String},
.UnicodeString = USB_PRODUCT
#endif
};
diff --git a/software/avr.lib/lufa-descriptor-usbserial.c b/software/avr.lib/lufa-descriptor-usbserial.c
index 1c049be..fa2ef25 100644
--- a/software/avr.lib/lufa-descriptor-usbserial.c
+++ b/software/avr.lib/lufa-descriptor-usbserial.c
@@ -204,10 +204,11 @@ const USB_Descriptor_String_t PROGMEM LanguageString =
*/
const USB_Descriptor_String_t PROGMEM ManufacturerString =
{
- .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
#ifndef USB_MANUFACTURER
+ .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_MANUFACTURER_LEN), .Type = DTYPE_String},
.UnicodeString = USB_MANUFACTURER
#endif
};
@@ -218,10 +219,11 @@ const USB_Descriptor_String_t PROGMEM ManufacturerString =
*/
const USB_Descriptor_String_t PROGMEM ProductString =
{
- .Header = {.Size = USB_STRING_LEN(23), .Type = DTYPE_String},
#ifndef USB_PRODUCT
+ .Header = {.Size = USB_STRING_LEN(23), .Type = DTYPE_String},
.UnicodeString = L"LUFA USB-RS232 Adapter"
#else
+ .Header = {.Size = USB_STRING_LEN(USB_PRODUCT_LEN), .Type = DTYPE_String},
.UnicodeString = USB_PRODUCT
#endif
};
diff --git a/software/avr.lib/usbio.c b/software/avr.lib/usbio.c
index 6a7f76e..6f15b53 100644
--- a/software/avr.lib/usbio.c
+++ b/software/avr.lib/usbio.c
@@ -83,10 +83,12 @@ void usbio_init(void)
void usbio_task(void)
{
+#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)
if(USB_DeviceState == DEVICE_STATE_Unattached && USB_VBUS_GetStatus()) {
USB_Disable();
USB_Init();
}
+#endif
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
diff --git a/software/avr.lib/util.c b/software/avr.lib/util.c
index 8b74dfb..104f2b6 100644
--- a/software/avr.lib/util.c
+++ b/software/avr.lib/util.c
@@ -37,6 +37,7 @@ void cpu_init(void)
CPU_PRESCALE(0);
}
+#if defined JTD
void jtag_disable(void)
{
uint8_t tempreg;
@@ -47,6 +48,7 @@ void jtag_disable(void)
: [tempreg] "=d" (tempreg)
: [mcucr] "I" (_SFR_IO_ADDR(MCUCR)), [jtd] "M" (_BV(JTD)));
}
+#endif
#if defined(__BOARD_teensy1__)
#define BOOTLOADER_VEC 0x3E00
diff --git a/software/avr.lib/util.h b/software/avr.lib/util.h
index 18c1eca..bdd2968 100644
--- a/software/avr.lib/util.h
+++ b/software/avr.lib/util.h
@@ -24,7 +24,9 @@
#define SPREADAVR_util_h_INCLUDED
void cpu_init(void);
+#if defined JTD
void jtag_disable(void);
+#endif
void reset2bootloader(void);
#endif
diff --git a/software/hhd70dongle/Makefile b/software/hhd70dongle/Makefile
index 1519a5f..1fea29b 100644
--- a/software/hhd70dongle/Makefile
+++ b/software/hhd70dongle/Makefile
@@ -38,8 +38,8 @@ 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 USB_MANUFACTURER="L\"mur.sat\""
-LUFA_OPTS += -D USB_PRODUCT="L\"$(NAME)\""
+LUFA_OPTS += -D USB_MANUFACTURER="L\"mur.sat\"" -D USB_MANUFACTURER_LEN=7
+LUFA_OPTS += -D USB_PRODUCT="L\"HHD70 usb dongle\"" -D USB_PRODUCT_LEN=16
LUFA_COMPONENTS := USB USBCLASS
diff --git a/software/idm-test/Makefile b/software/idm-test/Makefile
index 7bc31bd..3b43e30 100644
--- a/software/idm-test/Makefile
+++ b/software/idm-test/Makefile
@@ -36,7 +36,9 @@ 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 USB_MANUFACTURER="L\"mur.sat\""
-LUFA_OPTS += -D USB_PRODUCT="L\"$(NAME)\""
+LUFA_OPTS += -D USB_MANUFACTURER="L\"mur.sat\"" -D USB_MANUFACTURER_LEN=7
+LUFA_OPTS += -D USB_PRODUCT="L\"idm-test\"" -D USB_PRODUCT_LEN=8
+
+LUFA_COMPONENTS := USB USBCLASS
include ../avr.include.mk
diff --git a/software/rda1846dongle/Makefile b/software/rda1846dongle/Makefile
index 4cb6cea..ea3bcfa 100644
--- a/software/rda1846dongle/Makefile
+++ b/software/rda1846dongle/Makefile
@@ -8,10 +8,10 @@
## ESC im Labor and realraum.
##
## Please visit the project hompage at sat.mur.at for further information.
-##
+##
##
## Copyright (C) 2011 Christian Pointner <equinox@mur.at>
-##
+##
## This file is part of mur.sat.
##
## mur.sat is free software: you can redistribute it and/or modify
@@ -47,8 +47,8 @@ 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 USB_MANUFACTURER="L\"mur.sat\""
-LUFA_OPTS += -D USB_PRODUCT="L\"$(NAME)\""
+LUFA_OPTS += -D USB_MANUFACTURER="L\"mur.sat\"" -D USB_MANUFACTURER_LEN=7
+LUFA_OPTS += -D USB_PRODUCT="L\"RDA1846 usb dongle\"" -D USB_PRODUCT_LEN=18
LUFA_COMPONENTS := USB USBCLASS TWI