Updated all host mode demos and projects to use the EVENT_USB_Host_DeviceEnumerationC...
[pub/USBasp.git] / LUFA / Drivers / USB / Core / AVR8 / USBController_AVR8.c
index 4802463..571ab6c 100644 (file)
@@ -178,15 +178,15 @@ void USB_ResetInterface(void)
 #if defined(USB_CAN_BE_DEVICE)
 static void USB_Init_Device(void)
 {
-       USB_DeviceState          = DEVICE_STATE_Unattached;
-       USB_ConfigurationNumber  = 0;
+       USB_DeviceState                 = DEVICE_STATE_Unattached;
+       USB_Device_ConfigurationNumber  = 0;
 
        #if !defined(NO_DEVICE_REMOTE_WAKEUP)
-       USB_RemoteWakeupEnabled  = false;
+       USB_Device_RemoteWakeupEnabled  = false;
        #endif
 
        #if !defined(NO_DEVICE_SELF_POWER)
-       USB_CurrentlySelfPowered = false;
+       USB_Device_CurrentlySelfPowered = false;
        #endif
 
        #if !defined(FIXED_CONTROL_ENDPOINT_SIZE)
@@ -199,21 +199,21 @@ static void USB_Init_Device(void)
        if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr, &DescriptorAddressSpace) != NO_DESCRIPTOR)
        {
                if (DescriptorAddressSpace == MEMSPACE_FLASH)
-                 USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
+                 USB_Device_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
                else if (DescriptorAddressSpace == MEMSPACE_EEPROM)
-                 USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
+                 USB_Device_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
                else
-                 USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;
+                 USB_Device_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;
        }
        #else
        if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR)
        {
                #if defined(USE_RAM_DESCRIPTORS)
-               USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;
+               USB_Device_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;
                #elif defined(USE_EEPROM_DESCRIPTORS)
-               USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
+               USB_Device_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
                #else
-               USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
+               USB_Device_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
                #endif
        }       
        #endif
@@ -229,7 +229,7 @@ static void USB_Init_Device(void)
        #endif
 
        Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
-                                                          ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
+                                                          ENDPOINT_DIR_OUT, USB_Device_ControlEndpointSize,
                                                           ENDPOINT_BANK_SINGLE);
 
        USB_INT_Clear(USB_INT_SUSPI);
@@ -243,8 +243,9 @@ static void USB_Init_Device(void)
 #if defined(USB_CAN_BE_HOST)
 static void USB_Init_Host(void)
 {
-       USB_HostState       = HOST_STATE_Unattached;
-       USB_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
+       USB_HostState                = HOST_STATE_Unattached;
+       USB_Host_ConfigurationNumber = 0;
+       USB_Host_ControlPipeSize     = PIPE_CONTROLPIPE_DEFAULT_SIZE;
 
        USB_Host_HostMode_On();
 
@@ -254,7 +255,7 @@ static void USB_Init_Host(void)
 
        USB_INT_Enable(USB_INT_SRPI);
        USB_INT_Enable(USB_INT_BCERRI);
-
+       
        USB_Attach();
 }
 #endif