X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/9e9fc97fc902656e654bf378ab0f2a3d6874f7aa..48400df13c7f9f4f0fd8e7f841d49f9502557cb1:/Demos/Keyboard/Keyboard.h diff --git a/Demos/Keyboard/Keyboard.h b/Demos/Keyboard/Keyboard.h index 6988e579a..8b3147c2a 100644 --- a/Demos/Keyboard/Keyboard.h +++ b/Demos/Keyboard/Keyboard.h @@ -9,7 +9,7 @@ /* Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com) Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com) - + Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all @@ -33,7 +33,7 @@ * * Header file for Keyboard.c. */ - + #ifndef _KEYBOARD_H_ #define _KEYBOARD_H_ @@ -48,14 +48,11 @@ #include "Descriptors.h" #include // Library Version Information + #include // Simple scheduler for task management #include // PROGMEM tags readable by the ButtLoad project #include // USB Functionality #include // Joystick driver #include // LEDs driver - #include // Simple scheduler for task management - - /* Task Definitions: */ - TASK(USB_Keyboard_Report); /* Macros: */ /** HID Class specific request to get the next HID report from the device. */ @@ -76,6 +73,9 @@ /** HID Class specific request to set the current HID protocol in use, either report or boot. */ #define REQ_SetProtocol 0x0B + /* Task Definitions: */ + TASK(USB_Keyboard_Report); + /* Type Defines: */ /** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC. * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c. @@ -103,6 +103,9 @@ /** 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_Reset event when thrown by the library. */ + HANDLES_EVENT(USB_Reset); + /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */ HANDLES_EVENT(USB_ConfigurationChanged); @@ -110,8 +113,10 @@ HANDLES_EVENT(USB_UnhandledControlPacket); /* Function Prototypes: */ - bool GetNextReport(USB_KeyboardReport_Data_t* ReportData); + bool CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData); void ProcessLEDReport(uint8_t LEDReport); + static inline void SendNextReport(void); + static inline void ReceiveNextReport(void); void UpdateStatus(uint8_t CurrentStatus); #endif