USB_IsConnected is now cleared before the USB_Disconnect() event is fired in response...
[pub/USBasp.git] / Demos / Device / Mouse / Mouse.h
index 714f8d6..65879da 100644 (file)
                #include <LUFA/Drivers/USB/USB.h>            // USB Functionality\r
                #include <LUFA/Drivers/Board/Joystick.h>     // Joystick driver\r
                #include <LUFA/Drivers/Board/LEDs.h>         // LEDs driver\r
-               #include <LUFA/Drivers/Board/HWB.h>          // Hardware Button driver\r
+               #include <LUFA/Drivers/Board/Buttons.h>      // Board Buttons driver\r
                #include <LUFA/Scheduler/Scheduler.h>        // Simple scheduler for task management\r
                \r
        /* Task Definitions: */\r
                TASK(USB_Mouse_Report);\r
 \r
        /* Macros: */\r
+               /** Idle period indicating that reports should be sent only when the inputs have changed */\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
        /* Type Defines: */\r
                /** Type define for the mouse HID report structure, for creating and sending HID reports to the host PC.\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_Reset event when thrown by the library. */\r
-               HANDLES_EVENT(USB_Reset);\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