Renamed all library events to properly seperate out Device and Host mode events....
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 5 Aug 2009 06:36:31 +0000 (06:36 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 5 Aug 2009 06:36:31 +0000 (06:36 +0000)
Remove VBUS events - not needed as the library takes care of VBUS detection and feedback on supported AVRs via the USB_Device_Connected and USB_Device_Disconnected events.

Fixed incorrect Host state assignment in the incomplete BluetoothHost demo.

120 files changed:
Bootloaders/CDC/BootloaderCDC.c
Bootloaders/CDC/BootloaderCDC.h
Bootloaders/DFU/BootloaderDFU.c
Bootloaders/DFU/BootloaderDFU.h
Bootloaders/TeensyHID/TeensyHID.c
Bootloaders/TeensyHID/TeensyHID.h
Bootloaders/TeensyHID/TeensyHID.txt
Demos/Device/ClassDriver/AudioInput/AudioInput.c
Demos/Device/ClassDriver/AudioInput/AudioInput.h
Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
Demos/Device/ClassDriver/AudioOutput/AudioOutput.h
Demos/Device/ClassDriver/CDC/CDC.c
Demos/Device/ClassDriver/CDC/CDC.h
Demos/Device/ClassDriver/DualCDC/DualCDC.c
Demos/Device/ClassDriver/DualCDC/DualCDC.h
Demos/Device/ClassDriver/GenericHID/GenericHID.c
Demos/Device/ClassDriver/GenericHID/GenericHID.h
Demos/Device/ClassDriver/Joystick/Joystick.c
Demos/Device/ClassDriver/Joystick/Joystick.h
Demos/Device/ClassDriver/Keyboard/Keyboard.c
Demos/Device/ClassDriver/Keyboard/Keyboard.h
Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h
Demos/Device/ClassDriver/MIDI/MIDI.c
Demos/Device/ClassDriver/MIDI/MIDI.h
Demos/Device/ClassDriver/MassStorage/MassStorage.c
Demos/Device/ClassDriver/MassStorage/MassStorage.h
Demos/Device/ClassDriver/Mouse/Mouse.c
Demos/Device/ClassDriver/Mouse/Mouse.h
Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.h
Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.h
Demos/Device/Incomplete/Sideshow/Sideshow.c
Demos/Device/Incomplete/Sideshow/Sideshow.h
Demos/Device/LowLevel/AudioInput/AudioInput.c
Demos/Device/LowLevel/AudioInput/AudioInput.h
Demos/Device/LowLevel/AudioOutput/AudioOutput.c
Demos/Device/LowLevel/AudioOutput/AudioOutput.h
Demos/Device/LowLevel/CDC/CDC.c
Demos/Device/LowLevel/CDC/CDC.h
Demos/Device/LowLevel/DualCDC/DualCDC.c
Demos/Device/LowLevel/DualCDC/DualCDC.h
Demos/Device/LowLevel/GenericHID/GenericHID.c
Demos/Device/LowLevel/GenericHID/GenericHID.h
Demos/Device/LowLevel/Joystick/Joystick.c
Demos/Device/LowLevel/Joystick/Joystick.h
Demos/Device/LowLevel/Keyboard/Keyboard.c
Demos/Device/LowLevel/Keyboard/Keyboard.h
Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c
Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h
Demos/Device/LowLevel/MIDI/MIDI.c
Demos/Device/LowLevel/MIDI/MIDI.h
Demos/Device/LowLevel/MassStorage/MassStorage.c
Demos/Device/LowLevel/MassStorage/MassStorage.h
Demos/Device/LowLevel/Mouse/Mouse.c
Demos/Device/LowLevel/Mouse/Mouse.h
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h
Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c
Demos/Device/LowLevel/USBtoSerial/USBtoSerial.h
Demos/Host/ClassDriver/CDCHost/CDCHost.c
Demos/Host/ClassDriver/CDCHost/CDCHost.h
Demos/Host/ClassDriver/MouseHost/MouseHost.c
Demos/Host/ClassDriver/MouseHost/MouseHost.h
Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.c
Demos/Host/LowLevel/CDCHost/CDCHost.c
Demos/Host/LowLevel/CDCHost/CDCHost.h
Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c
Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h
Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c
Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h
Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h
Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h
Demos/Host/LowLevel/MouseHost/MouseHost.c
Demos/Host/LowLevel/MouseHost/MouseHost.h
Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h
Demos/Host/LowLevel/PrinterHost/PrinterHost.c
Demos/Host/LowLevel/PrinterHost/PrinterHost.h
Demos/Host/LowLevel/StillImageHost/StillImageHost.c
Demos/Host/LowLevel/StillImageHost/StillImageHost.h
Demos/OTG/TestApp/TestEvents.c
Demos/OTG/TestApp/TestEvents.h
LUFA/Drivers/USB/Class/Device/Audio.c
LUFA/Drivers/USB/Class/Device/Audio.h
LUFA/Drivers/USB/Class/Device/CDC.c
LUFA/Drivers/USB/Class/Device/CDC.h
LUFA/Drivers/USB/Class/Device/HID.c
LUFA/Drivers/USB/Class/Device/HID.h
LUFA/Drivers/USB/Class/Device/MIDI.c
LUFA/Drivers/USB/Class/Device/MIDI.h
LUFA/Drivers/USB/Class/Device/MassStorage.c
LUFA/Drivers/USB/Class/Device/MassStorage.h
LUFA/Drivers/USB/Class/Device/RNDIS.c
LUFA/Drivers/USB/Class/Device/RNDIS.h
LUFA/Drivers/USB/HighLevel/Events.h
LUFA/Drivers/USB/HighLevel/StdRequestType.h
LUFA/Drivers/USB/HighLevel/USBInterrupt.c
LUFA/Drivers/USB/HighLevel/USBTask.c
LUFA/Drivers/USB/HighLevel/USBTask.h
LUFA/Drivers/USB/LowLevel/DevChapter9.c
LUFA/Drivers/USB/LowLevel/DevChapter9.h
LUFA/Drivers/USB/LowLevel/Host.c
LUFA/Drivers/USB/LowLevel/Host.h
LUFA/Drivers/USB/LowLevel/LowLevel.c
LUFA/Drivers/USB/LowLevel/LowLevel.h
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/CompileTimeTokens.txt
LUFA/ManPages/MigrationInformation.txt
Projects/Benito/Benito.c
Projects/Benito/Benito.h
Projects/Magstripe/Magstripe.c
Projects/Magstripe/Magstripe.h
Projects/MissileLauncher/MissileLauncher.c
Projects/MissileLauncher/MissileLauncher.h

index cbcfd7e..6769a0c 100644 (file)
@@ -119,7 +119,7 @@ void ResetHardware(void)
 /** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
  *  application started.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Upon disconnection, run user application */\r
        RunBootloader = false;\r
@@ -128,7 +128,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready\r
  *  to relay data to and from the attached USB host.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Setup CDC Notification, Rx and Tx Endpoints */\r
        Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -144,11 +144,11 @@ void EVENT_USB_ConfigurationChanged(void)
                                   ENDPOINT_BANK_SINGLE);\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library, so that they can be handled appropriately\r
  *  for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        uint8_t* LineCodingData = (uint8_t*)&LineCoding;\r
 \r
index fa98a15..13a4f9f 100644 (file)
                void SetupHardware(void);\r
                void ResetHardware(void);\r
 \r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                #if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__)\r
                        static void    ReadWriteMemoryBlock(const uint8_t Command);\r
index f9c8195..fb326a1 100644 (file)
@@ -144,17 +144,17 @@ void ResetHardware(void)
 /** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
  *  application started.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Upon disconnection, run user application */\r
        RunBootloader = false;\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the DFU commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Get the size of the command and data from the wLength value */\r
        SentCommand.DataSize = USB_ControlRequest.wLength;\r
index 9366c22..11d91db 100644 (file)
                void SetupHardware(void);\r
                void ResetHardware(void);\r
 \r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                #if defined(INCLUDE_FROM_BOOTLOADER_C)\r
                        static void DiscardFillerBytes(uint8_t NumberOfBytes);\r
index 5252668..bb5a0c7 100644 (file)
@@ -84,7 +84,7 @@ void SetupHardware(void)
 /** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready\r
  *  to relay data to and from the attached USB host.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Setup HID Report Endpoint */\r
        Endpoint_ConfigureEndpoint(HID_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -92,11 +92,11 @@ void EVENT_USB_ConfigurationChanged(void)
                                   ENDPOINT_BANK_SINGLE);\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the HID commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 3c59605..a05729a 100644 (file)
@@ -64,7 +64,7 @@
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
                \r
 #endif\r
index 93862c6..4cf1308 100644 (file)
@@ -47,7 +47,7 @@
  * This bootloader enumerates to the host as a HID Class device, allowing for Teensy compatible programming\r
  * software to load firmware onto the AVR, such as the official software at http://www.pjrc.com/teensy/.\r
  *  \r
- * Out of the box this bootloader builds for the USB162, and will fit into 2KB of bootloader space.\r
+ * Out of the box this bootloader builds for the AT90USB162, and will fit into 4KB of bootloader space.\r
  *\r
  * This spoofs (with permission) the official Teensy bootloader's VID and PID, so that the software remains\r
  * compatible with no changes.\r
index 59d2129..3aa26ae 100644 (file)
@@ -112,7 +112,7 @@ void ProcessNextSample(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 \r
@@ -123,7 +123,7 @@ void EVENT_USB_Connect(void)
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Stop the sample reload timer */\r
        TCCR0B = 0;\r
@@ -132,7 +132,7 @@ void EVENT_USB_Disconnect(void)
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
        \r
@@ -140,8 +140,8 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       Audio_Device_ProcessControlPacket(&Microphone_Audio_Interface);\r
+       Audio_Device_ProcessControlRequest(&Microphone_Audio_Interface);\r
 }\r
index f262673..03e2a6d 100644 (file)
@@ -76,9 +76,9 @@
                void SetupHardware(void);\r
                void ProcessNextSample(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index 9a8804a..d7de7d5 100644 (file)
@@ -140,7 +140,7 @@ void ProcessNextSample(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
        \r
@@ -169,7 +169,7 @@ void EVENT_USB_Connect(void)
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 \r
@@ -194,7 +194,7 @@ void EVENT_USB_Disconnect(void)
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
        \r
@@ -202,8 +202,8 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       Audio_Device_ProcessControlPacket(&Speaker_Audio_Interface);\r
+       Audio_Device_ProcessControlRequest(&Speaker_Audio_Interface);\r
 }\r
index 9846a76..d31a8e6 100644 (file)
@@ -68,9 +68,9 @@
                void SetupHardware(void);\r
                void ProcessNextSample(void);\r
                \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index 8e3530c..4f64646 100644 (file)
@@ -155,19 +155,19 @@ void CheckJoystickMovement(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -175,8 +175,8 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);\r
+       CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
 }\r
index 255cd86..ee375a4 100644 (file)
@@ -67,9 +67,9 @@
                void SetupHardware(void);\r
                void CheckJoystickMovement(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index 82ed59d..e5406a4 100644 (file)
@@ -163,19 +163,19 @@ void CheckJoystickMovement(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -186,9 +186,9 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       CDC_Device_ProcessControlPacket(&VirtualSerial1_CDC_Interface);\r
-       CDC_Device_ProcessControlPacket(&VirtualSerial2_CDC_Interface);\r
+       CDC_Device_ProcessControlRequest(&VirtualSerial1_CDC_Interface);\r
+       CDC_Device_ProcessControlRequest(&VirtualSerial2_CDC_Interface);\r
 }\r
index 0f1a764..2f12aca 100644 (file)
@@ -67,9 +67,9 @@
                void SetupHardware(void);\r
                void CheckJoystickMovement(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index 323d693..13db6bf 100644 (file)
@@ -103,19 +103,19 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -123,10 +123,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       HID_Device_ProcessControlPacket(&Generic_HID_Interface);\r
+       HID_Device_ProcessControlRequest(&Generic_HID_Interface);\r
 }\r
 \r
 /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
index 50a92ec..8cf0afc 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
                                                  void* ReportData, uint16_t* ReportSize);\r
index f4dc32d..ea85aad 100644 (file)
@@ -97,19 +97,19 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -117,10 +117,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       HID_Device_ProcessControlPacket(&Joystick_HID_Interface);\r
+       HID_Device_ProcessControlRequest(&Joystick_HID_Interface);\r
 }\r
 \r
 /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
index 764de17..493dfa0 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
                                                  void* ReportData, uint16_t* ReportSize);\r
index 040aec4..6f0bd1d 100644 (file)
@@ -98,19 +98,19 @@ void SetupHardware()
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -118,10 +118,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);\r
+       HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);\r
 }\r
 \r
 /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
index 4a28d20..0f7176c 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
                                                  void* ReportData, uint16_t* ReportSize);\r
index abaf380..e219990 100644 (file)
@@ -121,19 +121,19 @@ void SetupHardware()
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
     LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
     LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -144,11 +144,11 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);\r
-       HID_Device_ProcessControlPacket(&Mouse_HID_Interface);\r
+       HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);\r
+       HID_Device_ProcessControlRequest(&Mouse_HID_Interface);\r
 }\r
 \r
 /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
index 15532c8..2975641 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
                                                  void* ReportData, uint16_t* ReportSize);\r
index fcb86d6..f1a0d9a 100644 (file)
@@ -157,19 +157,19 @@ void CheckJoystickMovement(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
        \r
@@ -177,8 +177,8 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       MIDI_Device_ProcessControlPacket(&Keyboard_MIDI_Interface);\r
+       MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface);\r
 }\r
index bc90382..7c1484d 100644 (file)
@@ -69,9 +69,9 @@
                void SetupHardware(void);\r
                void CheckJoystickMovement(void);\r
                \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
                \r
 #endif\r
index 6a4612e..52ed2d9 100644 (file)
@@ -92,19 +92,19 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -112,10 +112,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       MS_Device_ProcessControlPacket(&Disk_MS_Interface);\r
+       MS_Device_ProcessControlRequest(&Disk_MS_Interface);\r
 }\r
 \r
 /** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed.\r
index 7149778..e6b2bf9 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo);\r
 \r
index 08e87e6..d261013 100644 (file)
@@ -96,20 +96,20 @@ void SetupHardware(void)
        TIMSK0 = (1 << OCIE0A);\r
 }\r
 \r
-/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+/** Event handler for the library USB WakeUp event. */\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
-/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+/** Event handler for the library USB Suspend event. */\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -117,10 +117,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_Device_UnhandledControlRequest(void)\r
 {\r
-       HID_Device_ProcessControlPacket(&Mouse_HID_Interface);\r
+       HID_Device_ProcessControlRequest(&Mouse_HID_Interface);\r
 }\r
 \r
 /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
index 57e4a69..709077f 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Device_Connect(void);\r
+               void EVENT_USB_Device_Device_Disconnect(void);\r
+               void EVENT_USB_Device_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_Device_UnhandledControlRequest(void);\r
 \r
                bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
                                                  void* ReportData, uint16_t* ReportSize);\r
index 81d31c9..905f4ef 100644 (file)
@@ -107,19 +107,19 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -127,8 +127,8 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       RNDIS_Device_ProcessControlPacket(&Ethernet_RNDIS_Interface);\r
+       RNDIS_Device_ProcessControlRequest(&Ethernet_RNDIS_Interface);\r
 }\r
index c5503e2..b91a54d 100644 (file)
@@ -76,9 +76,9 @@
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
        \r
 #endif\r
index e51963c..b78a6d3 100644 (file)
@@ -116,19 +116,19 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -136,10 +136,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlPacket(void)\r
 {\r
-       CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);\r
+       CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
 }\r
 \r
 /** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer\r
index 3ee7e89..4ceb931 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
                \r
                void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
 \r
index d67fae0..fdf4265 100644 (file)
@@ -82,17 +82,17 @@ void SetupHardware(void)
        SerialStream_Init(9600, false);\r
 }\r
 \r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 \r
@@ -112,7 +112,7 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Process UFI specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index c8d3b53..f2890ef 100644 (file)
@@ -65,9 +65,9 @@
                void SetupHardware(void);\r
                void SideShow_Task(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index bf79016..a01c672 100644 (file)
@@ -78,7 +78,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and\r
  *  configures the sample update and PWM timers.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -92,7 +92,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Stop the sample reload timer */\r
        TCCR0B = 0;\r
@@ -107,7 +107,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -121,11 +121,11 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the Audio class-specific\r
  *  requests) so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Process General and Audio specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 591d3f3..f74491d 100644 (file)
@@ -74,9 +74,9 @@
                void SetupHardware(void);\r
                void USB_Audio_Task(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
                \r
 #endif\r
index 7dde84b..1128e8f 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and\r
  *  configures the sample update and PWM timers.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -105,7 +105,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Stop the timers */\r
        TCCR0B = 0;\r
@@ -134,7 +134,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -148,11 +148,11 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the Audio class-specific\r
  *  requests) so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Process General and Audio specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 6c8d733..362a554 100644 (file)
@@ -65,9 +65,9 @@
                void SetupHardware(void);\r
                void USB_Audio_Task(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index 4b5409f..9ee744e 100644 (file)
@@ -143,7 +143,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -152,7 +152,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the USB management and CDC management tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -161,7 +161,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured and the CDC management task started.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -187,13 +187,16 @@ void EVENT_USB_ConfigurationChanged(void)
        {\r
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
        }\r
+       \r
+       /* Reset line encoding baud rate so that the host knows to send new values */\r
+       LineEncoding.BaudRateBPS = 0;\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the CDC control commands,\r
  *  which are all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Process CDC specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index a8f7199..4a7b6b1 100644 (file)
                void SetupHardware(void);\r
                void CDC_Task(void);\r
                \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index 654ce86..c49a1ad 100644 (file)
@@ -97,7 +97,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -106,7 +106,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the USB management and CDC management tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -115,7 +115,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured and the CDC management tasks are started.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {                                                         \r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -163,13 +163,17 @@ void EVENT_USB_ConfigurationChanged(void)
        {\r
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
        }\r
+       \r
+       /* Reset line encoding baud rates so that the host knows to send new values */\r
+       LineEncoding1.BaudRateBPS = 0;\r
+       LineEncoding2.BaudRateBPS = 0;\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the CDC control commands,\r
  *  which are all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Determine which interface's Line Coding data is being set from the wIndex parameter */\r
        uint8_t* LineEncodingData = (USB_ControlRequest.wIndex == 0) ? (uint8_t*)&LineEncoding1 : (uint8_t*)&LineEncoding2;\r
index d6f09e6..b2085c4 100644 (file)
                void CDC2_Task(void);\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
                \r
 #endif\r
index 34c991f..5a8bb51 100644 (file)
@@ -74,7 +74,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -83,7 +83,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the USB management task.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -92,7 +92,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
  *  of the USB device after enumeration, and configures the generic HID device endpoints.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -114,11 +114,11 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the HID commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index fbd0a7f..c036517 100644 (file)
                void SetupHardware(void);\r
                void HID_Task(void);\r
        \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                void ProcessGenericHIDReport(uint8_t* DataArray);\r
                void CreateGenericHIDReport(uint8_t* DataArray);\r
index db2415e..306baa9 100644 (file)
@@ -72,7 +72,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -81,7 +81,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the USB management and joystick reporting tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -90,7 +90,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured and the joystick reporting task started.\r
  */ \r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -104,11 +104,11 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the HID commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index c50d7f0..db280ee 100644 (file)
                void SetupHardware(void);\r
                void HID_Task(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                bool GetNextReport(USB_JoystickReport_Data_t* ReportData);\r
 \r
index e27b228..f8310ab 100644 (file)
@@ -96,7 +96,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -108,7 +108,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -117,7 +117,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
  *  of the USB device after enumeration, and configures the keyboard device endpoints.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {      \r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -139,11 +139,11 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the HID commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 2a2ebdc..bc478f3 100644 (file)
                void SetupHardware(void);\r
                void HID_Task(void);\r
        \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData);\r
                void ProcessLEDReport(uint8_t LEDReport);\r
index 7d486e1..bfd337a 100644 (file)
@@ -80,7 +80,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -89,7 +89,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the USB management task.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -98,7 +98,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
  *  of the USB device after enumeration, and configures the keyboard and mouse device endpoints.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -132,7 +132,7 @@ void EVENT_USB_ConfigurationChanged(void)
  *  control requests that are not handled internally by the USB library (including the HID commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        uint8_t* ReportData;\r
        uint8_t  ReportSize;\r
index 138f0fc..37cb7f6 100644 (file)
@@ -98,9 +98,9 @@
                void Keyboard_HID_Task(void);\r
                void Mouse_HID_Task(void);\r
                \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
                \r
 #endif\r
index 8aed527..4dfb9b7 100644 (file)
@@ -70,7 +70,7 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -79,7 +79,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs, disables the sample update and PWM output timers and stops the USB and MIDI management tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -88,7 +88,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured and the MIDI management task started.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
index 3b9b938..3e7a06d 100644 (file)
@@ -95,8 +95,8 @@
                void SetupHardware(void);\r
                void MIDI_Task(void);\r
    \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
                \r
 #endif\r
index 01d27f0..1a2d8d4 100644 (file)
@@ -83,7 +83,7 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -95,7 +95,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the Mass Storage management task.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -104,7 +104,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured and the Mass Storage management task started.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -129,7 +129,7 @@ void EVENT_USB_ConfigurationChanged(void)
  *  control requests that are not handled internally by the USB library (including the Mass Storage class-specific\r
  *  requests) so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Process UFI specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 81fba00..868daf0 100644 (file)
                void SetupHardware(void);\r
                void MassStorage_Task(void);\r
        \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                #if defined(INCLUDE_FROM_MASSSTORAGE_C)\r
                        static bool ReadInCommandBlock(void);\r
index d15f688..48f0461 100644 (file)
@@ -96,7 +96,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -108,7 +108,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the USB management and Mouse reporting tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -117,7 +117,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured and the mouse reporting task started.\r
  */ \r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -131,11 +131,11 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the HID commands, which are\r
  *  all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 8ff8b8f..b244ffa 100644 (file)
                void SetupHardware(void);\r
                void Mouse_Task(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                void CreateMouseReport(USB_MouseReport_Data_t* ReportData);\r
 \r
index ca38c24..b722187 100644 (file)
@@ -79,7 +79,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -88,7 +88,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops all the relevant tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        /* Indicate USB not ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -97,7 +97,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
  *  of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevant tasks.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -125,11 +125,11 @@ void EVENT_USB_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the RNDIS control commands,\r
  *  which set up the USB RNDIS network adapter), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Process RNDIS class commands */\r
        switch (USB_ControlRequest.bRequest)\r
index 5cbddee..3ae8966 100644 (file)
@@ -94,9 +94,9 @@
                void RNDIS_Task(void);\r
                void Ethernet_Task(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
        \r
 #endif\r
index 2765064..bb1b4da 100644 (file)
@@ -89,7 +89,7 @@ void SetupHardware(void)
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -98,7 +98,7 @@ void EVENT_USB_Connect(void)
 /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
  *  the status LEDs and stops the USB management and CDC management tasks.\r
  */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {      \r
        /* Reset Tx and Rx buffers, device disconnected */\r
        Buffer_Initialize(&Rx_Buffer);\r
@@ -111,7 +111,7 @@ void EVENT_USB_Disconnect(void)
 /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
  *  of the USB device after enumeration - the device endpoints are configured and the CDC management task started.\r
  */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        /* Indicate USB connected and ready */\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
@@ -137,13 +137,16 @@ void EVENT_USB_ConfigurationChanged(void)
        {\r
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
        }\r
+\r
+       /* Reset line encoding baud rate so that the host knows to send new values */\r
+       LineEncoding.BaudRateBPS = 0;\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
  *  control requests that are not handled internally by the USB library (including the CDC control commands,\r
  *  which are all issued via the control endpoint), so that they can be handled appropriately for the application.\r
  */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        /* Process CDC specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 51c47c9..d9567a1 100644 (file)
                void CDC_Task(void);\r
                void ReconfigureUSART(void);\r
        \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
 #endif\r
index 6678b22..92a558c 100644 (file)
@@ -130,7 +130,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -139,7 +139,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR("\r\nDevice Unattached.\r\n"));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -148,13 +148,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -168,7 +168,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index c219a19..87a0bbc 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
                \r
 #endif\r
index ec43163..76a1238 100644 (file)
@@ -132,7 +132,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -141,7 +141,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR("\r\nDevice Unattached.\r\n"));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -150,13 +150,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -170,7 +170,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 0287825..9f92be0 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
                \r
 #endif\r
index a52ba7c..25c15a9 100644 (file)
@@ -75,26 +75,26 @@ void SetupHardware(void)
        USB_Init();\r
 }\r
 \r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
 \r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
 \r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
-void EVENT_USB_HostError(uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -105,7 +105,7 @@ void EVENT_USB_HostError(uint8_t ErrorCode)
        for(;;);\r
 }\r
 \r
-void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
@@ -158,9 +158,6 @@ void Bluetooth_Management_Task(void)
                                break;\r
                        }\r
                                \r
-                       USB_HostState = HOST_STATE_Configured;\r
-                       break;\r
-               case HOST_STATE_Configured:\r
                        puts_P(PSTR("Getting Config Data.\r\n"));\r
                \r
                        /* Get and process the configuration descriptor data */\r
@@ -183,7 +180,7 @@ void Bluetooth_Management_Task(void)
 \r
                        puts_P(PSTR("Bluetooth Dongle Enumerated.\r\n"));\r
 \r
-                       USB_HostState = HOST_STATE_Ready;\r
+                       USB_HostState = HOST_STATE_Configured;\r
                        break;\r
        }\r
 }\r
index d44a38a..0246bff 100644 (file)
                void Bluetooth_Management_Task(void);\r
                \r
        /* Event Handlers: */\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
-               void EVENT_USB_HostError(uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
 \r
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
index 54291bf..3b8bcde 100644 (file)
@@ -398,7 +398,7 @@ void Bluetooth_ProcessHCICommands(void)
                        {\r
                                while (!(Bluetooth_GetNextHCIEventHeader()))\r
                                {                               \r
-                                       if (USB_DeviceState == DEVICE_STATE_Unattached)\r
+                                       if (USB_HostState == HOST_STATE_Unattached)\r
                                          return;\r
                                }\r
 \r
index e20fa2c..a423b90 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 9e1d638..95faa7d 100644 (file)
                void SetupHardware(void);\r
                void CDC_Host_Task(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
                \r
 #endif\r
index d360643..33397b6 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 415dae0..4a64b57 100644 (file)
                void SetupHardware(void);\r
                void HID_Host_Task(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void ReadNextReport(void);\r
                void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t ReportType, uint16_t ReportLength);\r
index 1a53526..f40e7b9 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 98a9e37..aed6ca6 100644 (file)
                void Keyboard_HID_Task(void);\r
                void SetupHardware(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void ReadNextReport(void);\r
                \r
index 2cc08a1..ef73b77 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 90db94a..8453bb6 100644 (file)
                void Keyboard_HID_Task(void);\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void ProcessKeyboardReport(uint8_t* KeyboardReport);\r
                \r
index 6cfe669..60eb98a 100644 (file)
@@ -79,7 +79,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -88,7 +88,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -97,7 +97,7 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
@@ -117,7 +117,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 1307a1a..c071099 100644 (file)
                void MassStorage_Task(void);\r
                void SetupHardware(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void ShowDiskReadError(char* CommandString, bool FailedAtSCSILayer, uint8_t ErrorCode);\r
 \r
index b98f4bf..4414748 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 1abd560..4a38382 100644 (file)
                void Mouse_HID_Task(void);\r
                void SetupHardware(void);\r
                \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void ReadNextReport(void);\r
                \r
index 8ea5e72..b5b41ce 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -111,7 +111,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 71d11a1..c5bfce5 100644 (file)
                void Mouse_HID_Task(void);\r
                void SetupHardware(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void ProcessMouseReport(uint8_t* MouseReport);\r
 \r
index bbda0c2..bd84f19 100644 (file)
@@ -73,7 +73,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -82,7 +82,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -91,13 +91,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -111,7 +111,7 @@ void EVENT_USB_HostError(uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index f6afcc7..db7a9fe 100644 (file)
                #define LEDMASK_USB_BUSY         (LEDS_LED2)\r
        \r
        /* Function Prototypes: */\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
-               void EVENT_USB_HostError(uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
 \r
                void SetupHardware(void);\r
 \r
index ca0771a..6c56d5f 100644 (file)
@@ -74,7 +74,7 @@ void SetupHardware(void)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
@@ -83,7 +83,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
@@ -92,13 +92,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -112,7 +112,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 1896b8f..89956e0 100644 (file)
                void StillImage_Task(void);\r
                void SetupHardware(void);\r
        \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void UnicodeToASCII(uint8_t* restrict UnicodeString, char* restrict Buffer);\r
                void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError);\r
index d0bc805..aee2b16 100644 (file)
@@ -54,71 +54,17 @@ static void Abort_Program(void)
        for (;;);\r
 }\r
 \r
-/** Event handler for the USB_VBUSChange event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_VBUSChange(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS Change\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_VBUSConnect event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_VBUSConnect(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS +\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_VBUSDisconnect event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_VBUSDisconnect(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS -\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/**\r
- *  Event handler for the USB_Connect event. When fired, the event is logged to the USART and the\r
- *  USB task started.\r
- */\r
-void EVENT_USB_Connect(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB  +\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/**\r
- *  Event handler for the USB_Disconnect event. When fired, the event is logged to the USART and the\r
- *  USB task stopped.\r
- */\r
-void EVENT_USB_Disconnect(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB  -\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_Suspend event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_Suspend(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Sleep\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_WakeUp event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_WakeUp(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Wakeup\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_Reset event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_Reset(void)\r
-{\r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Reset\r\n" ESC_FG_WHITE));\r
-}\r
-\r
 /** Event handler for the USB_UIDChange event. When fired, the event is logged to the USART. */\r
 void EVENT_USB_UIDChange(void)\r
 {\r
        char* ModeStrPtr;\r
 \r
-       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "UID Change\r\n"));\r
+       puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "UID Change\r\n"));\r
 \r
        if (USB_CurrentMode == USB_MODE_DEVICE)\r
-         ModeStrPtr = PSTR("HOST");\r
-       else if (USB_CurrentMode == USB_MODE_HOST)\r
          ModeStrPtr = PSTR("DEVICE");\r
+       else if (USB_CurrentMode == USB_MODE_HOST)\r
+         ModeStrPtr = PSTR("HOST");\r
        else\r
          ModeStrPtr = PSTR("N/A");\r
 \r
@@ -126,7 +72,7 @@ void EVENT_USB_UIDChange(void)
 }\r
 \r
 /**\r
- *  Event handler for the USB_PowerOnFail event. When fired, the event is logged to the USART and the program\r
+ *  Event handler for the USB_InitFailure event. When fired, the event is logged to the USART and the program\r
  *  execution aborted.\r
  */\r
 void EVENT_USB_InitFailure(const uint8_t ErrorCode)\r
@@ -148,29 +94,38 @@ void EVENT_USB_InitFailure(const uint8_t ErrorCode)
        Abort_Program();\r
 }\r
 \r
-/**\r
- *  Event handler for the USB_HostError event. When fired, the event is logged to the USART and the program\r
- *  execution aborted.\r
- */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+/** Event handler for the USB_Device_Connect event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
-       puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Host Mode Error\r\n"));\r
-       printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+       puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "USB Connect\r\n" ESC_FG_WHITE));\r
+}\r
 \r
-       Abort_Program();\r
+/** Event handler for the USB_Device_Disconnect event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Disconnect(void)\r
+{\r
+       puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "USB Disconnect\r\n" ESC_FG_WHITE));\r
 }\r
 \r
-/** Event handler for the USB_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+/** Event handler for the USB_Device_Suspend event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Suspend(void)\r
 {\r
-       puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Dev Enum Error\r\n"));\r
-       printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
-       printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);\r
-       printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);\r
+       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Sleep\r\n" ESC_FG_WHITE));\r
+}\r
+\r
+/** Event handler for the USB_Device_WakeUp event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_WakeUp(void)\r
+{\r
+       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Wakeup\r\n" ESC_FG_WHITE));\r
+}\r
+\r
+/** Event handler for the USB_Device_Reset event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Reset(void)\r
+{\r
+       puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Reset\r\n" ESC_FG_WHITE));\r
 }\r
 \r
-/** Event handler for the USB_UnhandledControlPacket event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the USB_Device_UnhandledControlRequest event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Ctrl Request\r\n"));\r
        printf_P(PSTR(" -- Req Data %d\r\n"), USB_ControlRequest.bRequest);\r
@@ -178,26 +133,47 @@ void EVENT_USB_UnhandledControlPacket(void)
        printf_P(PSTR(" -- Req Length %d\r\n" ESC_FG_WHITE), USB_ControlRequest.wLength);\r
 }\r
 \r
-/** Event handler for the USB_ConfigurationChanged event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+/** Event handler for the USB_Device_ConfigurationChanged event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Configuration Number Changed\r\n" ESC_FG_WHITE));\r
 }\r
 \r
-/** Event handler for the USB_DeviceAttached event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceAttached(void)\r
+/**\r
+ *  Event handler for the USB_Host_HostError event. When fired, the event is logged to the USART and the program\r
+ *  execution aborted.\r
+ */\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
-       puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device +\r\n" ESC_FG_WHITE));\r
+       puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Host Mode Error\r\n"));\r
+       printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+\r
+       Abort_Program();\r
 }\r
 \r
-/** Event handler for the USB_DeviceUnattached event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceUnattached(void)\r
+/** Event handler for the USB_Host_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
-       puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device -\r\n" ESC_FG_WHITE));\r
+       puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Dev Enum Error\r\n"));\r
+       printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
+       printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);\r
+       printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);\r
 }\r
 \r
-/** Event handler for the USB_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+/** Event handler for the USB_Host_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Device Enumeration Complete\r\n" ESC_FG_WHITE));\r
 }\r
+\r
+/** Event handler for the USB_Host_DeviceAttached event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceAttached(void)\r
+{\r
+       puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device Attached\r\n" ESC_FG_WHITE));\r
+}\r
+\r
+/** Event handler for the USB_Host_DeviceUnattached event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
+{\r
+       puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device Unattached\r\n" ESC_FG_WHITE));\r
+}\r
index b82936f..ee00dd7 100644 (file)
                        static void Abort_Program(void) ATTR_NO_RETURN;\r
                #endif\r
 \r
-               void EVENT_USB_VBUSChange(void);\r
-               void EVENT_USB_VBUSConnect(void);\r
-               void EVENT_USB_VBUSDisconnect(void);\r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
                void EVENT_USB_InitFailure(const uint8_t ErrorCode);\r
                void EVENT_USB_UIDChange(void);\r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_Suspend(void);\r
-               void EVENT_USB_WakeUp(void);\r
-               void EVENT_USB_Reset(void);     \r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_Suspend(void);\r
+               void EVENT_USB_Device_WakeUp(void);\r
+               void EVENT_USB_Device_Reset(void);      \r
                \r
 #endif\r
index 210a3c8..c4fbc3d 100644 (file)
@@ -33,7 +33,7 @@
 \r
 #include "Audio.h"\r
 \r
-void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
+void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
 {\r
        if (!(Endpoint_IsSETUPReceived()))\r
          return;\r
index 2c91dae..b1c5046 100644 (file)
@@ -97,7 +97,7 @@
                \r
                /* Function Prototypes: */\r
                        /** Configures the endpoints of a given Audio interface, ready for use. This should be linked to the library\r
-                        *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
+                        *  \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
                         *  given Audio interface is selected.\r
                         *\r
                         *  \param[in,out] AudioInterfaceInfo  Pointer to a structure containing an Audio Class configuration and state.\r
                        bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
 \r
                        /** Processes incomming control requests from the host, that are directed to the given Audio class interface. This should be\r
-                        *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+                        *  linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
                         *\r
                         *  \param[in,out] AudioInterfaceInfo  Pointer to a structure containing an Audio Class configuration and state.\r
                         */\r
-                       void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
+                       void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
 \r
                        /** General management task for a given Audio class interface, required for the correct operation of the interface. This should\r
                         *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
index 9ed20e4..9da0ed1 100644 (file)
@@ -39,7 +39,7 @@ void CDC_Device_Event_Stub(void)
 \r
 }\r
 \r
-void CDC_Device_ProcessControlPacket(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo)\r
+void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo)\r
 {\r
        if (!(Endpoint_IsSETUPReceived()))\r
          return;\r
index 2a8f1ec..7332f56 100644 (file)
                \r
                /* Function Prototypes: */              \r
                        /** Configures the endpoints of a given CDC interface, ready for use. This should be linked to the library\r
-                        *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
-                        *  given CDC interface is selected.\r
+                        *  \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing\r
+                        *  the given CDC interface is selected.\r
                         *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class configuration and state.\r
                         *\r
                        bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
 \r
                        /** Processes incomming control requests from the host, that are directed to the given CDC class interface. This should be\r
-                        *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+                        *  linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
                         *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class configuration and state.\r
                         */\r
-                       void CDC_Device_ProcessControlPacket(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
+                       void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
 \r
                        /** General management task for a given CDC class interface, required for the correct operation of the interface. This should\r
                         *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
index 40f7d2f..937214b 100644 (file)
@@ -33,7 +33,7 @@
 \r
 #include "HID.h"\r
 \r
-void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
+void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
 {\r
        if (!(Endpoint_IsSETUPReceived()))\r
          return;\r
index b8ca479..0c141e6 100644 (file)
@@ -95,7 +95,7 @@
        \r
                /* Function Prototypes: */\r
                        /** Configures the endpoints of a given HID interface, ready for use. This should be linked to the library\r
-                        *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+                        *  \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
                         *  containing the given HID interface is selected.\r
                         *\r
                         *  \param[in,out] HIDInterfaceInfo  Pointer to a structure containing a HID Class configuration and state.\r
                        bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
                        \r
                        /** Processes incomming control requests from the host, that are directed to the given HID class interface. This should be\r
-                        *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+                        *  linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
                         *\r
                         *  \param[in,out] HIDInterfaceInfo  Pointer to a structure containing a HID Class configuration and state.\r
                         */             \r
-                       void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
+                       void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
 \r
                        /** General management task for a given HID class interface, required for the correct operation of the interface. This should\r
                         *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
index ed3aaa7..a74e7a6 100644 (file)
@@ -33,7 +33,7 @@
 \r
 #include "MIDI.h"\r
 \r
-void MIDI_Device_ProcessControlPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)\r
+void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)\r
 {\r
 \r
 }\r
index 980ddc5..c7e46ba 100644 (file)
@@ -86,7 +86,7 @@
        \r
                /* Function Prototypes: */\r
                        /** Configures the endpoints of a given MIDI interface, ready for use. This should be linked to the library\r
-                        *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+                        *  \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
                         *  containing the given MIDI interface is selected.\r
                         *\r
                         *  \param[in,out] MIDIInterfaceInfo  Pointer to a structure containing a MIDI Class configuration and state.\r
                        bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);\r
                        \r
                        /** Processes incomming control requests from the host, that are directed to the given MIDI class interface. This should be\r
-                        *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+                        *  linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
                         *\r
                         *  \param[in,out] MIDIInterfaceInfo  Pointer to a structure containing a MIDI Class configuration and state.\r
                         */             \r
-                       void MIDI_Device_ProcessControlPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);\r
+                       void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);\r
 \r
                        /** General management task for a given MIDI class interface, required for the correct operation of the interface. This should\r
                         *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
index 6160641..04c63fc 100644 (file)
@@ -36,7 +36,7 @@
 \r
 static USB_ClassInfo_MS_Device_t* CallbackMSInterfaceInfo;\r
 \r
-void MS_Device_ProcessControlPacket(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
+void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
 {\r
        if (!(Endpoint_IsSETUPReceived()))\r
          return;\r
index cd7a8ef..b207c23 100644 (file)
@@ -95,7 +95,7 @@
 \r
                /* Function Prototypes: */\r
                        /** Configures the endpoints of a given Mass Storage interface, ready for use. This should be linked to the library\r
-                        *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+                        *  \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
                         *  containing the given Mass Storage interface is selected.\r
                         *\r
                         *  \param[in,out] MSInterfaceInfo  Pointer to a structure containing a Mass Storage Class configuration and state.\r
                        bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);\r
                        \r
                        /** Processes incomming control requests from the host, that are directed to the given Mass Storage class interface. This should be\r
-                        *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+                        *  linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
                         *\r
                         *  \param[in,out] MSInterfaceInfo  Pointer to a structure containing a Mass Storage Class configuration and state.\r
                         */             \r
-                       void MS_Device_ProcessControlPacket(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);\r
+                       void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);\r
 \r
                        /** General management task for a given Mass Storage class interface, required for the correct operation of the interface. This should\r
                         *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
index 8131d87..13d82a5 100644 (file)
@@ -65,7 +65,7 @@ static const uint32_t PROGMEM AdapterSupportedOIDList[]  =
                OID_802_3_XMIT_MORE_COLLISIONS,\r
        };\r
 \r
-void RNDIS_Device_ProcessControlPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)\r
+void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)\r
 {\r
        if (!(Endpoint_IsSETUPReceived()))\r
          return;\r
index 8855aac..d9a5d7f 100644 (file)
        \r
                /* Function Prototypes: */\r
                        /** Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library\r
-                        *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+                        *  \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
                         *  containing the given HID interface is selected.\r
                         *\r
                         *  \param[in,out] RNDISInterfaceInfo  Pointer to a structure containing a RNDIS Class configuration and state.\r
                        bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);\r
 \r
                        /** Processes incomming control requests from the host, that are directed to the given RNDIS class interface. This should be\r
-                        *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+                        *  linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
                         *\r
                         *  \param[in,out] RNDISInterfaceInfo  Pointer to a structure containing a RNDIS Class configuration and state.\r
                         */             \r
-                       void RNDIS_Device_ProcessControlPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);\r
+                       void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);\r
                        \r
                        /** General management task for a given HID class interface, required for the correct operation of the interface. This should\r
                         *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
index 4042d46..1e63831 100644 (file)
        /* Public Interface - May be used in end-application: */                        \r
                /* Pseudo-Functions for Doxygen: */\r
                #if !defined(INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__)\r
-                       /** Event for VBUS level change. This event fires when the VBUS line of the USB AVR changes from\r
-                        *  high to low or vice-versa, before the new VBUS level is sampled and the appropriate action\r
-                        *  taken.\r
-                        *\r
-                        *  \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
-                        */\r
-                       void EVENT_USB_VBUSChange(void);\r
-\r
-                       /** Event for VBUS attachment. On the AVR models with a dedicated VBUS pin, this event fires when\r
-                        *  the VBUS line of the USB AVR changes from low to high (after the VBUS events have been handled),\r
-                        *  signalling the attachment of the USB device to a host, before the enumeration process has begun.\r
-                        *\r
-                        *  \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
-                        */\r
-                       void EVENT_USB_VBUSConnect(void);\r
-\r
-                       /** Event for VBUS attachment. On the AVR models with a dedicated VBUS pin, this event fires when\r
-                        *  the VBUS line of the USB AVR changes from high to low (after the VBUS events have been handled),\r
-                        *  signalling the detatchment of the USB device from a host, regardless of its enumeration state.\r
-                        *\r
-                        *  \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
-                        */\r
-                       void EVENT_USB_VBUSDisconnect(void);\r
-\r
-                       /** Event for USB device connection. This event fires when the AVR is in USB host mode and a device\r
-                        *  has been attached (but not yet fully enumerated), or when in device mode and the device is connected\r
-                        *  to a host, beginning the enumeration process.\r
-                        *\r
-                        *  When in device mode, this can be used to programmatically start the USB management task to reduce\r
-                        *  CPU usage.\r
-                        *\r
-                        *  \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
-                        *        this means that the current connection state is derived from the bus suspension and wake up events by default,\r
-                        *        which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
-                        *        needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
-                        *        passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
-                        *        and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
-                        *\r
-                        *  \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
-                        */\r
-                       void EVENT_USB_Connect(void);\r
-\r
-                       /** Event for USB device disconnection. This event fires when the AVR is in USB host mode and an\r
-                        *  attached and enumerated device has been disconnected, or when in device mode and the device is\r
-                        *  disconnected from the host.\r
-                        *\r
-                        *  When in device mode, this can be used to programmatically stop the USB management task to reduce\r
-                        *  CPU usage.\r
-                        *\r
-                        *  \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
-                        *        this means that the current connection state is derived from the bus suspension and wake up events by default,\r
-                        *        which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
-                        *        needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
-                        *        passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
-                        *        and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
-                        *\r
-                        *  \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
-                        */\r
-                       void EVENT_USB_Disconnect(void);\r
-                       \r
-                       /** Event for USB initialization failure. This event fires when the USB interface fails to\r
+                       /** Event for USB stack initialization failure. This event fires when the USB interface fails to\r
                         *  initialize correctly due to a hardware or software fault.\r
                         *\r
                         *  \note This event only exists on USB AVR models which support dual role modes.\r
 \r
                        /** Event for USB mode pin level change. This event fires when the USB interface is set to dual role\r
                         *  mode, and the UID pin level has changed to indicate a new mode (device or host). This event fires\r
-                        *  before the mode is switched to the newly indicated mode but after the \ref EVENT_USB_Disconnect event\r
-                        *  has fired (if connected before the role change).\r
+                        *  before the mode is switched to the newly indicated mode but after the \ref EVENT_USB_Device_Disconnect\r
+                        *  event has fired (if connected before the role change).\r
                         *\r
                         *  \note This event only exists on USB AVR models which support dual role modes.\r
                         *\r
                         *  \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see\r
                         *        \ref Group_USBManagement documentation).\r
                         */\r
-                       void EVENT_USB_HostError(const uint8_t ErrorCode);\r
+                       void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
                        \r
                        /** Event for USB device attachment. This event fires when a the USB interface is in host mode, and\r
                         *  a USB device has been connected to the USB interface. This is interrupt driven, thus fires before\r
-                        *  the standard \ref EVENT_USB_Connect event and so can be used to programmatically start the USB management\r
-                        *  task to reduce CPU consumption.\r
+                        *  the standard \ref EVENT_USB_Device_Connect event and so can be used to programmatically start the USB\r
+                        *  management task to reduce CPU consumption.\r
                         *\r
                         *  \note This event only exists on USB AVR models which supports host mode.\r
                         *\r
                         *\r
                         *  \see \ref USB_USBTask() for more information on the USB management task and reducing CPU usage.\r
                         */\r
-                       void EVENT_USB_DeviceAttached(void);\r
+                       void EVENT_USB_Host_DeviceAttached(void);\r
 \r
                        /** Event for USB device removal. This event fires when a the USB interface is in host mode, and\r
                         *  a USB device has been removed the USB interface whether or not it has been enumerated. This\r
                         *\r
                         *  \see \ref USB_USBTask() for more information on the USB management task and reducing CPU usage.\r
                         */\r
-                       void EVENT_USB_DeviceUnattached(void);\r
+                       void EVENT_USB_Host_DeviceUnattached(void);\r
                        \r
                        /** Event for USB device enumeration failure. This event fires when a the USB interface is\r
                         *  in host mode, and an attached USB device has failed to enumerate completely.\r
                         *  \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see\r
                         *        \ref Group_USBManagement documentation).\r
                         */\r
-                       void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+                       void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
 \r
                        /** Event for USB device enumeration completion. This event fires when a the USB interface is\r
                         *  in host mode and an attached USB device has been completely enumerated and is ready to be\r
-                        *  controlled by the user application, or when the library is in device mode, and the Host\r
-                        *  has finished enumerating the device.\r
+                        *  controlled by the user application.\r
                         */\r
-                       void EVENT_USB_DeviceEnumerationComplete(void);\r
+                       void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+\r
+                       /** Event for USB device connection. This event fires when the AVR in device mode and the device is connected\r
+                        *  to a host, beginning the enumeration process, measured by a rising level on the AVR's VBUS pin.\r
+                        *\r
+                        *  \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
+                        *        this means that the current connection state is derived from the bus suspension and wake up events by default,\r
+                        *        which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
+                        *        needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
+                        *        passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
+                        *        and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
+                        *\r
+                        *  \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
+                        */\r
+                       void EVENT_USB_Device_Connect(void);\r
+\r
+                       /** Event for USB device disconnection. This event fires when the AVR in device mode and the device is disconnected\r
+                        *  from a host, measured by a falling level on the AVR's VBUS pin.\r
+                        *\r
+                        *  \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
+                        *        this means that the current connection state is derived from the bus suspension and wake up events by default,\r
+                        *        which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
+                        *        needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
+                        *        passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
+                        *        and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
+                        *\r
+                        *  \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
+                        */\r
+                       void EVENT_USB_Device_Disconnect(void);\r
 \r
                        /** Event for unhandled control requests. This event fires when a the USB host issues a control\r
                         *  request to the control endpoint (address 0) that the library does not handle. This may either\r
                         *        request SETUP parameters into the \ref USB_ControlRequest structure which should then be used\r
                         *        by the application to determine how to handle the issued request.\r
                         */\r
-                       void EVENT_USB_UnhandledControlPacket(void);\r
+                       void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                        /** Event for USB configuration number changed. This event fires when a the USB host changes the\r
                         *  selected configuration number while in device mode. This event should be hooked in device\r
                         *  \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
                         *        \ref Group_USBManagement documentation).\r
                         */\r
-                       void EVENT_USB_ConfigurationChanged(void);\r
+                       void EVENT_USB_Device_ConfigurationChanged(void);\r
 \r
                        /** Event for USB suspend. This event fires when a the USB host suspends the device by halting its\r
                         *  transmission of Start Of Frame pulses to the device. This is generally hooked in order to move\r
                         *  \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
                         *        \ref Group_USBManagement documentation).\r
                         *\r
-                        *  \see \ref EVENT_USB_WakeUp() event for accompanying Wake Up event.\r
+                        *  \see \ref EVENT_USB_Device_WakeUp() event for accompanying Wake Up event.\r
                         */\r
-                       void EVENT_USB_Suspend(void);\r
+                       void EVENT_USB_Device_Suspend(void);\r
 \r
                        /** Event for USB wake up. This event fires when a the USB interface is suspended while in device\r
                         *  mode, and the host wakes up the device by supplying Start Of Frame pulses. This is generally\r
                         *  \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
                         *        \ref Group_USBManagement documentation).\r
                         *\r
-                        *  \see \ref EVENT_USB_Suspend() event for accompanying Suspend event.\r
+                        *  \see \ref EVENT_USB_Device_Suspend() event for accompanying Suspend event.\r
                         */\r
-                       void EVENT_USB_WakeUp(void);\r
+                       void EVENT_USB_Device_WakeUp(void);\r
 \r
                        /** Event for USB interface reset. This event fires when the USB interface is in device mode, and\r
                         *  a the USB host requests that the device reset its interface. This event fires after the control\r
                         *  \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
                         *        \ref Group_USBManagement documentation).\r
                         */\r
-                       void EVENT_USB_Reset(void);\r
+                       void EVENT_USB_Device_Reset(void);\r
                #endif\r
                \r
        /* Private Interface - For use in library only: */\r
                /* Function Prototypes: */\r
                        #if defined(INCLUDE_FROM_EVENTS_C)\r
                                void USB_Event_Stub(void) ATTR_CONST;\r
-\r
-                               #if (defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))\r
-                                       void EVENT_USB_VBUSChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                                       void EVENT_USB_VBUSConnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                                       void EVENT_USB_VBUSDisconnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               #endif\r
                                        \r
-                               void EVENT_USB_Connect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               void EVENT_USB_Disconnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               void EVENT_USB_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               \r
                                #if defined(USB_CAN_BE_BOTH)\r
                                        void EVENT_USB_InitFailure(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
                                        void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
                                #endif\r
                                \r
                                #if defined(USB_CAN_BE_HOST)\r
-                                       void EVENT_USB_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                                       void EVENT_USB_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                                       void EVENT_USB_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                                       void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+                                       void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Host_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Host_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Host_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
                                                                               ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
                                #endif\r
 \r
-                               void EVENT_USB_UnhandledControlPacket(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               void EVENT_USB_ConfigurationChanged(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               void EVENT_USB_Suspend(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               void EVENT_USB_WakeUp(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
-                               void EVENT_USB_Reset(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                               #if defined(USB_CAN_BE_DEVICE)\r
+                                       void EVENT_USB_Device_Connect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Device_Disconnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Device_UnhandledControlRequest(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Device_ConfigurationChanged(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Device_Suspend(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Device_WakeUp(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                                       void EVENT_USB_Device_Reset(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+                               #endif\r
                        #endif\r
        #endif\r
 \r
index b9ae045..c5be544 100644 (file)
                        {\r
                                REQ_GetStatus           = 0, /**< Implemented in the library for device, endpoint and interface\r
                                                              *   recipients. Passed to the user application for other recipients\r
-                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_ClearFeature        = 1, /**< Implemented in the library for device, endpoint and interface\r
                                                              *   recipients. Passed to the user application for other recipients\r
-                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_SetFeature          = 3, /**< Implemented in the library for device, endpoint and interface\r
                                                              *   recipients. Passed to the user application for other recipients\r
-                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_SetAddress          = 5, /**< Implemented in the library for the device recipient. Passed\r
                                                              *   to the user application for other recipients via the\r
-                                                             *   \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_GetDescriptor       = 6, /**< Implemented in the library for all recipients and all request\r
                                                              *   types. */\r
                                REQ_SetDescriptor       = 7, /**< Not implemented in the library, passed to the user application\r
-                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_GetConfiguration    = 8, /**< Implemented in the library for the device recipient. Passed\r
                                                              *   to the user application for other recipients via the\r
-                                                             *   \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_SetConfiguration    = 9, /**< Implemented in the library for the device recipient. Passed\r
                                                              *   to the user application for other recipients via the\r
-                                                             *   \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_GetInterface        = 10, /**< Not implemented in the library, passed to the user application\r
-                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_SetInterface        = 11, /**< Not implemented in the library, passed to the user application\r
-                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                                REQ_SynchFrame          = 12, /**< Not implemented in the library, passed to the user application\r
-                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
                                                              *   device mode. */\r
                        };\r
 \r
index 51a761a..56e54f2 100644 (file)
@@ -72,36 +72,15 @@ ISR(USB_GEN_vect, ISR_BLOCK)
        {\r
                USB_INT_Clear(USB_INT_VBUS);\r
 \r
-               EVENT_USB_VBUSChange();\r
-\r
                if (USB_VBUS_GetStatus())\r
                {\r
-                       EVENT_USB_VBUSConnect();\r
-                       \r
-                       if (USB_DeviceState != DEVICE_STATE_Unattached)\r
-                         EVENT_USB_Disconnect();\r
-                               \r
-                       USB_ResetInterface();\r
-\r
                        USB_DeviceState = DEVICE_STATE_Powered;\r
-                       EVENT_USB_Connect();\r
+                       EVENT_USB_Device_Connect();\r
                }\r
                else\r
                {\r
-                       USB_DeviceState = DEVICE_STATE_Unattached;\r
-                       EVENT_USB_Disconnect();\r
-               \r
-                       USB_Detach();\r
-                       USB_CLK_Freeze();\r
-\r
-                       if (!(USB_Options & USB_OPT_MANUAL_PLL))\r
-                         USB_PLL_Off();\r
-\r
-                       USB_REG_Off();\r
-\r
-                       EVENT_USB_VBUSDisconnect();\r
-                       \r
-                       USB_INT_Clear(USB_INT_VBUS);\r
+                       USB_DeviceState = DEVICE_STATE_Unattached;              \r
+                       EVENT_USB_Device_Disconnect();\r
                }\r
        }\r
        #endif\r
@@ -120,10 +99,10 @@ ISR(USB_GEN_vect, ISR_BLOCK)
 \r
                #if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)\r
                USB_DeviceState = DEVICE_STATE_Unattached;\r
-               EVENT_USB_Disconnect();\r
+               EVENT_USB_Device_Disconnect();\r
                #else\r
                USB_DeviceState = DEVICE_STATE_Suspended;\r
-               EVENT_USB_Suspend();\r
+               EVENT_USB_Device_Suspend();\r
                #endif\r
        }\r
 \r
@@ -143,11 +122,11 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_INT_Enable(USB_INT_SUSPEND);\r
                \r
                #if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)\r
-               USB_DeviceState = DEVICE_STATE_Powered;\r
-               EVENT_USB_Connect();\r
+               USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered;\r
+               EVENT_USB_Device_Connect();\r
                #else\r
                USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Addressed;\r
-               EVENT_USB_WakeUp();             \r
+               EVENT_USB_Device_WakeUp();              \r
                #endif\r
        }\r
    \r
@@ -172,7 +151,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_INT_Enable(USB_INT_ENDPOINT_SETUP);\r
                #endif\r
 \r
-               EVENT_USB_Reset();\r
+               EVENT_USB_Device_Reset();\r
        }\r
        #endif\r
        \r
@@ -183,8 +162,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_INT_Clear(USB_INT_DCONNI);\r
                USB_INT_Disable(USB_INT_DDISCI);\r
                        \r
-               EVENT_USB_DeviceUnattached();\r
-               EVENT_USB_Disconnect();\r
+               EVENT_USB_Host_DeviceUnattached();\r
 \r
                USB_ResetInterface();\r
        }\r
@@ -196,8 +174,8 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_Host_VBUS_Manual_Off();\r
                USB_Host_VBUS_Auto_Off();\r
 \r
-               EVENT_USB_HostError(HOST_ERROR_VBusVoltageDip);\r
-               EVENT_USB_DeviceUnattached();\r
+               EVENT_USB_Host_HostError(HOST_ERROR_VBusVoltageDip);\r
+               EVENT_USB_Host_DeviceUnattached();\r
 \r
                USB_HostState = HOST_STATE_Unattached;\r
        }\r
@@ -207,7 +185,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_INT_Clear(USB_INT_SRPI);\r
                USB_INT_Disable(USB_INT_SRPI);\r
        \r
-               EVENT_USB_DeviceAttached();\r
+               EVENT_USB_Host_DeviceAttached();\r
 \r
                USB_INT_Enable(USB_INT_DDISCI);\r
                \r
@@ -218,11 +196,8 @@ ISR(USB_GEN_vect, ISR_BLOCK)
        {\r
                USB_INT_Clear(USB_INT_BCERRI);\r
                \r
-               EVENT_USB_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);\r
-               EVENT_USB_DeviceUnattached();\r
-               \r
-               if (USB_HostState != HOST_STATE_Unattached)\r
-                 EVENT_USB_Disconnect();\r
+               EVENT_USB_Host_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);\r
+               EVENT_USB_Host_DeviceUnattached();\r
 \r
                USB_ResetInterface();\r
        }\r
@@ -237,15 +212,11 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                  EVENT_USB_Disconnect();\r
 \r
                if (USB_HostState != HOST_STATE_Unattached)\r
-               {\r
-                       EVENT_USB_Disconnect();\r
-                       EVENT_USB_DeviceUnattached();\r
-               }\r
-       \r
-               EVENT_USB_Disconnect();\r
-\r
-               EVENT_USB_UIDChange();\r
+                 EVENT_USB_Host_DeviceUnattached();\r
                \r
+               USB_CurrentMode = USB_GetUSBModeFromUID();\r
+               EVENT_USB_UIDChange();\r
+\r
                USB_ResetInterface();\r
        }\r
        #endif\r
index c02a38b..f1277b9 100644 (file)
@@ -68,7 +68,7 @@ static void USB_DeviceTask(void)
                Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
 \r
                if (Endpoint_IsSETUPReceived())\r
-                 USB_Device_ProcessControlPacket();\r
+                 USB_Device_ProcessControlRequest();\r
                \r
                Endpoint_SelectEndpoint(PrevEndpoint);\r
        }\r
index 9138e68..08accc1 100644 (file)
@@ -65,7 +65,7 @@
                        extern volatile bool USB_IsInitialized;\r
 \r
                        /** Structure containing the last received Control request when in Device mode (for use in user-applications\r
-                        *  inside of the \ref EVENT_USB_UnhandledControlPacket() event, or for filling up with a control request to issue when\r
+                        *  inside of the \ref EVENT_USB_Device_UnhandledControlRequest() event, or for filling up with a control request to issue when\r
                         *  in Host mode before calling \ref USB_Host_SendControlRequest().\r
                         *\r
                         *  \ingroup Group_USBManagement\r
                                         *\r
                                         *  This value should not be altered by the user application as it is handled automatically by the\r
                                         *  library. The only exception to this rule is if the NO_LIMITED_CONTROLLER_CONNECT token is used\r
-                                        *  (see \ref EVENT_USB_Connect() and \ref EVENT_USB_Disconnect() events).\r
+                                        *  (see \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events).\r
                                         *\r
                                         *  To reduce program size and speed up checks of this global, it can be placed into one of the AVR's\r
                                         *  GPIOR hardware registers instead of RAM by defining the DEVICE_STATE_AS_GPIOR token to a value \r
                         *  The USB task must be serviced within 30ms while in device mode, or within 1ms while in host mode.\r
                         *  The task may be serviced at all times, or (for minimum CPU consumption):\r
                         *\r
-                        *    - In device mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Connect() event\r
-                        *    and disabled again on the firing of the \ref EVENT_USB_Disconnect() event.\r
+                        *    - In device mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Device_Connect() \r
+                        *      event and disabled again on the firing of the \ref EVENT_USB_Device_Disconnect() event.\r
                         *\r
-                        *    - In host mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_DeviceAttached()\r
-                        *    event and disabled again on the firing of the \ref EVENT_USB_DeviceEnumerationComplete() or\r
-                        *    \ref EVENT_USB_DeviceEnumerationFailed() events.\r
+                        *    - In host mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Host_DeviceAttached()\r
+                        *      event and disabled again on the firing of the \ref EVENT_USB_Host_DeviceEnumerationComplete() or\r
+                        *      \ref EVENT_USB_Host_DeviceEnumerationFailed() events.\r
                         *\r
                         *  If in device mode (only), the control endpoint can instead be managed via interrupts entirely by the library\r
                         *  by defining the INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch.\r
index f9c52e6..033db09 100644 (file)
@@ -39,7 +39,7 @@ uint8_t USB_ConfigurationNumber;
 bool    USB_RemoteWakeupEnabled;\r
 bool    USB_CurrentlySelfPowered;\r
 \r
-void USB_Device_ProcessControlPacket(void)\r
+void USB_Device_ProcessControlRequest(void)\r
 {\r
        bool     RequestHandled = false;\r
        uint8_t* RequestHeader  = (uint8_t*)&USB_ControlRequest;\r
@@ -106,7 +106,7 @@ void USB_Device_ProcessControlPacket(void)
        }\r
 \r
        if (!(RequestHandled))\r
-         EVENT_USB_UnhandledControlPacket();\r
+         EVENT_USB_Device_UnhandledControlRequest();\r
          \r
        if (Endpoint_IsSETUPReceived())\r
        {\r
@@ -139,8 +139,6 @@ static void USB_Device_SetAddress(void)
 \r
 static void USB_Device_SetConfiguration(void)\r
 {\r
-       bool AlreadyConfigured = (USB_ConfigurationNumber != 0);\r
-\r
 #if defined(FIXED_NUM_CONFIGURATIONS)\r
        if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS)\r
          return;\r
@@ -195,18 +193,11 @@ static void USB_Device_SetConfiguration(void)
        Endpoint_ClearIN();\r
 \r
        if (USB_ConfigurationNumber)\r
-       {\r
-               USB_DeviceState = DEVICE_STATE_Configured;\r
-\r
-               if (!(AlreadyConfigured))\r
-                 EVENT_USB_DeviceEnumerationComplete();\r
-       }\r
+         USB_DeviceState = DEVICE_STATE_Configured;\r
        else\r
-       {\r
-               USB_DeviceState = DEVICE_STATE_Addressed;\r
-       }\r
+         USB_DeviceState = DEVICE_STATE_Addressed;\r
 \r
-       EVENT_USB_ConfigurationChanged();\r
+       EVENT_USB_Device_ConfigurationChanged();\r
 }\r
 \r
 void USB_Device_GetConfiguration(void)\r
index a70dd06..e6baca2 100644 (file)
                #endif\r
        \r
                /* Function Prototypes: */\r
-                       void USB_Device_ProcessControlPacket(void);\r
+                       void USB_Device_ProcessControlRequest(void);\r
                        \r
                        #if defined(INCLUDE_FROM_DEVCHAPTER9_C)\r
                                static void USB_Device_SetAddress(void);\r
index 3d99b25..8a51ae5 100644 (file)
@@ -92,8 +92,6 @@ void USB_Host_ProcessNextHostState(void)
 \r
                                USB_INT_Clear(USB_INT_VBERRI);\r
                                USB_INT_Enable(USB_INT_VBERRI);\r
-\r
-                               EVENT_USB_Connect();\r
                                        \r
                                USB_Host_ResumeBus();\r
                                Pipe_ClearPipes();\r
@@ -185,19 +183,18 @@ void USB_Host_ProcessNextHostState(void)
                case HOST_STATE_Default_PostAddressSet:\r
                        USB_Host_SetDeviceAddress(USB_HOST_DEVICEADDRESS);\r
 \r
-                       EVENT_USB_DeviceEnumerationComplete();\r
+                       EVENT_USB_Host_DeviceEnumerationComplete();\r
                        USB_HostState = HOST_STATE_Addressed;\r
                        break;\r
        }\r
 \r
        if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))\r
        {\r
-               EVENT_USB_DeviceEnumerationFailed(ErrorCode, SubErrorCode);\r
+               EVENT_USB_Host_DeviceEnumerationFailed(ErrorCode, SubErrorCode);\r
 \r
                USB_Host_VBUS_Auto_Off();\r
 \r
-               EVENT_USB_DeviceUnattached();\r
-               EVENT_USB_Disconnect();\r
+               EVENT_USB_Host_DeviceUnattached();\r
 \r
                USB_ResetInterface();\r
        }\r
index a602cee..50912ad 100644 (file)
                                                                               */\r
                        };\r
                        \r
-                       /** Enum for the error codes for the \ref EVENT_USB_HostError() event.\r
+                       /** Enum for the error codes for the \ref EVENT_USB_Host_HostError() event.\r
                         *\r
                         *  \see \ref Group_Events for more information on this event.\r
                         */\r
                                                                      */\r
                        };\r
                        \r
-                       /** Enum for the error codes for the \ref EVENT_USB_DeviceEnumerationFailed() event.\r
+                       /** Enum for the error codes for the \ref EVENT_USB_Host_DeviceEnumerationFailed() event.\r
                         *\r
                         *  \see \ref Group_Events for more information on this event.\r
                         */\r
                        enum USB_Host_EnumerationErrorCodes_t\r
                        {\r
                                HOST_ENUMERROR_NoError          = 0, /**< No error occurred. Used internally, this is not a valid\r
-                                                                     *   ErrorCode parameter value for the \ref EVENT_USB_DeviceEnumerationFailed()\r
+                                                                     *   ErrorCode parameter value for the \ref EVENT_USB_Host_DeviceEnumerationFailed()\r
                                                                      *   event.\r
                                                                      */\r
                                HOST_ENUMERROR_WaitStage        = 1, /**< One of the delays between enumeration steps failed\r
index 3ad1e98..e679109 100644 (file)
@@ -108,16 +108,6 @@ void USB_Init(
 \r
 void USB_ShutDown(void)\r
 {\r
-       #if defined(USB_CAN_BE_DEVICE)\r
-       if (USB_DeviceState != DEVICE_STATE_Unattached)\r
-         EVENT_USB_Disconnect();\r
-       #endif\r
-       \r
-       #if defined(USB_CAN_BE_HOST)\r
-       if (USB_HostState != HOST_STATE_Unattached)\r
-         EVENT_USB_Disconnect();\r
-       #endif\r
-\r
        USB_ResetInterface();\r
        USB_Detach();\r
        USB_Controller_Disable();\r
@@ -191,8 +181,6 @@ void USB_ResetInterface(void)
                  USB_Device_SetLowSpeed();\r
                else\r
                  USB_Device_SetFullSpeed();\r
-                 \r
-               USB_INT_Enable(USB_INT_VBUS);\r
        }\r
        #endif\r
        \r
@@ -204,11 +192,11 @@ void USB_ResetInterface(void)
                if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR)\r
                {                 \r
                        #if defined(USE_RAM_DESCRIPTORS)\r
-                               USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;\r
+                       USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;\r
                        #elif defined(USE_EEPROM_DESCRIPTORS)\r
-                               USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+                       USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
                        #else\r
-                               USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+                       USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
                        #endif\r
                }\r
        }\r
@@ -216,13 +204,19 @@ void USB_ResetInterface(void)
 \r
        USB_Attach();\r
        \r
-       #if defined(USB_DEVICE_ONLY)    \r
+       #if defined(USB_DEVICE_ONLY)\r
+       USB_INT_Clear(USB_INT_SUSPEND);\r
        USB_INT_Enable(USB_INT_SUSPEND);\r
+       USB_INT_Clear(USB_INT_EORSTI);\r
        USB_INT_Enable(USB_INT_EORSTI);\r
-       #if defined(CONTROL_ONLY_DEVICE)\r
-       UENUM = ENDPOINT_CONTROLEP;\r
-       #endif\r
-               \r
+\r
+               #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)\r
+               USB_INT_Enable(USB_INT_VBUS);\r
+               #endif\r
+\r
+               #if defined(CONTROL_ONLY_DEVICE)\r
+               UENUM = ENDPOINT_CONTROLEP;\r
+               #endif\r
        #elif defined(USB_HOST_ONLY)\r
        USB_Host_HostMode_On();\r
        \r
@@ -237,9 +231,15 @@ void USB_ResetInterface(void)
        #else\r
        if (USB_CurrentMode == USB_MODE_DEVICE)\r
        {\r
+               USB_INT_Clear(USB_INT_SUSPEND);\r
                USB_INT_Enable(USB_INT_SUSPEND);\r
+               USB_INT_Clear(USB_INT_EORSTI);\r
                USB_INT_Enable(USB_INT_EORSTI);\r
 \r
+               #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)\r
+               USB_INT_Enable(USB_INT_VBUS);\r
+               #endif\r
+\r
                #if defined(CONTROL_ONLY_DEVICE)\r
                UENUM = ENDPOINT_CONTROLEP;\r
                #endif\r
index 1ca54ed..b8f7b9d 100644 (file)
                        #endif\r
 \r
                        /** Detaches the device from the USB bus. This has the effect of removing the device from any\r
-                        *  host if, ceasing USB communications. If no host is present, this prevents any host from\r
+                        *  attached host, ceasing USB communications. If no host is present, this prevents any host from\r
                         *  enumerating the device once attached until \ref USB_Attach() is called.\r
                         */\r
                        #define USB_Detach()                    MACROS{ UDCON  |=  (1 << DETACH);  }MACROE\r
 \r
                        #define USB_Controller_Enable()    MACROS{ USBCON  |=  (1 << USBE);                 }MACROE\r
                        #define USB_Controller_Disable()   MACROS{ USBCON  &= ~(1 << USBE);                 }MACROE\r
-                       #define USB_Controller_Reset()     MACROS{ uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \\r
+                       #define USB_Controller_Reset()     MACROS{ const uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \\r
                                                                   USBCON = (Temp | (1 << USBE));           }MACROE\r
        \r
                /* Inline Functions: */\r
index c674a55..ec310a2 100644 (file)
@@ -60,6 +60,8 @@
   *  - AudioOutput demos now always output to board LEDs, regardless of output mode (removed AUDIO_OUT_LEDS project option)\r
   *  - Removed SINGLE_DEVICE_CONFIGURATION compile time option in favour of the new FIXED_NUM_CONFIGURATIONS option so that the exact number\r
   *    of device configurations can be defined statically\r
+  *  - Removed VBUS events, as they are already exposed to the user application via the regular device connection and disconnection events\r
+  *  - Renamed and altered existing events to properly seperate out Host and Device mode events\r
   *\r
   *  <b>Fixed:</b>\r
   *  - Changed bootloaders to use FLASHEND rather than the existence of RAMPZ to determine if far FLASH pointers are needed to fix\r
index f3cb27b..387af21 100644 (file)
  *  VBUS events, the library attempts to determine the connection state via the bus suspension and wake up events instead. This however may be\r
  *  slightly inaccurate due to the possibility of the host suspending the bus while the device is still connected. If accurate connection status is\r
  *  required, the VBUS line of the USB connector should be routed to an AVR pin to detect its level, so that the USB_DeviceState global\r
- *  can be accurately set and the USB_Connect and USB_Disconnect events manually raised by the RAISE_EVENT macro. When defined, this token disables\r
- *  the library's auto-detection of the connection state by the aforementioned suspension and wake up events.\r
+ *  can be accurately set and the \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events manually raised by the RAISE_EVENT macro.\r
+ *  When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events.\r
  *\r
  *  <b>INTERRUPT_CONTROL_ENDPOINT</b> - ( \ref Group_USBManagement ) \n\r
  *  Some applications prefer to not call the USB_USBTask() management task reguarly while in device mode, as it can complicate code significantly.\r
index 4efc183..6335324 100644 (file)
@@ -39,6 +39,8 @@
  *      state.\r
  *    - The USB_IsConnected global has been removed, as it is too vague for general use. Test \ref USB_HostState explicitly to ensure the host is\r
  *      in the desired state instead.\r
+ *    - The USB event names have been changed and their firing conditions changed to properly seperate out Host mode events from Device mode\r
+ *      events. See the \ref Group_Events page for details on the new event names and firing conditions.\r
  *\r
  *  <b>Device Mode</b>\r
  *    - The \ref CALLBACK_USB_GetDescriptor() function now takes an extra parameter to specify the descriptor's memory space so that\r
@@ -47,7 +49,9 @@
  *    - The USB_IsSuspended global has been removed - test \ref USB_DeviceState against \ref DEVICE_STATE_Suspended instead.\r
  *    - The USB_IsConnected global has been removed, as it is too vague for general use. Test \ref USB_DeviceState explicitly to ensure the device\r
  *      is in the desired state instead.\r
- *\r
+ *    - The VBUS events have been removed, as they are already exposed to the user via the USB_Connect and USB_Disconnect events.\r
+ *    - The USB event names have been changed and their firing conditions changed to properly seperate out Host mode events from Device mode\r
+ *      events. See the \ref Group_Events page for details on the new event names and firing conditions. *\r
  *\r
  * \section Sec_Migration090605 Migrating from 090510 to 090605\r
  *\r
index 26c5664..d7e0413 100644 (file)
@@ -155,21 +155,21 @@ void SetupHardware(void)
 }\r
 \r
 /** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
 {\r
        PingPongMSRemaining = PING_PONG_LED_PULSE_MS;\r
        LEDs_SetAllLEDs(LEDMASK_TX);\r
 }\r
 \r
 /** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
 {\r
        PingPongMSRemaining = 0;\r
        LEDs_TurnOffLEDs(LEDMASK_BUSY);\r
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        PingPongMSRemaining = 0;\r
        LEDs_TurnOffLEDs(LEDMASK_BUSY);\r
@@ -178,10 +178,10 @@ void EVENT_USB_ConfigurationChanged(void)
          LEDs_TurnOnLEDs(LEDMASK_ERROR);\r
 }\r
 \r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);\r
+       CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
 }\r
 \r
 /** Event handler for the CDC Class driver Line Encoding Changed event.\r
index 740319f..3b0dfcd 100644 (file)
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
 \r
-               void EVENT_USB_Connect(void);\r
-               void EVENT_USB_Disconnect(void);\r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_Connect(void);\r
+               void EVENT_USB_Device_Disconnect(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
                \r
                void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
                void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
index f0fd8a7..5be3449 100644 (file)
@@ -145,15 +145,15 @@ void ReadMagstripeData(void)
 }\r
 \r
 /** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
 {\r
        HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface);\r
 }\r
 \r
 /** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
-       HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);\r
+       HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);\r
 }\r
 \r
 /** Timer 0 CTC ISR, firing once each millisecond to keep track of elapsed idle time in the HID interface. */\r
index 279e3db..7cbda83 100644 (file)
@@ -82,8 +82,8 @@
                void SetupHardware(void);\r
                void ReadMagstripeData(void);\r
                \r
-               void EVENT_USB_ConfigurationChanged(void);\r
-               void EVENT_USB_UnhandledControlPacket(void);\r
+               void EVENT_USB_Device_ConfigurationChanged(void);\r
+               void EVENT_USB_Device_UnhandledControlRequest(void);\r
 \r
                bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
                                                  void* ReportData, uint16_t* ReportSize);\r
index 50a8009..d15613e 100644 (file)
@@ -186,7 +186,7 @@ void Send_Command(uint8_t* Command)
 /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
  *  starts the library USB task to begin the enumeration and USB management process.\r
  */\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
@@ -194,7 +194,7 @@ void EVENT_USB_DeviceAttached(void)
 /** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
  *  stops the library USB task management process.\r
  */\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
@@ -202,13 +202,13 @@ void EVENT_USB_DeviceUnattached(void)
 /** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
  *  enumerated by the host and is now ready to be used by the application.\r
  */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -219,7 +219,7 @@ void EVENT_USB_HostError(const uint8_t ErrorCode)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
 }\r
index 3730b2c..86fbe86 100644 (file)
 \r
                void HID_Host_Task(void);\r
 \r
-               void EVENT_USB_HostError(const uint8_t ErrorCode);\r
-               void EVENT_USB_DeviceAttached(void);\r
-               void EVENT_USB_DeviceUnattached(void);\r
-               void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
-               void EVENT_USB_DeviceEnumerationComplete(void);\r
+               void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+               void EVENT_USB_Host_DeviceAttached(void);\r
+               void EVENT_USB_Host_DeviceUnattached(void);\r
+               void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+               void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
 \r
                void DiscardNextReport(void);\r
                void WriteNextReport(uint8_t* ReportOUTData, uint16_t ReportLength);\r