aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders/DFU
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-05-18 10:05:21 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-05-18 10:05:21 +0000
commit2ee9fc707784e115d744dbc229bdc893f4bb6bc1 (patch)
tree1f4de5f6d8e2a9bfe89d3263f19f9b9ebf855812 /Bootloaders/DFU
parent72c2922e38a2dfd14eb2d8e3692171704b5508f4 (diff)
downloadlufa-2ee9fc707784e115d744dbc229bdc893f4bb6bc1.tar.gz
lufa-2ee9fc707784e115d744dbc229bdc893f4bb6bc1.tar.bz2
lufa-2ee9fc707784e115d744dbc229bdc893f4bb6bc1.zip
Rewritten event system to remove all macros, to make user code clearer.
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.
Diffstat (limited to 'Bootloaders/DFU')
-rw-r--r--Bootloaders/DFU/BootloaderDFU.c4
-rw-r--r--Bootloaders/DFU/BootloaderDFU.h12
-rw-r--r--Bootloaders/DFU/makefile2
3 files changed, 7 insertions, 11 deletions
diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c
index 83881f13e..10a30167b 100644
--- a/Bootloaders/DFU/BootloaderDFU.c
+++ b/Bootloaders/DFU/BootloaderDFU.c
@@ -139,7 +139,7 @@ int main (void)
/** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user
* application started.
*/
-EVENT_HANDLER(USB_Disconnect)
+void EventHandler_USB_Disconnect(void)
{
/* Upon disconnection, run user application */
RunBootloader = false;
@@ -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
* all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-EVENT_HANDLER(USB_UnhandledControlPacket)
+void EventHandler_USB_UnhandledControlPacket(void)
{
/* Get the size of the command and data from the wLength value */
SentCommand.DataSize = USB_ControlRequest.wLength;
diff --git a/Bootloaders/DFU/BootloaderDFU.h b/Bootloaders/DFU/BootloaderDFU.h
index e996f2b79..a78d80d0c 100644
--- a/Bootloaders/DFU/BootloaderDFU.h
+++ b/Bootloaders/DFU/BootloaderDFU.h
@@ -191,15 +191,11 @@
errUNKNOWN = 14,
errSTALLEDPKT = 15
};
-
- /* Event Handlers: */
- /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
- HANDLES_EVENT(USB_Disconnect);
-
- /** Indicates that this module will catch the USB_UnhandledControlPacket event when thrown by the library. */
- HANDLES_EVENT(USB_UnhandledControlPacket);
-
+
/* Function Prototypes: */
+ void EVENT_USB_Disconnect(void);
+ void EVENT_USB_UnhandledControlPacket(void);
+
#if defined(INCLUDE_FROM_BOOTLOADER_C)
static void DiscardFillerBytes(uint8_t NumberOfBytes);
static void ProcessBootloaderCommand(void);
diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile
index 124ea58c5..94525c10b 100644
--- a/Bootloaders/DFU/makefile
+++ b/Bootloaders/DFU/makefile
@@ -503,7 +503,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 ------------------------------------