Last active
August 29, 2015 14:12
-
-
Save mondalaci/be72d8613ba3c2f3f38e to your computer and use it in GitHub Desktop.
Emit the scancode of the "x" character per second
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t isSecondElapsed = 0; | |
int main(void) | |
{ | |
while (1) { | |
_delay_us(1000); | |
isSecondElapsed = 1; | |
} | |
} | |
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, | |
uint8_t* const ReportID, | |
const uint8_t ReportType, | |
void* ReportData, | |
uint16_t* const ReportSize) | |
{ | |
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData; | |
if (isSecondElapsed) { | |
KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_X; | |
isSecondElapsed = 0; | |
} | |
*ReportSize = sizeof(USB_KeyboardReport_Data_t); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment