Rewritten event system to remove all macros, to make user code clearer.
[pub/USBasp.git] / Demos / Device / Keyboard / Keyboard.h
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