projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed old empty RNDISEthernetHost directory from the Incomplete Host demos folder.
[pub/USBasp.git]
/
Demos
/
Device
/
ClassDriver
/
Keyboard
/
Keyboard.c
diff --git
a/Demos/Device/ClassDriver/Keyboard/Keyboard.c
b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
index
e609d7a
..
5ba15cd
100644
(file)
--- a/
Demos/Device/ClassDriver/Keyboard/Keyboard.c
+++ b/
Demos/Device/ClassDriver/Keyboard/Keyboard.c
@@
-48,13
+48,14
@@
USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
{
\r
.Config =
\r
{
\r
{
\r
.Config =
\r
{
\r
- .InterfaceNumber = 0,
\r
+ .InterfaceNumber
= 0,
\r
\r
\r
- .ReportINEndpointNumber = KEYBOARD_EPNUM,
\r
- .ReportINEndpointSize = KEYBOARD_EPSIZE,
\r
+ .ReportINEndpointNumber = KEYBOARD_EPNUM,
\r
+ .ReportINEndpointSize = KEYBOARD_EPSIZE,
\r
+ .ReportINEndpointDoubleBank = false,
\r
\r
\r
- .PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
\r
- .PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
\r
+ .PrevReportINBuffer
= PrevKeyboardHIDReportBuffer,
\r
+ .PrevReportINBufferSize
= sizeof(PrevKeyboardHIDReportBuffer),
\r
},
\r
};
\r
\r
},
\r
};
\r
\r
@@
-136,29
+137,31
@@
void EVENT_USB_Device_StartOfFrame(void)
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
\r
*/
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
\r
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
\r
*/
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
\r
- void* ReportData, uint16_t* ReportSize)
\r
+
const uint8_t ReportType,
void* ReportData, uint16_t* ReportSize)
\r
{
\r
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
\r
\r
uint8_t JoyStatus_LCL = Joystick_GetStatus();
\r
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
\r
\r
{
\r
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
\r
\r
uint8_t JoyStatus_LCL = Joystick_GetStatus();
\r
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
\r
\r
+ uint8_t UsedKeyCodes = 0;
\r
+
\r
if (JoyStatus_LCL & JOY_UP)
\r
if (JoyStatus_LCL & JOY_UP)
\r
- KeyboardReport->KeyCode[
0
] = 0x04; // A
\r
+ KeyboardReport->KeyCode[
UsedKeyCodes++
] = 0x04; // A
\r
else if (JoyStatus_LCL & JOY_DOWN)
\r
else if (JoyStatus_LCL & JOY_DOWN)
\r
- KeyboardReport->KeyCode[
0
] = 0x05; // B
\r
+ KeyboardReport->KeyCode[
UsedKeyCodes++
] = 0x05; // B
\r
\r
if (JoyStatus_LCL & JOY_LEFT)
\r
\r
if (JoyStatus_LCL & JOY_LEFT)
\r
- KeyboardReport->KeyCode[
0
] = 0x06; // C
\r
+ KeyboardReport->KeyCode[
UsedKeyCodes++
] = 0x06; // C
\r
else if (JoyStatus_LCL & JOY_RIGHT)
\r
else if (JoyStatus_LCL & JOY_RIGHT)
\r
- KeyboardReport->KeyCode[
0
] = 0x07; // D
\r
+ KeyboardReport->KeyCode[
UsedKeyCodes++
] = 0x07; // D
\r
\r
if (JoyStatus_LCL & JOY_PRESS)
\r
\r
if (JoyStatus_LCL & JOY_PRESS)
\r
- KeyboardReport->KeyCode[
0
] = 0x08; // E
\r
+ KeyboardReport->KeyCode[
UsedKeyCodes++
] = 0x08; // E
\r
\r
if (ButtonStatus_LCL & BUTTONS_BUTTON1)
\r
\r
if (ButtonStatus_LCL & BUTTONS_BUTTON1)
\r
- KeyboardReport->KeyCode[
0
] = 0x09; // F
\r
-
\r
+ KeyboardReport->KeyCode[
UsedKeyCodes++
] = 0x09; // F
\r
+
\r
*ReportSize = sizeof(USB_KeyboardReport_Data_t);
\r
return false;
\r
}
\r
*ReportSize = sizeof(USB_KeyboardReport_Data_t);
\r
return false;
\r
}
\r