summaryrefslogtreecommitdiff
path: root/digital/avr/modules/usb/test
diff options
context:
space:
mode:
Diffstat (limited to 'digital/avr/modules/usb/test')
-rw-r--r--digital/avr/modules/usb/test/descriptors.c20
-rw-r--r--digital/avr/modules/usb/test/descriptors.h20
-rw-r--r--digital/avr/modules/usb/test/test_usb.c20
-rw-r--r--digital/avr/modules/usb/test/test_usb.h41
4 files changed, 36 insertions, 65 deletions
diff --git a/digital/avr/modules/usb/test/descriptors.c b/digital/avr/modules/usb/test/descriptors.c
index 4ccc7b49..a3b46ee0 100644
--- a/digital/avr/modules/usb/test/descriptors.c
+++ b/digital/avr/modules/usb/test/descriptors.c
@@ -22,8 +22,26 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* }}} */
+#include "common.h"
+
+#include "modules/usb/usb.h"
+
+#include <avr/pgmspace.h>
+
#include "descriptors.h"
+/* Configuration structure. */
+typedef struct
+{
+ USB_Descriptor_Configuration_Header_t Config;
+ USB_Descriptor_Interface_t TS1_Interface;
+ USB_Descriptor_Endpoint_t TS1_DataOutEndpoint;
+ USB_Descriptor_Endpoint_t TS1_DataInEndpoint;
+ USB_Descriptor_Interface_t TS2_Interface;
+ USB_Descriptor_Endpoint_t TS2_DataOutEndpoint;
+ USB_Descriptor_Endpoint_t TS2_DataInEndpoint;
+} USB_Descriptor_Configuration_t;
+
USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
Header: { Size: sizeof (USB_Descriptor_Device_t), Type: DTYPE_Device },
@@ -144,7 +162,7 @@ USB_Descriptor_String_t PROGMEM ProductString =
uint16_t
USB_GetDescriptor (const uint16_t wValue, const uint8_t wIndex,
- void** const DescriptorAddress)
+ void ** const DescriptorAddress)
{
const uint8_t DescriptorType = wValue >> 8;
const uint8_t DescriptorNumber = wValue & 0xFF;
diff --git a/digital/avr/modules/usb/test/descriptors.h b/digital/avr/modules/usb/test/descriptors.h
index f7052672..388f0fd0 100644
--- a/digital/avr/modules/usb/test/descriptors.h
+++ b/digital/avr/modules/usb/test/descriptors.h
@@ -24,8 +24,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* }}} */
-#include <LUFA/Drivers/USB/USB.h>
-#include <avr/pgmspace.h>
/* Endpoints. */
#define TS1_TX_EPNUM 1
@@ -34,22 +32,4 @@
#define TS2_RX_EPNUM 4
#define TS_TXRX_EPSIZE 16
-/* Configuration structure. */
-typedef struct
-{
- USB_Descriptor_Configuration_Header_t Config;
- USB_Descriptor_Interface_t TS1_Interface;
- USB_Descriptor_Endpoint_t TS1_DataOutEndpoint;
- USB_Descriptor_Endpoint_t TS1_DataInEndpoint;
- USB_Descriptor_Interface_t TS2_Interface;
- USB_Descriptor_Endpoint_t TS2_DataOutEndpoint;
- USB_Descriptor_Endpoint_t TS2_DataInEndpoint;
-} USB_Descriptor_Configuration_t;
-
-/* Used by LUFA to get descriptors. */
-uint16_t
-USB_GetDescriptor (const uint16_t wValue, const uint8_t wIndex,
- void** const DescriptorAddress)
-ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG (3);
-
#endif /* descriptors_h */
diff --git a/digital/avr/modules/usb/test/test_usb.c b/digital/avr/modules/usb/test/test_usb.c
index 5442c0fd..93a6084b 100644
--- a/digital/avr/modules/usb/test/test_usb.c
+++ b/digital/avr/modules/usb/test/test_usb.c
@@ -22,12 +22,26 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* }}} */
-#include "test_usb.h"
+#include "common.h"
-/** Based on DualCDC example from LUFA. Refers to LUFA Demos for more
+#include "modules/usb/usb.h"
+#include "io.h"
+
+#include <avr/wdt.h>
+
+#include "descriptors.h"
+
+/**
+ * Based on DualCDC example from LUFA. Refers to LUFA Demos for more
* comments. There is only 4 endpoints on the at90usb162, therefore a dual
* CDC-ACM cannot be implemented. To access this dual "serial port", use a
- * generic usb_serial driver. */
+ * generic usb_serial driver.
+ */
+
+HANDLES_EVENT (USB_Connect);
+HANDLES_EVENT (USB_Disconnect);
+HANDLES_EVENT (USB_ConfigurationChanged);
+HANDLES_EVENT (USB_UnhandledControlPacket);
volatile uint8_t USB_USBTask_run;
volatile uint8_t TS1Task_run;
diff --git a/digital/avr/modules/usb/test/test_usb.h b/digital/avr/modules/usb/test/test_usb.h
deleted file mode 100644
index 36b2e27e..00000000
--- a/digital/avr/modules/usb/test/test_usb.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef test_usb_h
-#define test_usb_h
-/* test_usb.h */
-/* usb - USB device module using LUFA. {{{
- *
- * Copyright (C) 2009 Nicolas Schodet
- *
- * APBTeam:
- * Web: http://apbteam.org/
- * Email: team AT apbteam DOT org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * }}} */
-#include <avr/io.h>
-#include <avr/wdt.h>
-#include <string.h>
-
-#include "descriptors.h"
-
-#include <LUFA/Version.h>
-#include <LUFA/Drivers/USB/USB.h>
-
-HANDLES_EVENT (USB_Connect);
-HANDLES_EVENT (USB_Disconnect);
-HANDLES_EVENT (USB_ConfigurationChanged);
-HANDLES_EVENT (USB_UnhandledControlPacket);
-
-#endif /* test_usb_h */