Rewritten event system to remove all macros, to make user code clearer.
authorDean Camera <dean@fourwalledcubicle.com>
Mon, 18 May 2009 10:05:21 +0000 (10:05 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Mon, 18 May 2009 10:05:21 +0000 (10:05 +0000)
Fixed incorrect ENDPOINT_EPNUM_MASK mask preventing endpoints above EP3 from being selected (thanks to Jonathan Oakley).

Removed STREAM_CALLBACK() macro - callbacks now use regular function definitions to clarify user code.

Removed DESCRIPTOR_COMPARATOR() macro - comparators should now use regular function definitions to clarify user code.

116 files changed:
Bootloaders/CDC/BootloaderCDC.c
Bootloaders/CDC/BootloaderCDC.h
Bootloaders/CDC/makefile
Bootloaders/DFU/BootloaderDFU.c
Bootloaders/DFU/BootloaderDFU.h
Bootloaders/DFU/makefile
Bootloaders/TeensyHID/TeensyHID.c
Bootloaders/TeensyHID/TeensyHID.h
Bootloaders/TeensyHID/makefile
Demos/Device/AudioInput/AudioInput.c
Demos/Device/AudioInput/AudioInput.h
Demos/Device/AudioInput/makefile
Demos/Device/AudioOutput/AudioOutput.c
Demos/Device/AudioOutput/AudioOutput.h
Demos/Device/AudioOutput/makefile
Demos/Device/CDC/CDC.c
Demos/Device/CDC/CDC.h
Demos/Device/CDC/makefile
Demos/Device/DualCDC/DualCDC.c
Demos/Device/DualCDC/DualCDC.h
Demos/Device/DualCDC/makefile
Demos/Device/GenericHID/GenericHID.c
Demos/Device/GenericHID/GenericHID.h
Demos/Device/GenericHID/makefile
Demos/Device/Joystick/Joystick.c
Demos/Device/Joystick/Joystick.h
Demos/Device/Joystick/makefile
Demos/Device/Keyboard/Keyboard.c
Demos/Device/Keyboard/Keyboard.h
Demos/Device/Keyboard/makefile
Demos/Device/KeyboardMouse/KeyboardMouse.c
Demos/Device/KeyboardMouse/KeyboardMouse.h
Demos/Device/KeyboardMouse/makefile
Demos/Device/MIDI/MIDI.c
Demos/Device/MIDI/MIDI.h
Demos/Device/MIDI/makefile
Demos/Device/MassStorage/MassStorage.c
Demos/Device/MassStorage/MassStorage.h
Demos/Device/MassStorage/SCSI.c
Demos/Device/MassStorage/makefile
Demos/Device/Mouse/Mouse.c
Demos/Device/Mouse/Mouse.h
Demos/Device/Mouse/makefile
Demos/Device/RNDISEthernet/RNDISEthernet.c
Demos/Device/RNDISEthernet/RNDISEthernet.h
Demos/Device/RNDISEthernet/makefile
Demos/Device/USBtoSerial/USBtoSerial.c
Demos/Device/USBtoSerial/USBtoSerial.h
Demos/Device/USBtoSerial/makefile
Demos/Host/CDCHost/CDCHost.c
Demos/Host/CDCHost/CDCHost.h
Demos/Host/CDCHost/ConfigDescriptor.c
Demos/Host/CDCHost/ConfigDescriptor.h
Demos/Host/CDCHost/makefile
Demos/Host/GenericHIDHost/ConfigDescriptor.c
Demos/Host/GenericHIDHost/ConfigDescriptor.h
Demos/Host/GenericHIDHost/GenericHIDHost.c
Demos/Host/GenericHIDHost/GenericHIDHost.h
Demos/Host/GenericHIDHost/makefile
Demos/Host/KeyboardHost/ConfigDescriptor.c
Demos/Host/KeyboardHost/ConfigDescriptor.h
Demos/Host/KeyboardHost/KeyboardHost.c
Demos/Host/KeyboardHost/KeyboardHost.h
Demos/Host/KeyboardHost/makefile
Demos/Host/KeyboardHostWithParser/ConfigDescriptor.c
Demos/Host/KeyboardHostWithParser/ConfigDescriptor.h
Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.c
Demos/Host/KeyboardHostWithParser/KeyboardHostWithParser.h
Demos/Host/KeyboardHostWithParser/makefile
Demos/Host/MassStorageHost/ConfigDescriptor.c
Demos/Host/MassStorageHost/ConfigDescriptor.h
Demos/Host/MassStorageHost/MassStorageHost.c
Demos/Host/MassStorageHost/MassStorageHost.h
Demos/Host/MassStorageHost/makefile
Demos/Host/MouseHost/ConfigDescriptor.c
Demos/Host/MouseHost/ConfigDescriptor.h
Demos/Host/MouseHost/MouseHost.c
Demos/Host/MouseHost/MouseHost.h
Demos/Host/MouseHost/makefile
Demos/Host/MouseHostWithParser/ConfigDescriptor.c
Demos/Host/MouseHostWithParser/ConfigDescriptor.h
Demos/Host/MouseHostWithParser/MouseHostWithParser.c
Demos/Host/MouseHostWithParser/MouseHostWithParser.h
Demos/Host/MouseHostWithParser/makefile
Demos/Host/StillImageHost/ConfigDescriptor.c
Demos/Host/StillImageHost/ConfigDescriptor.h
Demos/Host/StillImageHost/StillImageHost.c
Demos/Host/StillImageHost/StillImageHost.h
Demos/Host/StillImageHost/makefile
Demos/OTG/TestApp/TestEvents.c
Demos/OTG/TestApp/TestEvents.h
Demos/OTG/TestApp/makefile
LUFA/ChangeLog.txt
LUFA/Drivers/USB/Class/ConfigDescriptor.c
LUFA/Drivers/USB/Class/ConfigDescriptor.h
LUFA/Drivers/USB/HighLevel/Events.h
LUFA/Drivers/USB/HighLevel/StdDescriptors.c
LUFA/Drivers/USB/HighLevel/StdDescriptors.h
LUFA/Drivers/USB/HighLevel/StdRequestType.h
LUFA/Drivers/USB/HighLevel/StreamCallbacks.h
LUFA/Drivers/USB/HighLevel/USBInterrupt.c
LUFA/Drivers/USB/HighLevel/USBInterrupt.h
LUFA/Drivers/USB/HighLevel/USBTask.h
LUFA/Drivers/USB/LowLevel/DevChapter9.c
LUFA/Drivers/USB/LowLevel/DevChapter9.h
LUFA/Drivers/USB/LowLevel/Device.h
LUFA/Drivers/USB/LowLevel/Endpoint.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/Drivers/USB/LowLevel/Pipe.h
LUFA/MigrationInformation.txt
Projects/Magstripe/Magstripe.c
Projects/Magstripe/Magstripe.h
Projects/Magstripe/makefile

index f36c4fc..265e90f 100644 (file)
@@ -119,7 +119,7 @@ int main(void)
 /** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
  *  application started.\r
  */\r
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Upon disconnection, run user application */\r
        RunBootloader = false;\r
@@ -128,7 +128,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup CDC Notification, Rx and Tx Endpoints */\r
        Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -148,7 +148,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  control requests that are not handled internally by the USB library, so that they can be handled appropriately\r
  *  for the application.\r
  */\r
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        uint8_t* LineCodingData = (uint8_t*)&LineCoding;\r
 \r
index e302a39..da75593 100644 (file)
 \r
                /** Eight character bootloader firmware identifier reported to the host when requested */\r
                #define SOFTWARE_IDENTIFIER          "LUFACDC"\r
-\r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
                \r
        /* Type Defines: */\r
                /** Type define for a non-returning pointer to the start of the loaded application in flash memory. */\r
                TASK(CDC_Task);\r
 \r
        /* Function Prototypes: */\r
+               void EVENT_USB_Disconnect(void);\r
+               void EVENT_USB_ConfigurationChanged(void);\r
+               void EVENT_USB_UnhandledControlPacket(void);\r
+\r
                #if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__)\r
                        static void    ReadWriteMemoryBlock(const uint8_t Command);\r
                        static uint8_t FetchNextCommandByte(void);\r
index 0eecb18..3caec53 100644 (file)
@@ -502,7 +502,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 83881f1..10a3016 100644 (file)
@@ -139,7 +139,7 @@ int main (void)
 /** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
  *  application started.\r
  */\r
-EVENT_HANDLER(USB_Disconnect)\r
+void EventHandler_USB_Disconnect(void)\r
 {\r
        /* Upon disconnection, run user application */\r
        RunBootloader = false;\r
@@ -149,7 +149,7 @@ EVENT_HANDLER(USB_Disconnect)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EventHandler_USB_UnhandledControlPacket(void)\r
 {\r
        /* Get the size of the command and data from the wLength value */\r
        SentCommand.DataSize = USB_ControlRequest.wLength;\r
index e996f2b..a78d80d 100644 (file)
                        errUNKNOWN                   = 14,\r
                        errSTALLEDPKT                = 15\r
                };\r
-               \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-               \r
+                               \r
        /* Function Prototypes: */\r
+               void EVENT_USB_Disconnect(void);\r
+               void EVENT_USB_UnhandledControlPacket(void);\r
+\r
                #if defined(INCLUDE_FROM_BOOTLOADER_C)\r
                        static void DiscardFillerBytes(uint8_t NumberOfBytes);\r
                        static void ProcessBootloaderCommand(void);\r
index 124ea58..94525c1 100644 (file)
@@ -503,7 +503,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index cb1407a..ee6c91a 100644 (file)
@@ -81,7 +81,7 @@ int main(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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup HID Report Endpoint */\r
        Endpoint_ConfigureEndpoint(HID_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -93,7 +93,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index ae180f7..0dd5852 100644 (file)
                #define REQ_SetReport             0x09\r
                \r
                #define TEENSY_STARTAPPLICATION   0xFFFF\r
-\r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
+               \r
+       /* Function Prototypes: */\r
+               void EVENT_USB_ConfigurationChanged(void);\r
+               void EVENT_USB_UnhandledControlPacket(void);\r
                \r
 #endif\r
index bff9e11..d022c93 100644 (file)
@@ -502,7 +502,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 05094c2..ecd8cdd 100644 (file)
@@ -80,7 +80,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -97,7 +97,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop the sample reload timer */\r
        TCCR0B = 0;\r
@@ -113,7 +113,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup audio stream endpoint */\r
        Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS,\r
@@ -128,7 +128,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Process General and Audio specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index b7174d1..6358c24 100644 (file)
        /* Task Definitions: */\r
                TASK(USB_Audio_Task);\r
 \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-\r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                \r
 #endif\r
index aca88cb..7c8b7ab 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 640462d..7ec2e35 100644 (file)
@@ -75,7 +75,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EventHandler_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -110,7 +110,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EventHandler_USB_Disconnect(void)\r
 {\r
        /* Stop the timers */\r
        TCCR0B = 0;\r
@@ -140,7 +140,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EventHandler_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup audio stream endpoint */\r
        Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS,\r
@@ -155,7 +155,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EventHandler_USB_UnhandledControlPacket(void)\r
 {\r
        /* Process General and Audio specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 05b24ad..d8725a0 100644 (file)
 \r
        /* Task Definitions: */\r
                TASK(USB_Audio_Task);\r
-\r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
        \r
        /* Function Prototypes: */\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
+               \r
                void UpdateStatus(uint8_t CurrentStatus);\r
 \r
 #endif\r
index 0a6401b..fc200be 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 59aa98c..d7ebb9e 100644 (file)
@@ -104,7 +104,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -116,7 +116,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running CDC and USB management tasks */\r
        Scheduler_SetTaskMode(CDC_Task, TASK_STOP);\r
@@ -129,7 +129,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup CDC Notification, Rx and Tx Endpoints */\r
        Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -155,7 +155,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        uint8_t* LineCodingData = (uint8_t*)&LineCoding;\r
 \r
index 1537f0b..4c4ca74 100644 (file)
                 */\r
                #define CONTROL_LINE_IN_OVERRUNERROR (1 << 6)\r
                \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-               \r
        /* Type Defines: */\r
                /** Type define for the virtual serial port line encoding settings, for storing the current USART configuration\r
                 *  as set by the host via a class specific request.\r
                TASK(CDC_Task);\r
 \r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
 \r
 #endif\r
index ce2436e..5755dda 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 9750ea2..34d772f 100644 (file)
@@ -118,7 +118,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -130,7 +130,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running CDC and USB management tasks */\r
        Scheduler_SetTaskMode(CDC1_Task, TASK_STOP);\r
@@ -144,7 +144,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup CDC Notification, Rx and Tx Endpoints for the first CDC */\r
        Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -184,7 +184,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Determine which interface's Line Coding data is being set from the wIndex parameter */\r
        uint8_t* LineCodingData = (USB_ControlRequest.wIndex == 0) ? (uint8_t*)&LineCoding1 : (uint8_t*)&LineCoding2;\r
index 65f661f..117af60 100644 (file)
                /** CDC Class specific request to set the current virtual serial port handshake line states. */\r
                #define REQ_SetControlLineState      0x22\r
 \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-               \r
        /* Type Defines: */\r
                /** Type define for the virtual serial port line encoding settings, for storing the current USART configuration\r
                 *  as set by the host via a class specific request.\r
                TASK(CDC2_Task);\r
 \r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                \r
 #endif\r
index fc0005d..75099c5 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 0369f9f..f43499a 100644 (file)
@@ -75,7 +75,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -87,7 +87,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running HID reporting and USB management tasks */\r
        Scheduler_SetTaskMode(USB_HID_Report, TASK_STOP);\r
@@ -100,7 +100,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup Generic IN Report Endpoint */\r
        Endpoint_ConfigureEndpoint(GENERIC_IN_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -120,7 +120,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 5841595..30354b7 100644 (file)
                        Status_USBReady       = 2, /**< USB interface is connected and ready */\r
                };\r
 \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-       \r
        /* Task Definitions: */\r
                TASK(USB_HID_Report);\r
 \r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                void ProcessGenericHIDReport(uint8_t* DataArray);\r
                void CreateGenericHIDReport(uint8_t* DataArray);\r
index 23d2791..c70c6a1 100644 (file)
@@ -504,7 +504,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index e1faeed..8c50a2c 100644 (file)
@@ -76,7 +76,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -88,7 +88,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running joystick reporting and USB management tasks */\r
        Scheduler_SetTaskMode(USB_Joystick_Report, TASK_STOP);\r
@@ -101,7 +101,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup Joystick Report Endpoint */\r
        Endpoint_ConfigureEndpoint(JOYSTICK_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -119,7 +119,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index c274b5b..9763cad 100644 (file)
                        Status_USBReady       = 2, /**< USB interface is connected and ready */\r
                };\r
 \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-               \r
        /* Function Prototypes: */\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
+\r
                bool GetNextReport(USB_JoystickReport_Data_t* ReportData);\r
                void UpdateStatus(uint8_t CurrentStatus);\r
 \r
index 9ab8ec2..7550ed3 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index fe041ef..6abd193 100644 (file)
@@ -100,7 +100,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running keyboard reporting and USB management tasks */\r
        Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_STOP);\r
@@ -128,7 +128,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup Keyboard Keycode Report Endpoint */\r
        Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -151,7 +151,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
@@ -220,7 +220,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                Endpoint_ClearSETUP();\r
 \r
                                /* Set or clear the flag depending on what the host indicates that the current Protocol should be */\r
-                               UsingReportProtocol = (USB_ControlRequest.wValue != 0x0000);\r
+                               UsingReportProtocol = (USB_ControlRequest.wValue != 0);\r
 \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
index 2cc9c5c..c4ed6e0 100644 (file)
 \r
        /* Macros: */\r
                /** Idle period indicating that reports should be sent only when the inputs have changed */\r
-               #define HID_IDLE_CHANGESONLY 0\r
+               #define HID_IDLE_CHANGESONLY   0\r
 \r
                /** HID Class specific request to get the next HID report from the device. */\r
-               #define REQ_GetReport      0x01\r
+               #define REQ_GetReport          0x01\r
 \r
                /** HID Class specific request to get the idle timeout period of the device. */\r
-               #define REQ_GetIdle        0x02\r
+               #define REQ_GetIdle            0x02\r
 \r
                /** HID Class specific request to send the next HID report to the device. */\r
-               #define REQ_SetReport      0x09\r
+               #define REQ_SetReport          0x09\r
 \r
                /** HID Class specific request to set the idle timeout period of the device. */\r
-               #define REQ_SetIdle        0x0A\r
+               #define REQ_SetIdle            0x0A\r
 \r
                /** HID Class specific request to get the current HID protocol in use, either report or boot. */\r
-               #define REQ_GetProtocol    0x03\r
+               #define REQ_GetProtocol        0x03\r
 \r
                /** HID Class specific request to set the current HID protocol in use, either report or boot. */\r
-               #define REQ_SetProtocol    0x0B\r
+               #define REQ_SetProtocol        0x0B\r
                \r
        /* Task Definitions: */\r
                TASK(USB_Keyboard_Report);\r
                        Status_USBEnumerating = 1, /**< USB interface is enumerating */\r
                        Status_USBReady       = 2, /**< USB interface is connected and ready */\r
                };\r
-\r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
                \r
        /* Function Prototypes: */\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
+\r
                void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData);\r
                void ProcessLEDReport(uint8_t LEDReport);\r
                void SendNextReport(void);\r
                void ReceiveNextReport(void);\r
                void UpdateStatus(uint8_t CurrentStatus);\r
-               \r
+\r
 #endif\r
index bacf6dc..3c597bf 100644 (file)
@@ -504,7 +504,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 5c93328..25d633e 100644 (file)
@@ -84,7 +84,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -96,7 +96,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running HID reporting and USB management tasks */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -108,7 +108,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup Keyboard Report Endpoint */\r
        Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -133,7 +133,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        uint8_t* ReportData;\r
        uint8_t  ReportSize;\r
index 9a1fee1..e3f9434 100644 (file)
                        int8_t  Y; /**< Current mouse delta Y movement, as a signed 8-bit integer */\r
                } USB_MouseReport_Data_t;\r
                        \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-\r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                \r
 #endif\r
index e483998..b26bdbe 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 1323e11..b6b43df 100644 (file)
@@ -74,7 +74,7 @@ int main(void)
 }\r
 \r
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -86,7 +86,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running audio and USB management tasks */\r
        Scheduler_SetTaskMode(USB_MIDI_Task, TASK_STOP);\r
@@ -99,7 +99,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup MIDI stream endpoints */\r
        Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK,\r
index 4d801e8..635036a 100644 (file)
        /* Task Definitions: */\r
                TASK(USB_MIDI_Task);\r
 \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
    /* Function Prototypes: */\r
+               void EVENT_USB_Connect(void);\r
+               void EVENT_USB_Disconnect(void);\r
+               void EVENT_USB_ConfigurationChanged(void);\r
+\r
                void SendMIDINoteChange(const uint8_t Pitch, const bool OnOff,\r
                                        const uint8_t CableID, const uint8_t Channel);          \r
                void UpdateStatus(uint8_t CurrentStatus);\r
index 1ad946e..89bfc6c 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 1da8930..82e7e8a 100644 (file)
@@ -86,7 +86,7 @@ int main(void)
 }\r
 \r
 /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
-EVENT_HANDLER(USB_Connect)\r
+void EventHandler_USB_Connect(void)\r
 {\r
        /* Indicate USB enumerating */\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -98,7 +98,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EventHandler_USB_Disconnect(void)\r
 {\r
        /* Stop running mass storage task */\r
        Scheduler_SetTaskMode(USB_MassStorage, TASK_STOP);\r
@@ -110,7 +110,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EventHandler_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup Mass Storage In and Out Endpoints */\r
        Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK,\r
@@ -132,7 +132,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EventHandler_USB_UnhandledControlPacket(void)\r
 {\r
        /* Process UFI specific control requests */\r
        switch (USB_ControlRequest.bRequest)\r
@@ -283,7 +283,7 @@ static bool ReadInCommandBlock(void)
 \r
        /* Read in command block header */\r
        Endpoint_Read_Stream_LE(&CommandBlock, (sizeof(CommandBlock) - sizeof(CommandBlock.SCSICommandData)),\r
-                               AbortOnMassStoreReset);\r
+                               StreamCallback_AbortOnMassStoreReset);\r
 \r
        /* Check if the current command is being aborted by the host */\r
        if (IsMassStoreReset)\r
@@ -305,7 +305,7 @@ static bool ReadInCommandBlock(void)
        /* Read in command block command data */\r
        Endpoint_Read_Stream_LE(&CommandBlock.SCSICommandData,\r
                                CommandBlock.SCSICommandLength,\r
-                               AbortOnMassStoreReset);\r
+                               StreamCallback_AbortOnMassStoreReset);\r
          \r
        /* Check if the current command is being aborted by the host */\r
        if (IsMassStoreReset)\r
@@ -346,7 +346,7 @@ static void ReturnCommandStatus(void)
        \r
        /* Write the CSW to the endpoint */\r
        Endpoint_Write_Stream_LE(&CommandStatus, sizeof(CommandStatus),\r
-                                 AbortOnMassStoreReset);\r
+                                 StreamCallback_AbortOnMassStoreReset);\r
        \r
        /* Check if the current command is being aborted by the host */\r
        if (IsMassStoreReset)\r
@@ -359,7 +359,7 @@ static void ReturnCommandStatus(void)
 /** Stream callback function for the Endpoint stream read and write functions. This callback will abort the current stream transfer\r
  *  if a Mass Storage Reset request has been issued to the control endpoint.\r
  */\r
-STREAM_CALLBACK(AbortOnMassStoreReset)\r
+uint8_t StreamCallback_AbortOnMassStoreReset(void)\r
 {      \r
        /* Abort if a Mass Storage reset command was received */\r
        if (IsMassStoreReset)\r
index f0baf14..afe9872 100644 (file)
        /* Task Definitions: */\r
                TASK(USB_MassStorage);\r
                \r
-       /* Stream Callbacks: */\r
-               STREAM_CALLBACK(AbortOnMassStoreReset);\r
-\r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-\r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
 \r
                #if defined(INCLUDE_FROM_MASSSTORAGE_C)\r
                        static void ReturnCommandStatus(void);\r
                #endif\r
 \r
+               uint8_t StreamCallback_AbortOnMassStoreReset(void);\r
+\r
 #endif\r
index a88be51..5993a54 100644 (file)
@@ -166,12 +166,12 @@ static bool SCSI_Command_Inquiry(void)
        }\r
 \r
        /* Write the INQUIRY data to the endpoint */\r
-       Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, AbortOnMassStoreReset);\r
+       Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, StreamCallback_AbortOnMassStoreReset);\r
 \r
        uint8_t PadBytes[AllocationLength - BytesTransferred];\r
        \r
        /* Pad out remaining bytes with 0x00 */\r
-       Endpoint_Write_Stream_LE(&PadBytes, (AllocationLength - BytesTransferred), AbortOnMassStoreReset);\r
+       Endpoint_Write_Stream_LE(&PadBytes, (AllocationLength - BytesTransferred), StreamCallback_AbortOnMassStoreReset);\r
 \r
        /* Finalize the stream transfer to send the last packet */\r
        Endpoint_ClearIN();\r
@@ -193,12 +193,12 @@ static bool SCSI_Command_Request_Sense(void)
        uint8_t  BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);\r
        \r
        /* Send the SENSE data - this indicates to the host the status of the last command */\r
-       Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, AbortOnMassStoreReset);\r
+       Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, StreamCallback_AbortOnMassStoreReset);\r
        \r
        uint8_t PadBytes[AllocationLength - BytesTransferred];\r
        \r
        /* Pad out remaining bytes with 0x00 */\r
-       Endpoint_Write_Stream_LE(&PadBytes, (AllocationLength - BytesTransferred), AbortOnMassStoreReset);\r
+       Endpoint_Write_Stream_LE(&PadBytes, (AllocationLength - BytesTransferred), StreamCallback_AbortOnMassStoreReset);\r
 \r
        /* Finalize the stream transfer to send the last packet */\r
        Endpoint_ClearIN();\r
index 65a22c6..95c91f6 100644 (file)
@@ -508,7 +508,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 9dc2f9d..32b12fc 100644 (file)
@@ -100,7 +100,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running mouse reporting and USB management tasks */\r
        Scheduler_SetTaskMode(USB_Mouse_Report, TASK_STOP);\r
@@ -128,7 +128,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup Mouse Report Endpoint */\r
        Endpoint_ConfigureEndpoint(MOUSE_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -146,7 +146,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
@@ -195,7 +195,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                                Endpoint_ClearSETUP();\r
                                \r
                                /* Set or clear the flag depending on what the host indicates that the current Protocol should be */\r
-                               UsingReportProtocol = (USB_ControlRequest.wValue != 0x0000);\r
+                               UsingReportProtocol = (USB_ControlRequest.wValue != 0);\r
                                \r
                                /* Acknowledge status stage */\r
                                while (!(Endpoint_IsINReady()));\r
index 3bbbac2..65879da 100644 (file)
                        Status_USBReady       = 2, /**< USB interface is connected and ready */\r
                };\r
                        \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-\r
        /* Function Prototypes: */\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
+\r
                void CreateMouseReport(USB_MouseReport_Data_t* ReportData);\r
                void UpdateStatus(uint8_t CurrentStatus);\r
 \r
index 3fa887b..d5ad211 100644 (file)
@@ -504,7 +504,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index fd88ecf..b046f78 100644 (file)
@@ -83,7 +83,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -95,7 +95,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running TCP/IP and USB management tasks */\r
        Scheduler_SetTaskMode(RNDIS_Task, TASK_STOP);\r
@@ -110,7 +110,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup CDC Notification, Rx and Tx Endpoints */\r
        Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,\r
@@ -138,7 +138,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Process RNDIS class commands */\r
        switch (USB_ControlRequest.bRequest)\r
index b3fd4db..7c3c8da 100644 (file)
        /* Macros: */\r
                /** Notification value to indicate that a frame is ready to be read by the host. */\r
                #define NOTIF_RESPONSE_AVAILABLE                 0x01\r
-               \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
 \r
        /* Type Defines: */\r
                /** Type define for a RNDIS notification message, for transmission to the RNDIS host via the notification\r
                TASK(Ethernet_Task);\r
 \r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
        \r
 #endif\r
index 7a9722b..e46b13b 100644 (file)
@@ -518,7 +518,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index ea8dcd5..ef51a6e 100644 (file)
@@ -93,7 +93,7 @@ int main(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
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
@@ -105,7 +105,7 @@ EVENT_HANDLER(USB_Connect)
 /** 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
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running CDC and USB management tasks */\r
        Scheduler_SetTaskMode(CDC_Task, TASK_STOP);\r
@@ -122,7 +122,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** 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
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup CDC Notification, Rx and Tx Endpoints */\r
        Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -148,7 +148,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  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
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        uint8_t* LineCodingData = (uint8_t*)&LineCoding;\r
 \r
index 0352f5d..cd1f42c 100644 (file)
                 */\r
                #define CONTROL_LINE_IN_OVERRUNERROR (1 << 6)\r
                \r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-               \r
        /* Type Defines: */\r
                /** Type define for the virtual serial port line encoding settings, for storing the current USART configuration\r
                 *  as set by the host via a class specific request.\r
                TASK(CDC_Task);\r
 \r
        /* Function Prototypes: */\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
+\r
                void ReconfigureUSART(void);\r
                void UpdateStatus(uint8_t CurrentStatus);\r
 \r
index 6f7f641..8808abe 100644 (file)
@@ -506,7 +506,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index a419409..b834731 100644 (file)
@@ -80,7 +80,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -92,7 +92,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop keyboard and USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -105,7 +105,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Start CDC Host task */\r
        Scheduler_SetTaskMode(USB_CDC_Host, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -129,7 +129,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 3819540..afec780 100644 (file)
        /* Task Definitions: */\r
                TASK(USB_CDC_Host);\r
 \r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
-\r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                \r
 #endif\r
index faad3cc..baf02a2 100644 (file)
@@ -71,7 +71,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the CDC control interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoCDCInterfaceFound;\r
@@ -82,14 +82,14 @@ uint8_t ProcessConfigurationDescriptor(void)
        {\r
                /* Fetch the next bulk or interrupt endpoint from the current CDC interface */\r
                if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                             NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                             DComp_NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
                {\r
                        /* Check to see if the control interface's notification pipe has been found, if so search for the data interface */\r
                        if (FoundEndpoints & (1 << CDC_NOTIFICATIONPIPE))\r
                        {\r
                                /* Get the next CDC data interface from the configuration descriptor (CDC class has two CDC interfaces) */\r
                                if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, \r
-                                                             NextCDCDataInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                                             DComp_NextCDCDataInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
                                {\r
                                        /* Descriptor not found, error out */\r
                                        return NoCDCInterfaceFound;\r
@@ -110,7 +110,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                        \r
                                /* Get the next CDC control interface from the configuration descriptor (CDC class has two CDC interfaces) */\r
                                if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                                             NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                                             DComp_NextCDCControlInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
                                {\r
                                        /* Descriptor not found, error out */\r
                                        return NoCDCInterfaceFound;\r
@@ -119,7 +119,7 @@ uint8_t ProcessConfigurationDescriptor(void)
 \r
                        /* Fetch the next bulk or interrupt endpoint from the current CDC interface */\r
                        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                                     NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                                     DComp_NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
                        {\r
                                /* Descriptor not found, error out */\r
                                return NoEndpointFound;\r
@@ -186,7 +186,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextCDCControlInterface)\r
+uint8_t DComp_NextCDCControlInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -210,7 +210,7 @@ DESCRIPTOR_COMPARATOR(NextCDCControlInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextCDCDataInterface)\r
+uint8_t DComp_NextCDCDataInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -236,7 +236,7 @@ DESCRIPTOR_COMPARATOR(NextCDCDataInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceCDCDataEndpoint)\r
+uint8_t DComp_NextInterfaceCDCDataEndpoint(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
index ea00f61..1a118ca 100644 (file)
                        NoEndpointFound                 = 5, /**< Compatible CDC endpoints were not found in the device's CDC interface */\r
                };\r
 \r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextCDCControlInterface);\r
-               DESCRIPTOR_COMPARATOR(NextCDCDataInterface);\r
-               DESCRIPTOR_COMPARATOR(NextInterfaceCDCDataEndpoint);\r
-\r
        /* Function Prototypes: */\r
                uint8_t ProcessConfigurationDescriptor(void);   \r
-\r
+               \r
+               uint8_t DComp_NextCDCControlInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextCDCDataInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceCDCDataEndpoint(void* CurrentDescriptor);\r
+               \r
 #endif\r
index ecd6269..d9c58a3 100644 (file)
@@ -506,7 +506,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 1c0a6b2..29fa60b 100644 (file)
@@ -72,7 +72,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the HID interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextHIDInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextHIDInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
@@ -82,7 +82,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        {\r
                /* Get the next HID interface's data endpoint descriptor */\r
                if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                             NextInterfaceHIDDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                             DComp_NextInterfaceHIDDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
                {\r
                        /* Not all HID devices have an OUT endpoint - if we've reached the end of the HID descriptor\r
                         * but only found the mandatory IN endpoint, it's safe to continue with the device enumeration */\r
@@ -129,7 +129,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextHIDInterface)\r
+uint8_t DComp_NextHIDInterface(void* CurrentDescriptor)\r
 {\r
        /* Determine if the current descriptor is an interface descriptor */\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
@@ -155,7 +155,7 @@ DESCRIPTOR_COMPARATOR(NextHIDInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceHIDDataEndpoint)\r
+uint8_t DComp_NextInterfaceHIDDataEndpoint(void* CurrentDescriptor)\r
 {\r
        /* Determine the type of the current descriptor */\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
index fac7729..b58d440 100644 (file)
                        NoEndpointFound                 = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */\r
                };      \r
 \r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextHIDInterface);\r
-               DESCRIPTOR_COMPARATOR(NextInterfaceHIDDataEndpoint);\r
-\r
        /* Function Prototypes: */\r
-               uint8_t ProcessConfigurationDescriptor(void);   \r
+               uint8_t ProcessConfigurationDescriptor(void);\r
+\r
+               uint8_t DComp_NextHIDInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceHIDDataEndpoint(void* CurrentDescriptor);\r
 \r
 #endif\r
index 580612c..e731f90 100644 (file)
@@ -80,7 +80,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -92,7 +92,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop HID and USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -105,7 +105,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Start HID Host task */\r
        Scheduler_SetTaskMode(USB_HID_Host, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -129,7 +129,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 3ae473e..7e2f8b8 100644 (file)
                        Status_EnumerationError = 3, /**< Software error while enumerating the attached USB device */\r
                        Status_HardwareError    = 4, /**< Hardware error while enumerating the attached USB device */\r
                };\r
-               \r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
 \r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                void ReadNextReport(void);\r
                void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t ReportType, uint16_t ReportLength);\r
index d261da9..617ab7e 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index b0233d9..e586ea5 100644 (file)
@@ -70,7 +70,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the keyboard interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextKeyboardInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextKeyboardInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
@@ -78,7 +78,7 @@ uint8_t ProcessConfigurationDescriptor(void)
 \r
        /* Get the keyboard interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextInterfaceKeyboardDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextInterfaceKeyboardDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r
@@ -105,7 +105,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextKeyboardInterface)\r
+uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -129,7 +129,7 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)\r
+uint8_t DComp_NextInterfaceKeyboardDataEndpoint(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
index 416315b..425f0a4 100644 (file)
                        NoHIDInterfaceFound             = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */\r
                        NoEndpointFound                 = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */\r
                };\r
-       \r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextKeyboardInterface);\r
-               DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint);\r
 \r
        /* Function Prototypes: */\r
-               uint8_t ProcessConfigurationDescriptor(void);   \r
+               uint8_t ProcessConfigurationDescriptor(void);\r
+               \r
+               uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceKeyboardDataEndpoint(void* CurrentDescriptor);\r
 \r
 #endif\r
index 628a273..2b9bb2b 100644 (file)
@@ -80,7 +80,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -92,7 +92,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop Keyboard and USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -105,7 +105,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Start Keyboard Host task */\r
        Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -129,7 +129,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 6a60143..d00b76a 100644 (file)
        /* Task Definitions: */\r
                TASK(USB_Keyboard_Host);\r
 \r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
-\r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                void ReadNextReport(void);\r
                \r
index e304974..9ea163e 100644 (file)
@@ -506,7 +506,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 9cdf6f8..4ee3b99 100644 (file)
@@ -70,7 +70,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the keyboard interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextKeyboardInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextKeyboardInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
@@ -78,7 +78,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the keyboard interface's HID descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextHID) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextHID) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDDescriptorFound;\r
@@ -89,7 +89,7 @@ uint8_t ProcessConfigurationDescriptor(void)
 \r
        /* Get the keyboard interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextInterfaceKeyboardDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextInterfaceKeyboardDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r
@@ -116,7 +116,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextKeyboardInterface)\r
+uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -140,7 +140,7 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)\r
+uint8_t DComp_NextInterfaceKeyboardDataEndpoint(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
@@ -163,7 +163,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextHID)\r
+uint8_t DComp_NextHID(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)\r
          return DESCRIPTOR_SEARCH_Found;\r
index 1deff63..338adc9 100644 (file)
                        NoHIDDescriptorFound            = 5, /**< A compatible HID descriptor was not found in the device's HID interface */\r
                        NoEndpointFound                 = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */\r
                };\r
-       \r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextKeyboardInterface);\r
-               DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint);\r
-               DESCRIPTOR_COMPARATOR(NextHID);\r
 \r
        /* Function Prototypes: */\r
-               uint8_t ProcessConfigurationDescriptor(void);   \r
+               uint8_t ProcessConfigurationDescriptor(void);\r
 \r
+               uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceKeyboardDataEndpoint(void* CurrentDescriptor);\r
+               uint8_t DComp_NextHID(void* CurrentDescriptor);\r
+               \r
 #endif\r
index 9eb3d10..840cb90 100644 (file)
@@ -80,7 +80,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -92,7 +92,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop keyboard and USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -105,7 +105,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Start Keyboard Host task */\r
        Scheduler_SetTaskMode(USB_Keyboard_Host, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -129,7 +129,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index a0e055f..acb5b8b 100644 (file)
        /* Task Definitions: */\r
                TASK(USB_Keyboard_Host);\r
 \r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
-\r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                void ProcessKeyboardReport(uint8_t* KeyboardReport);\r
                \r
index ad8f072..43559d8 100644 (file)
@@ -507,7 +507,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index c02f3b0..c951c79 100644 (file)
@@ -71,7 +71,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the mass storage interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextMassStorageInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextMassStorageInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoInterfaceFound;\r
@@ -82,7 +82,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        {\r
                /* Fetch the next bulk endpoint from the current mass storage interface */\r
                if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                             NextInterfaceBulkDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                             DComp_NextInterfaceBulkDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
                {\r
                        /* Descriptor not found, error out */\r
                        return NoEndpointFound;\r
@@ -127,7 +127,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextMassStorageInterface)\r
+uint8_t DComp_NextMassStorageInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -152,7 +152,7 @@ DESCRIPTOR_COMPARATOR(NextMassStorageInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceBulkDataEndpoint)\r
+uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
index b02e088..6c0b8e6 100644 (file)
                        NoInterfaceFound                = 4, /**< A compatible MSD interface was not found in the device's Configuration Descriptor */\r
                        NoEndpointFound                 = 5, /**< The correct MSD endpoint descriptors were not found in the device's MSD interface */\r
                };\r
-\r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextMassStorageInterface);\r
-               DESCRIPTOR_COMPARATOR(NextInterfaceBulkDataEndpoint);\r
-\r
+               \r
        /* Function Prototypes: */\r
                uint8_t ProcessConfigurationDescriptor(void);   \r
 \r
+               uint8_t DComp_NextMassStorageInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor);\r
+               \r
 #endif\r
index d06e3a6..a2e6631 100644 (file)
@@ -85,7 +85,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -97,7 +97,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop USB management and Mass Storage tasks */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -110,7 +110,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Once device is fully enumerated, start the Mass Storage Host task */\r
        Scheduler_SetTaskMode(USB_MassStore_Host, TASK_RUN);\r
@@ -120,7 +120,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -134,7 +134,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 2160659..1646ad7 100644 (file)
 \r
        /* Task Definitions: */\r
                TASK(USB_MassStore_Host);\r
-\r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
                                \r
        /* Function Prototypes: */\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
+\r
                void ShowDiskReadError(char* CommandString, bool FailedAtSCSILayer, uint8_t ErrorCode);\r
                void UpdateStatus(uint8_t CurrentStatus);               \r
 \r
index 6987794..5c1de65 100644 (file)
@@ -508,7 +508,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index 435a4f9..0f6ab59 100644 (file)
@@ -70,7 +70,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the mouse interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
@@ -78,7 +78,7 @@ uint8_t ProcessConfigurationDescriptor(void)
 \r
        /* Get the mouse interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r
@@ -105,7 +105,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextMouseInterface)\r
+uint8_t DComp_NextMouseInterface(void* CurrentDescriptor)\r
 {\r
        /* Determine if the current descriptor is an interface descriptor */\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
@@ -132,7 +132,7 @@ DESCRIPTOR_COMPARATOR(NextMouseInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)\r
+uint8_t DComp_NextInterfaceMouseDataEndpoint(void* CurrentDescriptor)\r
 {\r
        /* Determine the type of the current descriptor */\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
index 40286e5..cb1ae63 100644 (file)
                        InvalidConfigDataReturned       = 3, /**< The device returned an invalid Configuration Descriptor */\r
                        NoHIDInterfaceFound             = 4, /**< A compatible HID interface was not found in the device's Configuration Descriptor */\r
                        NoEndpointFound                 = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */\r
-               };      \r
-\r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextMouseInterface);\r
-               DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint);\r
+               };\r
 \r
        /* Function Prototypes: */\r
-               uint8_t ProcessConfigurationDescriptor(void);   \r
+               uint8_t ProcessConfigurationDescriptor(void);\r
+\r
+               uint8_t DComp_NextMouseInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceMouseDataEndpoint(void* CurrentDescriptor);\r
 \r
 #endif\r
index 77db552..7db9580 100644 (file)
@@ -80,7 +80,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -92,7 +92,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop mouse and USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -105,7 +105,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Start Mouse Host task */\r
        Scheduler_SetTaskMode(USB_Mouse_Host, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -129,7 +129,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 81b0412..7111218 100644 (file)
                        Status_HardwareError    = 4, /**< Hardware error while enumerating the attached USB device */\r
                };\r
                \r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
-\r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                void ReadNextReport(void);\r
                \r
index 1cfba95..4987c9d 100644 (file)
@@ -505,7 +505,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index c008523..5d9d3f0 100644 (file)
@@ -70,7 +70,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the mouse interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
@@ -78,7 +78,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the mouse interface's HID descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextHID) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextHID) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDDescriptorFound;\r
@@ -89,7 +89,7 @@ uint8_t ProcessConfigurationDescriptor(void)
 \r
        /* Get the mouse interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r
@@ -116,7 +116,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextMouseInterface)\r
+uint8_t DComp_NextMouseInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -140,7 +140,7 @@ DESCRIPTOR_COMPARATOR(NextMouseInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)\r
+uint8_t DComp_NextInterfaceMouseDataEndpoint(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
@@ -163,7 +163,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextHID)\r
+uint8_t DComp_NextHID(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)\r
          return DESCRIPTOR_SEARCH_Found;\r
index 7cb12db..08400c5 100644 (file)
                        NoHIDDescriptorFound            = 5, /**< A compatible HID descriptor was not found in the device's HID interface */\r
                        NoEndpointFound                 = 5, /**< A compatible HID IN endpoint was not found in the device's HID interface */\r
                };\r
-       \r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextMouseInterface);\r
-               DESCRIPTOR_COMPARATOR(NextInterfaceMouseDataEndpoint);\r
-               DESCRIPTOR_COMPARATOR(NextHID);\r
 \r
        /* Function Prototypes: */\r
-               uint8_t ProcessConfigurationDescriptor(void);   \r
+               uint8_t ProcessConfigurationDescriptor(void);\r
+\r
+               uint8_t DComp_NextMouseInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextInterfaceMouseDataEndpoint(void* CurrentDescriptor);\r
+               uint8_t DComp_NextHID(void* CurrentDescriptor);\r
 \r
 #endif\r
index 58a189f..f26e9e2 100644 (file)
@@ -80,7 +80,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -92,7 +92,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop mouse and USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -105,7 +105,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Start Mouse Host task */\r
        Scheduler_SetTaskMode(USB_Mouse_Host, TASK_RUN);\r
@@ -115,7 +115,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -129,7 +129,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 99970e2..f2cc2fd 100644 (file)
 \r
        /* Task Definitions: */\r
                TASK(USB_Mouse_Host);\r
-               \r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
 \r
        /* Function Prototypes: */\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
+\r
                void UpdateStatus(uint8_t CurrentStatus);\r
                void ProcessMouseReport(uint8_t* MouseReport);\r
 \r
index 4e1aa90..be8f48f 100644 (file)
@@ -507,7 +507,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index b58dfb8..1084969 100644 (file)
@@ -71,7 +71,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        \r
        /* Get the Still Image interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextStillImageInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                     DComp_NextStillImageInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoInterfaceFound;\r
@@ -82,7 +82,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        {\r
                /* Fetch the next endpoint from the current Still Image interface */\r
                if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                             NextSImageInterfaceDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
+                                             DComp_NextSImageInterfaceDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
                {\r
                        /* Descriptor not found, error out */\r
                        return NoEndpointFound;\r
@@ -148,7 +148,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextStillImageInterface)\r
+uint8_t DComp_NextStillImageInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -173,7 +173,7 @@ DESCRIPTOR_COMPARATOR(NextStillImageInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextSImageInterfaceDataEndpoint)\r
+uint8_t DComp_NextSImageInterfaceDataEndpoint(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
index cb4de5f..29df30c 100644 (file)
                        NoEndpointFound                 = 5, /**< The correct SI endpoint descriptors were not found in the device's SI interface */\r
                };\r
        \r
-       /* Configuration Descriptor Comparison Functions: */\r
-               DESCRIPTOR_COMPARATOR(NextStillImageInterface);\r
-               DESCRIPTOR_COMPARATOR(NextSImageInterfaceDataEndpoint);\r
-\r
        /* Function Prototypes: */\r
-               uint8_t ProcessConfigurationDescriptor(void);   \r
+               uint8_t ProcessConfigurationDescriptor(void);\r
+\r
+               uint8_t DComp_NextStillImageInterface(void* CurrentDescriptor);\r
+               uint8_t DComp_NextSImageInterfaceDataEndpoint(void* CurrentDescriptor);\r
 \r
 #endif\r
index ceec151..197e832 100644 (file)
@@ -81,7 +81,7 @@ int main(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
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR("Device Attached.\r\n"));\r
        UpdateStatus(Status_USBEnumerating);\r
@@ -93,7 +93,7 @@ EVENT_HANDLER(USB_DeviceAttached)
 /** 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
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        /* Stop USB management and Still Image tasks */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
@@ -106,7 +106,7 @@ EVENT_HANDLER(USB_DeviceUnattached)
 /** 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
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        /* Once device is fully enumerated, start the Still Image Host task */\r
        Scheduler_SetTaskMode(USB_SImage_Host, TASK_RUN);\r
@@ -116,7 +116,7 @@ EVENT_HANDLER(USB_DeviceEnumerationComplete)
 }\r
 \r
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        USB_ShutDown();\r
 \r
@@ -130,7 +130,7 @@ EVENT_HANDLER(USB_HostError)
 /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
  *  enumerating an attached USB device.\r
  */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
index 4c9091c..909ed89 100644 (file)
        /* Task Definitions: */\r
                TASK(USB_SImage_Host);\r
 \r
-       /* Event Handlers: */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-               HANDLES_EVENT(USB_DeviceEnumerationComplete);\r
-               HANDLES_EVENT(USB_HostError);\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
-               \r
        /* Function Prototypes: */\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
+\r
                void UnicodeToASCII(uint8_t* restrict UnicodeString, char* restrict Buffer);\r
                void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError);\r
                void UpdateStatus(uint8_t CurrentStatus);\r
index f78d66c..3663d48 100644 (file)
@@ -506,7 +506,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index b542bfc..a444cc6 100644 (file)
@@ -55,19 +55,19 @@ static void Abort_Program(void)
 }\r
 \r
 /** Event handler for the USB_VBUSChange event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_VBUSChange)\r
+void EVENT_USB_VBUSChange(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "VBUS Change\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_VBUSConnect event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_VBUSConnect)\r
+void EVENT_USB_VBUSConnect(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "VBUS +\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_VBUSDisconnect event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_VBUSDisconnect)\r
+void EVENT_USB_VBUSDisconnect(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "VBUS -\r\n"));\r
 }\r
@@ -76,7 +76,7 @@ EVENT_HANDLER(USB_VBUSDisconnect)
  *  Event handler for the USB_Connect event. When fired, the event is logged to the USART and the\r
  *  USB task started.\r
  */\r
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "USB  +\r\n"));\r
        LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED3 | LEDS_LED4);\r
@@ -88,7 +88,7 @@ EVENT_HANDLER(USB_Connect)
  *  Event handler for the USB_Disconnect event. When fired, the event is logged to the USART and the\r
  *  USB task stopped.\r
  */\r
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);\r
 \r
@@ -97,27 +97,27 @@ EVENT_HANDLER(USB_Disconnect)
 }\r
 \r
 /** Event handler for the USB_Suspend event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_Suspend)\r
+void EVENT_USB_Suspend(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_YELLOW "USB Sleep\r\n"));\r
        LEDs_SetAllLEDs(LEDS_ALL_LEDS);\r
 }\r
 \r
 /** Event handler for the USB_WakeUp event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_WakeUp)\r
+void EVENT_USB_WakeUp(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_GREEN "USB Wakeup\r\n"));\r
        LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED4);\r
 }\r
 \r
 /** Event handler for the USB_Reset event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_Reset)\r
+void EVENT_USB_Reset(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "USB Reset\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_UIDChange event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_UIDChange)\r
+void EVENT_USB_UIDChange(void)\r
 {\r
        char* ModeStrPtr;\r
 \r
@@ -139,7 +139,7 @@ EVENT_HANDLER(USB_UIDChange)
  *  Event handler for the USB_PowerOnFail event. When fired, the event is logged to the USART and the program\r
  *  execution aborted.\r
  */\r
-EVENT_HANDLER(USB_InitFailure)\r
+void EVENT_USB_InitFailure(const uint8_t ErrorCode)\r
 {\r
        char* ModeStrPtr;\r
        \r
@@ -162,7 +162,7 @@ EVENT_HANDLER(USB_InitFailure)
  *  Event handler for the USB_HostError event. When fired, the event is logged to the USART and the program\r
  *  execution aborted.\r
  */\r
-EVENT_HANDLER(USB_HostError)\r
+void EVENT_USB_HostError(const uint8_t ErrorCode)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_RED "Host Mode Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
@@ -171,7 +171,7 @@ EVENT_HANDLER(USB_HostError)
 }\r
 \r
 /** Event handler for the USB_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceEnumerationFailed)\r
+void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
 {\r
        puts_P(PSTR(ESC_BG_RED "Dev Enum Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
@@ -183,7 +183,7 @@ EVENT_HANDLER(USB_DeviceEnumerationFailed)
  *  Event handler for the USB_DeviceError event. When fired, the event is logged to the USART and the program\r
  *  execution aborted.\r
  */\r
-EVENT_HANDLER(USB_DeviceError)\r
+void EVENT_USB_DeviceError(const uint8_t ErrorCode)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_RED "Device Mode Error\r\n"));\r
        printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
@@ -192,7 +192,7 @@ EVENT_HANDLER(USB_DeviceError)
 }\r
 \r
 /** Event handler for the USB_UnhandledControlPacket event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "Ctrl Request\r\n"));\r
        printf_P(PSTR(" -- Req Data %d\r\n"), USB_ControlRequest.bRequest);\r
@@ -201,7 +201,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
 }\r
 \r
 /** Event handler for the USB_ConfigurationChanged event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "Configuration Number Changed\r\n"));\r
 \r
@@ -209,7 +209,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
 }\r
 \r
 /** Event handler for the USB_DeviceAttached event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceAttached)\r
+void EVENT_USB_DeviceAttached(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_GREEN "Device +\r\n"));\r
 \r
@@ -217,13 +217,13 @@ EVENT_HANDLER(USB_DeviceAttached)
 }\r
 \r
 /** Event handler for the USB_DeviceUnattached event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceUnattached)\r
+void EVENT_USB_DeviceUnattached(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX ESC_BG_YELLOW "Device -\r\n"));\r
 }\r
 \r
 /** Event handler for the USB_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */\r
-EVENT_HANDLER(USB_DeviceEnumerationComplete)\r
+void EVENT_USB_DeviceEnumerationComplete(void)\r
 {\r
        puts_P(PSTR(EVENT_PREFIX "Device Enumeration Complete\r\n"));\r
 }\r
index a1f149f..656c070 100644 (file)
                #include <LUFA/Drivers/Misc/TerminalCodes.h>             // ANSI Terminal Escape Codes\r
                #include <LUFA/Scheduler/Scheduler.h>                    // Simple scheduler for task management\r
 \r
-       /* Event Catch List: */\r
-               /** Indicates that this module will catch the USB_VBUSChange event when thrown by the library. */\r
-               HANDLES_EVENT(USB_VBUSChange);\r
-\r
-               /** Indicates that this module will catch the USB_VBUSConnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_VBUSConnect);\r
-\r
-               /** Indicates that this module will catch the USB_VBUSDisconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_VBUSDisconnect);\r
-\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_Suspend event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Suspend);\r
-\r
-               /** Indicates that this module will catch the USB_WakeUp event when thrown by the library. */\r
-               HANDLES_EVENT(USB_WakeUp);\r
-\r
-               /** Indicates that this module will catch the USB_Reset event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Reset);\r
-\r
-               /** Indicates that this module will catch the USB_UIDChange event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UIDChange);\r
-\r
-               /** Indicates that this module will catch the USB_InitFailure event when thrown by the library. */\r
-               HANDLES_EVENT(USB_InitFailure);\r
-\r
-               /** Indicates that this module will catch the USB_HostError event when thrown by the library. */\r
-               HANDLES_EVENT(USB_HostError);\r
-\r
-               /** Indicates that this module will catch the USB_DeviceEnumerationFailed event when thrown by the library. */\r
-               HANDLES_EVENT(USB_DeviceEnumerationFailed);\r
-\r
-               /** Indicates that this module will catch the USB_DeviceError event when thrown by the library. */\r
-               HANDLES_EVENT(USB_DeviceError);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_DeviceAttached event when thrown by the library. */\r
-               HANDLES_EVENT(USB_DeviceAttached);\r
-\r
-               /** Indicates that this module will catch the USB_DeviceUnattached event when thrown by the library. */\r
-               HANDLES_EVENT(USB_DeviceUnattached);\r
-\r
        /* Macros: */\r
                /** Prefix sent through the USART when an even fires before the actual event message. */\r
                #define EVENT_PREFIX ESC_INVERSE_ON "EVENT:" ESC_INVERSE_OFF " "\r
                        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_DeviceError(const uint8_t ErrorCode);            \r
+               \r
 #endif\r
index 0ff49b6..3c34d55 100644 (file)
@@ -509,7 +509,7 @@ sizeafter:
 checkhooks: build\r
        @echo\r
        @echo ------- Unhooked LUFA Events -------\r
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \\r
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \\r
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \\r
                           echo "(None)"\r
        @echo ------------------------------------\r
index c6d72cf..77599c9 100644 (file)
   *  - Clarified the size of library tokens which accept integer values in the Compile Time Tokens page, values now use the smallest datatype\r
   *    inside the library that is able to hold their defined value to save space\r
   *  - Removed DESCRIPTOR_ADDRESS() macro as it was largely supurflous and only served to obfuscate code\r
+  *  - Rewritten event system to remove all macros, to make user code clearer\r
+  *  - Fixed incorrect ENDPOINT_EPNUM_MASK mask preventing endpoints above EP3 from being selected (thanks to Jonathan Oakley)\r
+  *  - Removed STREAM_CALLBACK() macro - callbacks now use regular function definitions to clarify user code\r
+  *  - Removed DESCRIPTOR_COMPARATOR() macro - comparators should now use regular function definitions to clarify user code\r
   *\r
   *\r
   *  \section Sec_ChangeLog090510 Version 090510\r
index 59e3a4b..bbe258b 100644 (file)
@@ -114,7 +114,7 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
          USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);\r
 }\r
                        \r
-uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine)\r
+uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine)\r
 {\r
        uint8_t ErrorCode;\r
                \r
index 74d6d27..5c2b6e2 100644 (file)
                        #else\r
                                #define DESCRIPTOR_SIZE(DescriptorPtr)    DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bLength\r
                        #endif\r
-                       \r
-                       /** Creates a prototype for or begins a descriptor comparator routine. Descriptor comparator routines are \r
-                        *  small search routines which are passed a pointer to the current sub descriptor in the configuration\r
-                        *  descriptor, and which analyse the sub descriptor to determine whether or not it matches the routine's\r
-                        *  search parameters. Comparator routines provide a powerful way to scan through the config descriptor\r
-                        *  for certain descriptors matching unique criteria.\r
+\r
+               /* Type Defines: */\r
+                       /** Type define for a Configuration Descriptor comparator function (function taking a pointer to an array\r
+                        *  of type void, returning a uint8_t value).\r
                         *\r
-                        *  Comparator routines are passed in a single pointer named CurrentDescriptor, and should return a value\r
-                        *  of a member of the \ref DSearch_Return_ErrorCodes_t enum.\r
+                        *  \see \ref USB_GetNextDescriptorComp function for more details\r
                         */\r
-                       #define DESCRIPTOR_COMPARATOR(name)           uint8_t DCOMP_##name (void* const CurrentDescriptor)\r
+                       typedef uint8_t (* const ConfigComparatorPtr_t)(void* const);\r
 \r
-               /* Pseudo-Function Macros: */\r
-                       #if defined(__DOXYGEN__)\r
-                               /** Searches for the next descriptor in the given configuration descriptor using a premade comparator\r
-                                *  function. The routine updates the position and remaining configuration descriptor bytes values\r
-                                *  automatically. If a comparator routine fails a search, the descriptor pointer is retreated back\r
-                                *  so that the next descriptor search invocation will start from the descriptor which first caused the\r
-                                *  original search to fail. This behaviour allows for one comparator to be used immediately after another\r
-                                *  has failed, starting the second search from the descriptor which failed the first.\r
-                                *\r
-                                *  \note This function is available in USB Host mode only.\r
-                                *\r
-                                *  \param BytesRem  Pointer to an int storing the remaining bytes in the configuration descriptor\r
-                                *  \param CurrConfigLoc  Pointer to the current position in the configuration descriptor\r
-                                *  \param ComparatorRoutine  Name of the comparator search function to use on the configuration descriptor\r
-                                *\r
-                                *  \return Value of one of the members of the \ref DSearch_Comp_Return_ErrorCodes_t enum\r
-                                *\r
-                                *  Usage Example:\r
-                                *  \code\r
-                                *  DESCRIPTOR_COMPARATOR(EndpointSearcher); // Comparator Prototype\r
-                                *\r
-                                *  DESCRIPTOR_COMPARATOR(EndpointSearcher)\r
-                                *  {\r
-                                *     if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
-                                *         return DESCRIPTOR_SEARCH_Found;\r
-                                *     else\r
-                                *         return DESCRIPTOR_SEARCH_NotFound;\r
-                                *  }\r
-                                *\r
-                                *  //...\r
-                                *  // After retrieving configuration descriptor:\r
-                                *  if (USB_Host_GetNextDescriptorComp(&BytesRemaining, &ConfigDescriptorData, EndpointSearcher) ==\r
-                                *      Descriptor_Search_Comp_Found)\r
-                                *  {\r
-                                *      // Do something with the endpoint descriptor\r
-                                *  }\r
-                                *  \endcode\r
-                                */\r
-                               uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine);\r
-                       #else\r
-                               #define USB_GetNextDescriptorComp(DSize, DPos, DSearch) USB_GetNextDescriptorComp_Prv(DSize, DPos, DCOMP_##DSearch)\r
-                       #endif\r
+               /* Function Prototypes: */\r
+                       /** Searches for the next descriptor in the given configuration descriptor using a premade comparator\r
+                        *  function. The routine updates the position and remaining configuration descriptor bytes values\r
+                        *  automatically. If a comparator routine fails a search, the descriptor pointer is retreated back\r
+                        *  so that the next descriptor search invocation will start from the descriptor which first caused the\r
+                        *  original search to fail. This behaviour allows for one comparator to be used immediately after another\r
+                        *  has failed, starting the second search from the descriptor which failed the first.\r
+                        *\r
+                        *  Comparator functions should be standard functions which accept a pointer to the header of the current\r
+                        *  descriptor inside the configuration descriptor which is being compared, and should return a value from\r
+                        *  the \ref DSearch_Return_ErrorCodes_t enum as a uint8_t value.\r
+                        *\r
+                        *  \note This function is available in USB Host mode only.\r
+                        *\r
+                        *  \param BytesRem  Pointer to an int storing the remaining bytes in the configuration descriptor\r
+                        *  \param CurrConfigLoc  Pointer to the current position in the configuration descriptor\r
+                        *  \param ComparatorRoutine  Name of the comparator search function to use on the configuration descriptor\r
+                        *\r
+                        *  \return Value of one of the members of the \ref DSearch_Comp_Return_ErrorCodes_t enum\r
+                        *\r
+                        *  Usage Example:\r
+                        *  \code\r
+                        *  uint8_t EndpointSearcher(void* CurrentDescriptor); // Comparator Prototype\r
+                        *\r
+                        *  uint8_t EndpointSearcher(void* CurrentDescriptor)\r
+                        *  {\r
+                        *     if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
+                        *         return DESCRIPTOR_SEARCH_Found;\r
+                        *     else\r
+                        *         return DESCRIPTOR_SEARCH_NotFound;\r
+                        *  }\r
+                        *\r
+                        *  //...\r
+                        *  // After retrieving configuration descriptor:\r
+                        *  if (USB_Host_GetNextDescriptorComp(&BytesRemaining, &ConfigDescriptorData, EndpointSearcher) ==\r
+                        *      Descriptor_Search_Comp_Found)\r
+                        *  {\r
+                        *      // Do something with the endpoint descriptor\r
+                        *  }\r
+                        *  \endcode\r
+                        */\r
+                       uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine);\r
                        \r
                /* Enums: */\r
-                       /** Enum for return values of a descriptor comparator made with \ref DESCRIPTOR_COMPARATOR. */\r
+                       /** Enum for return values of a descriptor comparator function. */\r
                        enum DSearch_Return_ErrorCodes_t\r
                        {\r
                                DESCRIPTOR_SEARCH_Found                = 0, /**< Current descriptor matches comparator criteria. */\r
                                *BytesRem      -= CurrDescriptorSize;\r
                        }\r
                        \r
-               /* Type Defines: */\r
-                       /** Type define for a Configuration Descriptor comparator function (function taking a pointer to an array\r
-                        *  of type void, returning a uint8_t value).\r
-                        *\r
-                        *  \see \ref USB_GetNextDescriptorComp function for more details\r
-                        */\r
-                       typedef uint8_t (* const ConfigComparatorPtr_t)(void* const);\r
-\r
-       /* Private Interface - For use in library only: */\r
-       #if !defined(__DOXYGEN__)\r
-               /* Function Prototypes: */\r
-                       uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine);\r
-       #endif\r
-                       \r
        /* Disable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
                        }\r
index 45ad801..e65352e 100644 (file)
@@ -36,9 +36,9 @@
  *  multiple places in the user or library code, which may or may not be inside an ISR, thus each handler\r
  *  should be written to be as small and fast as possible to prevent possible problems.\r
  *\r
- *  Events can be hooked by the user application using the \ref EVENT_HANDLER() and \ref HANDLES_EVENT() macros. If an\r
- *  event with no associated handler is fired within the library, it by default fires an internal empty stub\r
- *  function. This is achieved through the use of the GCC compiler's "alias" attribute.\r
+ *  Events can be hooked by the user application by declaring a handler function with the same name and parameters\r
+ *  listed here. If an event with no user-associated handler is fired within the library, it by default maps to an\r
+ *  internal empty stub function. This is achieved through the use of the GCC compiler's "alias" attribute.\r
  *\r
  *  Each event must only have one associated event handler, but can be raised by multiple sources.\r
  *\r
                        extern "C" {\r
                #endif\r
 \r
-       /* Public Interface - May be used in end-application: */\r
-               /* Macros: */\r
-                       /** Raises a given event name, with the specified parameters. For events with no parameters the\r
-                        *  only argument to the macro is the event name, events with parameters list the parameter values\r
-                        *  after the name as a comma separated list.\r
-                        *\r
-                        *  When a given event is fired, its corresponding event handler code is executed.\r
-                        *\r
-                        *  Usage Examples:\r
-                        *  \code\r
-                        *  // Raise the USB_VBUSChange event, which takes no parameters\r
-                        *  RAISE_EVENT(USB_VBUSChange);\r
-                        *\r
-                        *  // Raise the USB_UnhandledControlPacket event which takes two parameters\r
-                        *  RAISE_EVENT(USB_UnhandledControlPacket, 0, 1);\r
-                        *  \endcode\r
-                        *\r
-                        *  \see RAISES_EVENT()\r
-                        */\r
-                       #define RAISE_EVENT(e, ...)                 Event_ ## e (__VA_ARGS__)\r
-\r
-                       /** Indicates that a given module can raise a given event. This is the equivalent of putting the\r
-                        *  event function's prototype into the module, but in a cleaner way. Each event which may be\r
-                        *  fired via the \ref RAISE_EVENT macro in the module should have an accompanying \ref RAISES_EVENT\r
-                        *  prototype in the module's header file.\r
-                        *\r
-                        *  Usage Examples:\r
-                        *  \code\r
-                        *  // Module can raise the USB_VBUSChange event\r
-                        *  RAISES_EVENT(USB_VBUSChange);\r
-                        *\r
-                        *  // ...\r
-                        *  // Inside a block of code in a function of the module, raise the USB_VBUSChange event\r
-                        *  RAISE_EVENT(USB_VBUSChange);\r
-                        *  \endcode\r
-                        *\r
-                        *  \see RAISE_EVENT()\r
-                        */\r
-                       #define RAISES_EVENT(e)                     HANDLES_EVENT(e)\r
-\r
-                       /** Defines an event handler for the given event. Event handlers should be short in length, as they\r
-                        *  may be raised from inside an ISR. The user application can react to each event as it sees fit,\r
-                        *  such as logging the event, indicating the change to the user or performing some other action.\r
-                        *\r
-                        *  Only one event handler may be defined in any user project for each individual event. Events may\r
-                        *  or may not have parameters - for each event, refer to its documentation elsewhere in this module\r
-                        *  to determine the presence and purpose of any event parameters.\r
-                        *\r
-                        *  Usage Example:\r
-                        *  \code\r
-                        *  // Create an event handler for the USB_VBUSChange event\r
-                        *  EVENT_HANDLER(USB_VBUSChange)\r
-                        *  {\r
-                        *      // Code to execute when the VBUS level changes\r
-                        *  }\r
-                        *  \endcode\r
-                        *\r
-                        *  \see HANDLES_EVENT()\r
-                        */\r
-                       #define EVENT_HANDLER(e)                    void Event_ ## e e ## _P\r
-                       \r
-                       /** Indicates that a given module handles an event. This is the equivalent of putting the\r
-                        *  event function's prototype into the module, but in a cleaner way. Each event which may be\r
-                        *  handled via the \ref EVENT_HANDLER macro in the module should have an accompanying \ref HANDLES_EVENT\r
-                        *  prototype in the module's header file.\r
-                        *\r
-                        *  Usage Examples:\r
-                        *  \code\r
-                        *  // Module handles the USB_VBUSChange event\r
-                        *  HANDLES_EVENT(USB_VBUSChange);\r
-                        *\r
-                        *  // Create the USB_VBUSChange event handler\r
-                        *  EVENT_HANDLER(USB_VBUSChange)\r
-                        *  {\r
-                        *      // Event handler code here\r
-                        *  }\r
-                        *  \endcode\r
-                        *\r
-                        *  \see EVENT_HANDLER()\r
-                        */\r
-                       #define HANDLES_EVENT(e)                    EVENT_HANDLER(e)\r
-                       \r
+       /* Public Interface - May be used in end-application: */                        \r
                /* Pseudo-Functions for Doxygen: */\r
-               #if defined(__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.\r
                         *\r
                         *  \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
                         */\r
-                       void USB_VBUSChange(void);\r
+                       void EVENT_USB_VBUSChange(void);\r
 \r
                        /** Event for VBUS attachment. This event fires when the VBUS line of the USB AVR changes from\r
                         *  low to high, signalling the attachment of the USB device to a host, before the enumeration\r
                         *\r
                         *  \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
                         */\r
-                       void USB_VBUSConnect(void);\r
+                       void EVENT_USB_VBUSConnect(void);\r
 \r
                        /** Event for VBUS detachment. This event fires when the VBUS line of the USB AVR changes from\r
                         *  high to low, signalling the USB device has been removed from a host whether it has been enumerated\r
                         *\r
                         *  \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
                         */\r
-                       void USB_VBUSDisconnect(void);\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
                         *        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 by \ref RAISE_EVENT(), and the \ref USB_IsConnected global changed manually.\r
+                        *        and disconnection events may be manually fired, and the \ref USB_IsConnected global changed manually.\r
                         *\r
                         *  \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
                         */\r
-                       void USB_Connect(void);\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
                         *        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 by \ref RAISE_EVENT(), and the \ref USB_IsConnected global changed manually.\r
+                        *        and disconnection events may be manually fired, and the \ref USB_IsConnected global changed manually.\r
                         *\r
                         *  \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
                         */\r
-                       void USB_Disconnect(void);\r
+                       void EVENT_USB_Disconnect(void);\r
                        \r
                        /** Event for USB initialization failure. This event fires when the USB interface fails to\r
                         *  initialize correctly due to a hardware or software fault.\r
                         *  \note This event only exists on USB AVR models which support dual role modes.\r
                         *\r
                         *  \param ErrorCode  Error code indicating the failure reason, a value in \ref USB_InitErrorCodes_t\r
-                        *                    located in LowLevel.h.\r
                         */\r
-                       void USB_InitFailure(const uint8_t ErrorCode);\r
+                       void EVENT_USB_InitFailure(const uint8_t ErrorCode);\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
                         *  \note This event does not exist if the USB_DEVICE_ONLY or USB_HOST_ONLY tokens have been supplied\r
                         *        to the compiler (see \ref Group_USBManagement documentation).\r
                         */\r
-                       void USB_UIDChange(void);\r
+                       void EVENT_USB_UIDChange(void);\r
 \r
                        /** Event for USB host error. This event fires when a hardware fault has occurred whilst the USB\r
                         *  interface is in host mode.\r
                         *\r
                         *  \param ErrorCode  Error code indicating the failure reason, a value in \ref USB_Host_ErrorCodes_t\r
-                        *                    located in Host.h.\r
                         *\r
                         *  \note This event only exists on USB AVR models which supports host mode.\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 USB_HostError(const uint8_t ErrorCode);\r
+                       void EVENT_USB_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 USB_Connect event and so can be used to programmatically start the USB management\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
                         *\r
                         *  \note This event only exists on USB AVR models which supports host mode.\r
                         *\r
                         *  \see \ref TASK(USB_USBTask) for more information on the USB management task and reducing CPU usage.\r
                         */\r
-                       void USB_DeviceAttached(void);\r
+                       void EVENT_USB_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 TASK(USB_USBTask) for more information on the USB management task and reducing CPU usage.\r
                         */\r
-                       void USB_DeviceUnattached(void);\r
+                       void EVENT_USB_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
                         *\r
                         *  \param ErrorCode  Error code indicating the failure reason, a value in \r
-                        *                    \ref USB_Host_EnumerationErrorCodes_t located in Host.h.\r
+                        *                    \ref USB_Host_EnumerationErrorCodes_t\r
                         *\r
                         *  \param SubErrorCode  Sub error code indicating the reason for failure - for example, if the\r
                         *                       ErrorCode parameter indicates a control error, this will give the error\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 USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+                       void EVENT_USB_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
                         */\r
-                       void USB_DeviceEnumerationComplete(void);\r
+                       void EVENT_USB_DeviceEnumerationComplete(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 USB_UnhandledControlPacket(void);\r
+                       void EVENT_USB_UnhandledControlPacket(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 USB_ConfigurationChanged(void);\r
+                       void EVENT_USB_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 USB_WakeUp() event for accompanying Wake Up event.\r
+                        *  \see \ref EVENT_USB_WakeUp() event for accompanying Wake Up event.\r
                         */\r
-                       void USB_Suspend(void);\r
+                       void EVENT_USB_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 USB_Suspend() event for accompanying Suspend event.\r
+                        *  \see \ref EVENT_USB_Suspend() event for accompanying Suspend event.\r
                         */\r
-                       void USB_WakeUp(void);\r
+                       void EVENT_USB_WakeUp(void);\r
 \r
                        /** Event for USB interface reset. This event fires when a the USB interface is in device mode, and\r
                         *  a the USB host requests that the device reset its interface. This is generally hooked so that\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 USB_Reset(void);\r
+                       void EVENT_USB_Reset(void);\r
                        \r
                        /** Event for USB device mode error. This event fires when the USB interface is in device mode,\r
                         *  and an error occurs which prevents it from operating normally.\r
                         *\r
-                        *  \param ErrorCode  Error code indicating the source of the error. One of the values in the\r
-                        *                    \ref USB_Device_ErrorCodes_t enum located in Device.h.\r
+                        *  \param ErrorCode  Error code indicating the source of the error, a value in\r
+                        *                    \ref USB_Device_ErrorCodes_t\r
                         *\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 USB_DeviceError(const uint8_t ErrorCode);\r
+                       void EVENT_USB_DeviceError(const uint8_t ErrorCode);\r
                #endif\r
                \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
-               /* Macros: */\r
-                       #define ALIAS_STUB(e)                       EVENT_HANDLER(e) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub)\r
-               \r
-                       #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)\r
-                               #define USB_VBUSChange_P                (void)\r
-                               #define USB_VBUSConnect_P               (void)\r
-                               #define USB_VBUSDisconnect_P            (void)\r
-                       #endif\r
-                       \r
-                       #define USB_Connect_P                       (void)\r
-                       #define USB_Disconnect_P                    (void)\r
-                       #define USB_DeviceEnumerationComplete_P     (void)\r
-                       \r
-                       #if defined(USB_CAN_BE_BOTH)\r
-                               #define USB_InitFailure_P               (const uint8_t ErrorCode)\r
-                               #define USB_UIDChange_P                 (void)\r
-                       #endif\r
-\r
-                       #if defined(USB_CAN_BE_HOST)\r
-                               #define USB_HostError_P                 (const uint8_t ErrorCode)\r
-                               #define USB_DeviceAttached_P            (void)\r
-                               #define USB_DeviceUnattached_P          (void)\r
-                               #define USB_DeviceEnumerationFailed_P   (const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
-                       #endif\r
-                       \r
-                       #if defined(USB_CAN_BE_DEVICE)\r
-                               #define USB_UnhandledControlPacket_P    (void)\r
-                               #define USB_ConfigurationChanged_P      (void)\r
-                               #define USB_Suspend_P                   (void)\r
-                               #define USB_WakeUp_P                    (void)\r
-                               #define USB_Reset_P                     (void)\r
-                               #define USB_DeviceError_P               (const uint8_t ErrorCode)\r
-                       #endif\r
-\r
                /* Function Prototypes: */\r
                        #if defined(INCLUDE_FROM_EVENTS_C)\r
                                void USB_Event_Stub(void) ATTR_CONST;\r
 \r
                                #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)\r
-                                       ALIAS_STUB(USB_VBUSChange);\r
-                                       ALIAS_STUB(USB_VBUSConnect);\r
-                                       ALIAS_STUB(USB_VBUSDisconnect);\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
-                               ALIAS_STUB(USB_Connect);\r
-                               ALIAS_STUB(USB_Disconnect);\r
-                               ALIAS_STUB(USB_DeviceEnumerationComplete);\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
-                                       ALIAS_STUB(USB_InitFailure);\r
-                                       ALIAS_STUB(USB_UIDChange);\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
-                                       ALIAS_STUB(USB_HostError);\r
-                                       ALIAS_STUB(USB_DeviceAttached);\r
-                                       ALIAS_STUB(USB_DeviceUnattached);\r
-                                       ALIAS_STUB(USB_DeviceEnumerationFailed);\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
+                                                                              ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
                                #endif\r
 \r
-                               #if defined(USB_CAN_BE_DEVICE)\r
-                                       ALIAS_STUB(USB_UnhandledControlPacket);\r
-                                       ALIAS_STUB(USB_ConfigurationChanged);\r
-                                       ALIAS_STUB(USB_Suspend);\r
-                                       ALIAS_STUB(USB_WakeUp);\r
-                                       ALIAS_STUB(USB_Reset);\r
-                                       ALIAS_STUB(USB_DeviceError);\r
-                               #endif\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
+                               void EVENT_USB_DeviceError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
                        #endif\r
        #endif\r
 \r
index 82ef7a7..ae8cc71 100644 (file)
@@ -36,7 +36,7 @@
 \r
 uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
 {\r
-       RAISE_EVENT(USB_DeviceError, DEVICE_ERROR_GetDescriptorNotHooked);\r
+       EVENT_USB_DeviceError(DEVICE_ERROR_GetDescriptorNotHooked);\r
 \r
        return 0;\r
 };\r
index 390ac6b..d94a912 100644 (file)
                         */\r
                        #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK  (2 << 4)\r
 \r
-               /* Events: */\r
-                       #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)\r
-                               /** This module raises the Device Error event while in device mode, if the \ref USB_GetDescriptor()\r
-                                *  routine is not hooked in the user application to properly return descriptors to the library.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_DeviceError);\r
-                       #endif\r
-                       \r
                /* Enums: */\r
                        /** Enum for the possible standard descriptor types, as given in each descriptor's header. */\r
                        enum USB_DescriptorTypes_t\r
index fc626cc..b9ae045 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() 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 USB_UnhandledControlPacket() event when received in\r
+                                                             *   via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
                                                              *   device mode. */\r
                        };\r
 \r
index e739d84..a67cc89 100644 (file)
@@ -32,7 +32,8 @@
  *  @defgroup Group_StreamCallbacks Endpoint and Pipe Stream Callbacks\r
  *\r
  *  Macros and enums for the stream callback routines. This module contains the code required to easily set up\r
- *  stream callback functions which can be used to force early abort of a stream read/write process.\r
+ *  stream callback functions which can be used to force early abort of a stream read/write process. Each callback\r
+ *  should take no arguments, and return a value from the \ref StreamCallback_Return_ErrorCodes_t enum.\r
  *\r
  *  @{\r
  */\r
 \r
        /* Public Interface - May be used in end-application: */\r
                /* Macros: */\r
-                       /** Creates a prototype for or begins a stream callback routine. Stream callback routines are small\r
-                        *  routines which are executed during stream read or writes (if the callback-enabled versions of\r
-                        *  these functions are used) which allow the user application to abort the transfer when certain\r
-                        *  arbitrary conditions are met.\r
-                        *\r
-                        *  Stream callback functions should return a value from the \ref StreamCallback_Return_ErrorCodes_t\r
-                        *  enum.\r
-                        *\r
-                        *  Usage Example (Device Endpoint, but applicable for Host Pipes also):\r
-                        *  \code\r
-                        *  STREAM_CALLBACK(GlobalNotSet); // Callback Prototype\r
-                        *\r
-                        *  STREAM_CALLBACK(GlobalNotSet)\r
-                        *  {\r
-                        *     if (MyGlobal == false)\r
-                        *         return ENDPOINT_STREAMCALLBACK_Continue;\r
-                        *     else\r
-                        *         return ENDPOINT_STREAMCALLBACK_Abort;\r
-                        *  }\r
-                        *\r
-                        *  //...\r
-                        *  // Inside some routine:\r
-                        *  if (Endpoint_Write_Stream_LE(DataBuffer, sizeof(DataBuffer), GlobalNotSet) == \r
-                        *                               ENDPOINT_RWSTREAM_ERROR_CallbackAborted)\r
-                        *  {\r
-                        *      // Do something when the callback aborted the transfer early\r
-                        *  }\r
-                        *  \endcode\r
-                        */\r
-                       #define STREAM_CALLBACK(name) uint8_t name (void)\r
-\r
                        /** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream\r
                         *  call has no callback function to be called between USB packets.\r
                         */\r
index 14d277c..86dfa85 100644 (file)
@@ -72,24 +72,24 @@ ISR(USB_GEN_vect, ISR_BLOCK)
        {\r
                USB_INT_Clear(USB_INT_VBUS);\r
 \r
-               RAISE_EVENT(USB_VBUSChange);\r
+               EVENT_USB_VBUSChange();\r
 \r
                if (USB_VBUS_GetStatus())\r
                {\r
-                       RAISE_EVENT(USB_VBUSConnect);\r
+                       EVENT_USB_VBUSConnect();\r
                        \r
                        if (USB_IsConnected)\r
-                         RAISE_EVENT(USB_Disconnect);\r
+                         EVENT_USB_Disconnect();\r
                                \r
                        USB_ResetInterface();\r
                                \r
                        USB_IsConnected = true;\r
 \r
-                       RAISE_EVENT(USB_Connect);\r
+                       EVENT_USB_Connect();\r
                }\r
                else\r
                {\r
-                       RAISE_EVENT(USB_Disconnect);\r
+                       EVENT_USB_Disconnect();\r
                \r
                        USB_Detach();\r
                        USB_CLK_Freeze();\r
@@ -98,7 +98,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
 \r
                        USB_IsConnected = false;\r
 \r
-                       RAISE_EVENT(USB_VBUSDisconnect);\r
+                       EVENT_USB_VBUSDisconnect();\r
                        \r
                        USB_INT_Clear(USB_INT_VBUS);\r
                }\r
@@ -119,13 +119,13 @@ ISR(USB_GEN_vect, ISR_BLOCK)
 \r
                USB_IsSuspended = true;\r
 \r
-               RAISE_EVENT(USB_Suspend);\r
+               EVENT_USB_Suspend();\r
 \r
                #if defined(USB_LIMITED_CONTROLLER) && !defined(NO_LIMITED_CONTROLLER_CONNECT)\r
                if (USB_IsConnected)\r
                {\r
                        USB_IsConnected = false;\r
-                       RAISE_EVENT(USB_Disconnect);\r
+                       EVENT_USB_Disconnect();\r
                }\r
                #endif\r
        }\r
@@ -149,13 +149,13 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                if (!(USB_IsConnected))\r
                {\r
                        USB_IsConnected = true;\r
-                       RAISE_EVENT(USB_Connect);\r
+                       EVENT_USB_Connect();\r
                }\r
                #endif\r
 \r
                USB_IsSuspended = false;\r
 \r
-               RAISE_EVENT(USB_WakeUp);\r
+               EVENT_USB_WakeUp();\r
        }\r
    \r
        if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))\r
@@ -178,7 +178,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_INT_Enable(USB_INT_ENDPOINT_SETUP);\r
                #endif\r
 \r
-               RAISE_EVENT(USB_Reset);\r
+               EVENT_USB_Reset();\r
        }\r
        #endif\r
        \r
@@ -189,8 +189,8 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_INT_Clear(USB_INT_DCONNI);\r
                USB_INT_Disable(USB_INT_DDISCI);\r
                        \r
-               RAISE_EVENT(USB_DeviceUnattached);\r
-               RAISE_EVENT(USB_Disconnect);\r
+               EVENT_USB_DeviceUnattached();\r
+               EVENT_USB_Disconnect();\r
 \r
                USB_ResetInterface();\r
        }\r
@@ -202,8 +202,8 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_Host_VBUS_Manual_Off();\r
                USB_Host_VBUS_Auto_Off();\r
 \r
-               RAISE_EVENT(USB_HostError, HOST_ERROR_VBusVoltageDip);\r
-               RAISE_EVENT(USB_DeviceUnattached);\r
+               EVENT_USB_HostError(HOST_ERROR_VBusVoltageDip);\r
+               EVENT_USB_DeviceUnattached();\r
 \r
                USB_HostState = HOST_STATE_Unattached;\r
        }\r
@@ -213,7 +213,7 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                USB_INT_Clear(USB_INT_SRPI);\r
                USB_INT_Disable(USB_INT_SRPI);\r
        \r
-               RAISE_EVENT(USB_DeviceAttached);\r
+               EVENT_USB_DeviceAttached();\r
 \r
                USB_INT_Enable(USB_INT_DDISCI);\r
                \r
@@ -224,11 +224,11 @@ ISR(USB_GEN_vect, ISR_BLOCK)
        {\r
                USB_INT_Clear(USB_INT_BCERRI);\r
                \r
-               RAISE_EVENT(USB_DeviceEnumerationFailed, HOST_ENUMERROR_NoDeviceDetected, 0);\r
-               RAISE_EVENT(USB_DeviceUnattached);\r
+               EVENT_USB_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);\r
+               EVENT_USB_DeviceUnattached();\r
                \r
                if (USB_IsConnected)\r
-                 RAISE_EVENT(USB_Disconnect);\r
+                 EVENT_USB_Disconnect();\r
 \r
                USB_ResetInterface();\r
        }\r
@@ -242,12 +242,12 @@ ISR(USB_GEN_vect, ISR_BLOCK)
                if (USB_IsConnected)\r
                {\r
                        if (USB_CurrentMode == USB_MODE_HOST)\r
-                         RAISE_EVENT(USB_DeviceUnattached);\r
+                         EVENT_USB_DeviceUnattached();\r
                        else\r
-                         RAISE_EVENT(USB_Disconnect);\r
+                         EVENT_USB_Disconnect();\r
                }\r
 \r
-               RAISE_EVENT(USB_UIDChange);\r
+               EVENT_USB_UIDChange();\r
                \r
                USB_ResetInterface();\r
        }\r
index 7fbb33e..14f6930 100644 (file)
                        extern "C" {\r
                #endif\r
 \r
-       /* Public Interface - May be used in end-application: */\r
-               /* Throwable Events: */\r
-                       /** This module raises the USB Connected interrupt when the AVR is attached to a host while in device\r
-                        *  USB mode.\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 by \ref RAISE_EVENT(), and the USB_IsConnected global changed manually.\r
-                        */\r
-                       RAISES_EVENT(USB_Connect);\r
-\r
-                       /** This module raises the USB Disconnected interrupt when the AVR is removed from a host while in\r
-                        *  device USB mode.\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 by \ref RAISE_EVENT(), and the USB_IsConnected global changed manually.\r
-                        */\r
-                       RAISES_EVENT(USB_Disconnect);\r
-\r
-                       #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER) || defined(__DOXYGEN__)\r
-                               /** This module raises the VBUS Change event when the current VBUS status (present or not present) has\r
-                                *  changed.\r
-                                *\r
-                                *  \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_VBUSChange);\r
-\r
-                               /** This module raises the VBUS Connect event when the VBUS line is powered.\r
-                                *\r
-                                *  \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_VBUSConnect);\r
-\r
-                               /** This module raises the VBUS Disconnect event when power is removed from the VBUS line.\r
-                                *\r
-                                *  \note Not all USB AVR models support VBUS interrupts; this event only exists on supported AVRs.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_VBUSDisconnect);\r
-                       #endif\r
-\r
-                       #if defined(USB_CAN_BE_DEVICE) || defined(__DOXYGEN__)\r
-                               /** This module raises the Suspended event when the host suspends the USB interface of the AVR\r
-                                *  whilst running in device mode.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_Suspend);\r
-\r
-                               /** This module raises the Wake Up event when the host resumes the USB interface of the AVR\r
-                                *  whilst running in device mode.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_WakeUp);\r
-\r
-                               /** This module raises the USB Reset event when the host resets the USB interface of the AVR\r
-                                *  whilst running in device mode.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_Reset);\r
-                       #endif\r
-                       \r
-                       #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)\r
-                               /** This module raises the Host Error event when the VBUS line voltage dips below the minimum threshold\r
-                                *  while running in host mode.\r
-                                *\r
-                                *  \note Not all USB AVR models support host mode; this event only exists on supported AVRs.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_HostError);\r
-\r
-                               /** This module raises the Device Unattached event when an attached device is removed from the AVR whilst\r
-                                *  running in host mode.\r
-                                *\r
-                                *  \note Not all USB AVR models support host mode; this event only exists on supported AVRs.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_DeviceUnattached);\r
-                       #endif\r
-\r
-                       #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)\r
-                               /** This module raises the UID Change event when the UID line changes in value on dual-role devices.\r
-                                *\r
-                                *  \note Not all USB AVR models support host mode and thus the UID pin; this event only exists on\r
-                                *        supported AVRs.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_UIDChange);\r
-                       #endif\r
-                       \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
                /* Macros: */\r
index 9cb4e60..21b1ae2 100644 (file)
@@ -67,7 +67,7 @@
                         *        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 by \ref RAISE_EVENT(), and the \ref USB_IsConnected global changed manually.\r
+                        *        and disconnection events may be manually fired, and the \ref USB_IsConnected global changed manually.\r
                         *\r
                         *  \ingroup Group_USBManagement\r
                         */\r
@@ -84,7 +84,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 USB_UnhandledControlPacket() event, or for filling up with a control request to issue when\r
+                        *  inside of the \ref EVENT_USB_UnhandledControlPacket() 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
                        extern volatile uint8_t USB_HostState;\r
                        #endif\r
 \r
-               /* Throwable Events: */\r
-                       #if defined(USB_CAN_BE_HOST) || defined(__DOXYGEN__)\r
-                               /** This module raises the \ref USB_Connect event when a USB device has been connected whilst in host\r
-                                *  mode, but not yet enumerated.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_Connect);\r
-\r
-                               /** This module raises the \ref USB_DeviceAttached event when in host mode, and a device is attached\r
-                                *  to the AVR's USB interface.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_DeviceAttached);\r
-\r
-                               /** This module raises the \ref USB_DeviceUnattached event when in host mode, and a device is removed\r
-                                *  from the AVR's USB interface.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_DeviceUnattached);\r
-                               \r
-                               /** This module raises the \ref USB_DeviceEnumerationFailed event when in host mode, and an\r
-                                *  attached USB device has failed to successfully enumerated.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_DeviceEnumerationFailed);\r
-\r
-                               /** This module raises the \ref USB_DeviceEnumerationComplete event when in host mode, and an\r
-                                *  attached USB device has been successfully enumerated and ready to be used by the user\r
-                                *  application.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_DeviceEnumerationComplete);\r
-\r
-                               /** This module raises the \ref USB_Disconnect event when an attached USB device is removed from the USB\r
-                                *  bus.\r
-                                *\r
-                                *  \see \ref Group_Events for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_Disconnect);\r
-                       #endif\r
-\r
                /* Tasks: */\r
                        /** This is the main USB management task. The USB driver requires that this task be executed\r
                         *  continuously when the USB system is active (device attached in host mode, or attached to a host\r
                         *  The USB task must be serviced within 50mS in all modes, when needed. The task may be serviced \r
                         *  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 USB_Connect event\r
-                        *    and disabled again on the firing of the \ref USB_Disconnect event.\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
                         *\r
-                        *    - In host mode, it may be disabled at start-up, enabled on the firing of the \ref USB_DeviceAttached\r
-                        *    event and disabled again on the firing of the \ref USB_DeviceUnattached event.\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_DeviceUnattached() event.\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 785d10f..8f53105 100644 (file)
@@ -106,7 +106,7 @@ void USB_Device_ProcessControlPacket(void)
        }\r
 \r
        if (!(RequestHandled))\r
-         RAISE_EVENT(USB_UnhandledControlPacket);\r
+         EVENT_USB_UnhandledControlPacket();\r
          \r
        if (Endpoint_IsSETUPReceived())\r
        {\r
@@ -157,9 +157,9 @@ static void USB_Device_SetConfiguration(void)
        Endpoint_ClearIN();\r
 \r
        if (!(AlreadyConfigured) && USB_ConfigurationNumber)\r
-         RAISE_EVENT(USB_DeviceEnumerationComplete);\r
+         EVENT_USB_DeviceEnumerationComplete();\r
 \r
-       RAISE_EVENT(USB_ConfigurationChanged);\r
+       EVENT_USB_ConfigurationChanged();\r
 }\r
 \r
 void USB_Device_GetConfiguration(void)\r
index 49795e5..68cb2c4 100644 (file)
                         *  \ingroup Group_Device\r
                         */\r
                        extern bool USB_CurrentlySelfPowered;\r
-\r
-               /* Throwable Events: */\r
-                       /** This module raises the \ref USB_UnhandledControlPacket event when a request to the default control\r
-                        *  endpoint has been received, but the library does not implement an internal handler for it.\r
-                        *\r
-                        *  \see \ref Group_Events for more information on this event.\r
-                        */\r
-                       RAISES_EVENT(USB_UnhandledControlPacket);\r
-\r
-                       /** This module raises the \ref USB_ConfigurationChanged event when the host issues a \ref REQ_SetConfiguration\r
-                        *  device request, to change the currently selected configuration number.\r
-                        *\r
-                        *  \see \ref Group_Events for more information on this event.\r
-                        */\r
-                       RAISES_EVENT(USB_ConfigurationChanged);\r
-\r
-                       /** This module raises the \ref USB_DeviceEnumerationComplete event when the host has completed its\r
-                        *  enumeration of the device (i.e. when a \ref REQ_SetConfiguration request changes the current configuration\r
-                        *  number from 0 to a non-zero value).\r
-                        *\r
-                        *  \see \ref Group_Events for more information on this event.\r
-                        */\r
-                       RAISES_EVENT(USB_DeviceEnumerationComplete);\r
        \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
index 411ece0..ea9be4b 100644 (file)
                        #endif\r
 \r
                /* Enums: */\r
-                       /** Enum for the ErrorCode parameter of the \ref USB_DeviceError event.\r
+                       /** Enum for the ErrorCode parameter of the \ref EVENT_USB_DeviceError() event.\r
                         *\r
                         *  \see Events.h for more information on this event.\r
                         */\r
index 7f2b76a..bf33848 100644 (file)
                        /** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's\r
                         *  numerical address in the device.\r
                         */\r
-                       #define ENDPOINT_EPNUM_MASK                   0x03\r
+                       #define ENDPOINT_EPNUM_MASK                   0x07\r
 \r
                        /** Endpoint bank size mask, for masking against endpoint addresses to retrieve the endpoint's\r
                         *  bank size in the device.\r
                         *  each USB packet, the given stream callback function is executed repeatedly until the next\r
                         *  packet is ready, allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \note This routine should not be used on CONTROL type endpoints.\r
                         *\r
                         *  is executed repeatedly until the endpoint is ready to accept the next packet, allowing for early\r
                         *  aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \note This routine should not be used on CONTROL type endpoints.\r
                         *\r
                         *  is executed repeatedly until the endpoint is ready to accept the next packet, allowing for early\r
                         *  aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \note This routine should not be used on CONTROL type endpoints.\r
                         *\r
                         *  each USB packet, the given stream callback function is executed repeatedly until the endpoint\r
                         *  is ready to accept the next packet, allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \note This routine should not be used on CONTROL type endpoints.\r
                         *\r
                         *  each USB packet, the given stream callback function is executed repeatedly until the endpoint\r
                         *  is ready to accept the next packet, allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \note This routine should not be used on CONTROL type endpoints.\r
                         *\r
index 9630b6a..b3b56b8 100644 (file)
@@ -90,7 +90,7 @@ void USB_Host_ProcessNextHostState(void)
                                USB_INT_Enable(USB_INT_VBERRI);\r
 \r
                                USB_IsConnected = true;\r
-                               RAISE_EVENT(USB_Connect);\r
+                               EVENT_USB_Connect();\r
                                        \r
                                USB_Host_ResumeBus();\r
                                Pipe_ClearPipes();\r
@@ -184,7 +184,7 @@ void USB_Host_ProcessNextHostState(void)
                case HOST_STATE_Default_PostAddressSet:\r
                        USB_Host_SetDeviceAddress(USB_HOST_DEVICEADDRESS);\r
 \r
-                       RAISE_EVENT(USB_DeviceEnumerationComplete);\r
+                       EVENT_USB_DeviceEnumerationComplete();\r
                        USB_HostState = HOST_STATE_Addressed;\r
 \r
                        break;\r
@@ -192,14 +192,14 @@ void USB_Host_ProcessNextHostState(void)
 \r
        if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))\r
        {\r
-               RAISE_EVENT(USB_DeviceEnumerationFailed, ErrorCode, SubErrorCode);\r
+               EVENT_USB_DeviceEnumerationFailed(ErrorCode, SubErrorCode);\r
 \r
                USB_Host_VBUS_Auto_Off();\r
 \r
-               RAISE_EVENT(USB_DeviceUnattached);\r
+               EVENT_USB_DeviceUnattached();\r
                \r
                if (USB_IsConnected)\r
-                 RAISE_EVENT(USB_Disconnect);\r
+                 EVENT_USB_Disconnect();\r
 \r
                USB_ResetInterface();\r
        }\r
index 4457c07..911b41b 100644 (file)
                                HOST_STATE_Suspended                    = 13, /**< May be implemented by the user project. */\r
                        };\r
                        \r
-                       /** Enum for the error codes for the \ref USB_HostError event.\r
+                       /** Enum for the error codes for the \ref EVENT_USB_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 USB_DeviceEnumerationFailed event.\r
+                       /** Enum for the error codes for the \ref EVENT_USB_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 USB_DeviceEnumerationFailed\r
+                                                                     *   ErrorCode parameter value for the \ref EVENT_USB_DeviceEnumerationFailed()\r
                                                                      *   event.\r
                                                                      */\r
                                HOST_ENUMERROR_WaitStage        = 1, /**< One of the delays between enumeration steps failed\r
index 99b9cfb..346420f 100644 (file)
@@ -92,7 +92,7 @@ void USB_Init(
        }\r
        else\r
        {\r
-               RAISE_EVENT(USB_InitFailure, USB_INITERROR_NoUSBModeSpecified);\r
+               EVENT_USB_InitFailure(USB_INITERROR_NoUSBModeSpecified);\r
                return;\r
        }\r
        #endif\r
@@ -111,7 +111,7 @@ void USB_Init(
 void USB_ShutDown(void)\r
 {\r
        if (USB_IsConnected)\r
-         RAISE_EVENT(USB_Disconnect);\r
+         EVENT_USB_Disconnect();\r
 \r
        USB_Detach();\r
 \r
index fad1cbf..41b0ff5 100644 (file)
 \r
                /* Enums: */\r
                        /** Enum for error codes relating to the powering on of the USB interface. These error codes are\r
-                        *  used in the ErrorCode parameter value of the \ref USB_InitFailure event.\r
+                        *  used in the ErrorCode parameter value of the \ref EVENT_USB_InitFailure() event.\r
                         */\r
                        enum USB_InitErrorCodes_t\r
                        {\r
                                extern volatile uint8_t USB_Options;\r
                        #endif\r
 \r
-               /* Throwable Events: */\r
-                       /** This module raises the \ref USB_Disconnect event if the USB interface is reset (such as during a mode\r
-                        *  change while in UID mode) while the USB interface is connected to a device when in host mode, or\r
-                        *  a host while in device mode.\r
-                        *\r
-                        *  \see Events.h for more information on this event.\r
-                        */\r
-                       RAISES_EVENT(USB_Disconnect);\r
-                       \r
-                       #if defined(USB_CAN_BE_BOTH) || defined(__DOXYGEN__)\r
-                               /** This module raises the Power On Failure event when an error occurs while initializing the USB\r
-                                *  interface.\r
-                                *\r
-                                *  \see Events.h for more information on this event.\r
-                                */\r
-                               RAISES_EVENT(USB_InitFailure);\r
-                       #endif\r
-                       \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
                /* Macros: */\r
index c96a440..befc996 100644 (file)
                         *  \ref Pipe_ClearOUT() macro. Between each USB packet, the given stream callback function is\r
                         *  executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \ingroup Group_PipeRW\r
                         *\r
                         *  \ref Pipe_ClearOUT() macro. Between each USB packet, the given stream callback function is\r
                         *  executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \ingroup Group_PipeRW\r
                         *\r
                         *  Between each USB packet, the given stream callback function is executed repeatedly until the next packet is ready,\r
                         *  allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \ingroup Group_PipeRW\r
                         *\r
                         *  \ref Pipe_ClearIN() macro. Between each USB packet, the given stream callback function is\r
                         *  executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \ingroup Group_PipeRW\r
                         *\r
                         *  \ref Pipe_ClearIN() macro. Between each USB packet, the given stream callback function is\r
                         *  executed repeatedly until the next packet is ready, allowing for early aborts of stream transfers.\r
                         *\r
-                        *      The callback routine should be created using the \ref STREAM_CALLBACK() macro. If the token\r
-                        *  NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled\r
-                        *  and this function has the Callback parameter omitted.\r
+                        *      The callback routine should be created according to the information in \ref Group_StreamCallbacks.\r
+                        *  If the token NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are\r
+                        *  disabled and this function has the Callback parameter omitted.\r
                         *\r
                         *  \ingroup Group_PipeRW\r
                         *\r
index bd73749..7b21b8c 100644 (file)
  *    - The Endpoint_ClearEndpointInterrupt() macro has been deleted and references to it should be removed.\r
  *    - The DESCRIPTOR_ADDRESS() macro has been removed. User applications should use normal casts to obtain a descriptor's memory\r
  *      address.\r
+ *    - The library events system has been rewritten, so that all macros have been removed to allow for clearer user code. See\r
+ *      \ref Group_Events for new API details.\r
+ *    - The STREAM_CALLBACK() macro has been removed. User applications should replace all instances of the macro with regular\r
+ *      function signatures of a function accepting no arguments and returning a uint8_t value.\r
  *\r
- *  <b>Device Mode</b>\r
+ *  <b>Host Mode</b>\r
  *    - Support for non-control data pipe interrupts has been dropped due to many issues in the implementation. All existing\r
  *      projects using interrupts on non-control pipes should switch to polling.\r
  *    - The Pipe_ClearPipeInterrupt() macro has been deleted and references to it should be removed.\r
+ *    - The library events system has been rewritten, so that all macros have been removed to allow for clearer user code. See\r
+ *      \ref Group_Events for new API details.\r
+ *    - The STREAM_CALLBACK() macro has been removed. User applications should replace all instances of the macro with regular\r
+ *      function signatures of a function accepting no arguments and returning a uint8_t value.\r
+ *    - The DESCRIPTOR_COMPARATOR() macro has been removed. User applications should replace all instances of the macro with\r
+ *      regular function signatures of a function accepting a pointer to the descriptor to test, and returning a uint8_t value.\r
  *\r
  *\r
  * \section Sec_Migration090510 Migrating from 090401 to 090510\r
index 24172d8..e860d5a 100644 (file)
@@ -115,14 +115,14 @@ int main(void)
 }\r
 \r
 /** Event handler for the USB_Connect event. This starts the USB task. */\r
-EVENT_HANDLER(USB_Connect)\r
+void EVENT_USB_Connect(void)\r
 {\r
        /* Start USB management task */\r
        Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);\r
 }\r
 \r
 /** Event handler for the USB_Disconnect event. This stops the USB and keyboard report tasks. */\r
-EVENT_HANDLER(USB_Disconnect)\r
+void EVENT_USB_Disconnect(void)\r
 {\r
        /* Stop running keyboard reporting, card reading and USB management tasks */\r
        Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_STOP);\r
@@ -133,7 +133,7 @@ EVENT_HANDLER(USB_Disconnect)
 /** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready\r
  *  to relay reports to the host, and starts the keyboard report task.\r
  */\r
-EVENT_HANDLER(USB_ConfigurationChanged)\r
+void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        /* Setup Keyboard Keycode Report Endpoint */\r
        Endpoint_ConfigureEndpoint(KEYBOARD_EPNUM, EP_TYPE_INTERRUPT,\r
@@ -152,7 +152,7 @@ EVENT_HANDLER(USB_ConfigurationChanged)
  *  control requests that are not handled internally by the USB library, so that they can be handled appropriately\r
  *  for the application.\r
  */\r
-EVENT_HANDLER(USB_UnhandledControlPacket)\r
+void EVENT_USB_UnhandledControlPacket(void)\r
 {\r
        /* Handle HID Class specific requests */\r
        switch (USB_ControlRequest.bRequest)\r
index 0393c36..597bafd 100644 (file)
                        uint8_t Reserved; /**< Reserved for OEM use, always set to 0 */\r
                        uint8_t KeyCode; /**< Key code array for pressed keys - up to six can be given simultaneously */\r
                } USB_KeyboardReport_Data_t;\r
-\r
-       /* Event Handlers: */\r
-               /** Indicates that this module will catch the USB_Connect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Connect);\r
-\r
-               /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Disconnect);\r
-\r
-               /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */\r
-               HANDLES_EVENT(USB_ConfigurationChanged);\r
-\r
-               /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */\r
-               HANDLES_EVENT(USB_UnhandledControlPacket);\r
-               \r
+       \r
        /* Function Prototypes: */\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
+       \r
                bool GetNextReport(USB_KeyboardReport_Data_t* ReportData);\r
                void SendKey(USB_KeyboardReport_Data_t* KeyboardReportData, uint8_t Key);\r
                void Send(USB_KeyboardReport_Data_t* KeyboardReportData, bool SendReport);\r
index 1e314ec..931c673 100644 (file)
@@ -514,7 +514,7 @@ sizeafter:
 checkhooks: build
        @echo
        @echo ------- Unhooked LUFA Events -------
-       @$(shell) (grep -s '^Event.*LUFA/.*\\.o' $(TARGET).map | \
+       @$(shell) (grep -s '^EVENT_.*LUFA/.*\\.o' $(TARGET).map | \
                   cut -d' ' -f1 | cut -d'_' -f2- | grep ".*") || \
                           echo "(None)"
        @echo ------------------------------------