- .ReportINEndpointNumber = KEYBOARD_EPNUM,\r
- .ReportINEndpointSize = KEYBOARD_EPSIZE,\r
+ .ReportINEndpointNumber = KEYBOARD_EPNUM,\r
+ .ReportINEndpointSize = KEYBOARD_EPSIZE,\r
\r
/* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */\r
OCR0A = ((F_CPU / 64) / 1000);\r
\r
/* Millisecond timer initialization, with output compare interrupt enabled for the idle timing */\r
OCR0A = ((F_CPU / 64) / 1000);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
void EVENT_USB_ConfigurationChanged(void)\r
{\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
void EVENT_USB_ConfigurationChanged(void)\r
{\r
- if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface)))\r
- LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
+ if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface)))\r
+ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
/** Event handler for the library USB Unhandled Control Packet event. */\r
void EVENT_USB_UnhandledControlPacket(void)\r
{\r
}\r
\r
/** Event handler for the library USB Unhandled Control Packet event. */\r
void EVENT_USB_UnhandledControlPacket(void)\r
{\r
*/\r
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
{\r
*/\r
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\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
- if (JoyStatus_LCL & JOY_UP)\r
- KeyboardReport->KeyCode[0] = 0x04; // A\r
- else if (JoyStatus_LCL & JOY_DOWN)\r
- KeyboardReport->KeyCode[0] = 0x05; // B\r
-\r
- if (JoyStatus_LCL & JOY_LEFT)\r
- KeyboardReport->KeyCode[0] = 0x06; // C\r
- else if (JoyStatus_LCL & JOY_RIGHT)\r
- KeyboardReport->KeyCode[0] = 0x07; // D\r
-\r
- if (JoyStatus_LCL & JOY_PRESS)\r
- KeyboardReport->KeyCode[0] = 0x08; // E\r
- \r
- if (ButtonStatus_LCL & BUTTONS_BUTTON1)\r
- KeyboardReport->KeyCode[0] = 0x09; // F\r
- \r
- return sizeof(USB_KeyboardReport_Data_t);\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
+ if (JoyStatus_LCL & JOY_UP)\r
+ KeyboardReport->KeyCode[0] = 0x04; // A\r
+ else if (JoyStatus_LCL & JOY_DOWN)\r
+ KeyboardReport->KeyCode[0] = 0x05; // B\r
+\r
+ if (JoyStatus_LCL & JOY_LEFT)\r
+ KeyboardReport->KeyCode[0] = 0x06; // C\r
+ else if (JoyStatus_LCL & JOY_RIGHT)\r
+ KeyboardReport->KeyCode[0] = 0x07; // D\r
+\r
+ if (JoyStatus_LCL & JOY_PRESS)\r
+ KeyboardReport->KeyCode[0] = 0x08; // E\r
+ \r
+ if (ButtonStatus_LCL & BUTTONS_BUTTON1)\r
+ KeyboardReport->KeyCode[0] = 0x09; // F\r
+ \r
+ return sizeof(USB_KeyboardReport_Data_t);\r
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
void* ReportData, uint16_t ReportSize)\r
{\r
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
void* ReportData, uint16_t ReportSize)\r
{\r
- uint8_t LEDMask = LEDS_NO_LEDS;\r
- uint8_t* LEDReport = (uint8_t*)ReportData;\r
-\r
- if (*LEDReport & 0x01) // NUM Lock\r
- LEDMask |= LEDS_LED1;\r
- \r
- if (*LEDReport & 0x02) // CAPS Lock\r
- LEDMask |= LEDS_LED3;\r
-\r
- if (*LEDReport & 0x04) // SCROLL Lock\r
- LEDMask |= LEDS_LED4;\r
- \r
- LEDs_SetAllLEDs(LEDMask);\r
+ uint8_t LEDMask = LEDS_NO_LEDS;\r
+ uint8_t* LEDReport = (uint8_t*)ReportData;\r
+\r
+ if (*LEDReport & 0x01) // NUM Lock\r
+ LEDMask |= LEDS_LED1;\r
+ \r
+ if (*LEDReport & 0x02) // CAPS Lock\r
+ LEDMask |= LEDS_LED3;\r
+\r
+ if (*LEDReport & 0x04) // SCROLL Lock\r
+ LEDMask |= LEDS_LED4;\r
+ \r
+ LEDs_SetAllLEDs(LEDMask);\r