aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/RNDISEthernet
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-04-14 14:41:17 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-04-14 14:41:17 +0000
commit47f6a35013b2c6a370e5dce29aa6da3a96844695 (patch)
tree3f5842347a696c92beb74bc255c9489e6c38f49d /Demos/Device/LowLevel/RNDISEthernet
parente8570c4a37e41117e3fd1e989e0b41f1e9608f3c (diff)
downloadlufa-47f6a35013b2c6a370e5dce29aa6da3a96844695.tar.gz
lufa-47f6a35013b2c6a370e5dce29aa6da3a96844695.tar.bz2
lufa-47f6a35013b2c6a370e5dce29aa6da3a96844695.zip
Reintegrate the FullEPAddresses development branch into trunk.
Diffstat (limited to 'Demos/Device/LowLevel/RNDISEthernet')
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/Descriptors.c6
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/Descriptors.h12
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c15
3 files changed, 15 insertions, 18 deletions
diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c
index 41bc4b59e..86cc420c7 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c
+++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM 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,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM 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
@@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.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
diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h
index 9ffa5262f..6337335ac 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h
+++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h
@@ -42,14 +42,14 @@
#include <avr/pgmspace.h>
/* Macros: */
- /** Endpoint number of the CDC device-to-host data IN endpoint. */
- #define CDC_TX_EPNUM 1
+ /** Endpoint address of the CDC device-to-host data IN endpoint. */
+ #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1)
- /** Endpoint number of the CDC host-to-device data OUT endpoint. */
- #define CDC_RX_EPNUM 2
+ /** Endpoint address of the CDC host-to-device data OUT endpoint. */
+ #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2)
- /** Endpoint number of the CDC device-to-host notification IN endpoint. */
- #define CDC_NOTIFICATION_EPNUM 3
+ /** Endpoint address of the CDC device-to-host notification IN endpoint. */
+ #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3)
/** Size in bytes of the CDC data IN and OUT endpoints. */
#define CDC_TXRX_EPSIZE 64
diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
index a36ecf4bb..c041bb91a 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
+++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
@@ -104,12 +104,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup RNDIS Data Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -170,7 +167,7 @@ void EVENT_USB_Device_ControlRequest(void)
void RNDIS_Task(void)
{
/* Select the notification endpoint */
- Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
+ Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPADDR);
/* Check if a message response is ready for the host */
if (Endpoint_IsINReady() && ResponseReady)
@@ -201,7 +198,7 @@ void RNDIS_Task(void)
RNDIS_Packet_Message_t RNDISPacketHeader;
/* Select the data OUT endpoint */
- Endpoint_SelectEndpoint(CDC_RX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_RX_EPADDR);
/* Check if the data OUT endpoint contains data, and that the IN buffer is empty */
if (Endpoint_IsOUTReceived() && !(FrameIN.FrameLength))
@@ -227,7 +224,7 @@ void RNDIS_Task(void)
}
/* Select the data IN endpoint */
- Endpoint_SelectEndpoint(CDC_TX_EPNUM);
+ Endpoint_SelectEndpoint(CDC_TX_EPADDR);
/* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */
if (Endpoint_IsINReady() && FrameOUT.FrameLength)