Add additional preprocessor sanity checks for the XMEGA platform based on the USB...
[pub/USBasp.git] / Demos / Host / Incomplete / BluetoothHost / ConfigDescriptor.c
index b09146c..fa19052 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2010.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  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
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -78,7 +78,7 @@ uint8_t ProcessConfigurationDescriptor(void)
 
        while (!(DataINEndpoint) || !(DataOUTEndpoint))
        {
 
        while (!(DataINEndpoint) || !(DataOUTEndpoint))
        {
-               /* Get the next Still Image interface's data endpoint descriptor */
+               /* Get the next Bluetooth interface's data endpoint descriptor */
                if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,
                                              DComp_NextInterfaceBluetoothDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
                {
                if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,
                                              DComp_NextInterfaceBluetoothDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
                {
@@ -90,7 +90,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);
 
                /* If the endpoint is a IN type endpoint */
                USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);
 
                /* If the endpoint is a IN type endpoint */
-               if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+               if ((EndpointData->EndpointAddress & ENDPOINT_DIR_MASK) == ENDPOINT_DIR_IN)
                {
                        /* Check if the found endpoint is a interrupt or bulk type descriptor */
                        if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)
                {
                        /* Check if the found endpoint is a interrupt or bulk type descriptor */
                        if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)
@@ -105,16 +105,13 @@ uint8_t ProcessConfigurationDescriptor(void)
        }
 
        /* Configure the Bluetooth data IN pipe */
        }
 
        /* Configure the Bluetooth data IN pipe */
-       Pipe_ConfigurePipe(BLUETOOTH_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN,
-                          DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+       Pipe_ConfigurePipe(BLUETOOTH_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1);
 
        /* Configure the Bluetooth data OUT pipe */
 
        /* Configure the Bluetooth data OUT pipe */
-       Pipe_ConfigurePipe(BLUETOOTH_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT,
-                                          DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+       Pipe_ConfigurePipe(BLUETOOTH_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1);
 
        /* Configure the Bluetooth events pipe */
 
        /* Configure the Bluetooth events pipe */
-       Pipe_ConfigurePipe(BLUETOOTH_EVENTS_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
-                                          EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, PIPE_BANK_SINGLE);
+       Pipe_ConfigurePipe(BLUETOOTH_EVENTS_PIPE, EP_TYPE_INTERRUPT, EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, 1);
        Pipe_SetInterruptPeriod(EventsEndpoint->PollingIntervalMS);
 
        /* Valid data found, return success */
        Pipe_SetInterruptPeriod(EventsEndpoint->PollingIntervalMS);
 
        /* Valid data found, return success */