X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Output%2FpjrcUSB%2Farm%2Fusb_keyboard.c;fp=Output%2FpjrcUSB%2Farm%2Fusb_keyboard.c;h=722ae8dccf1a957ce5c5f27d5aeaa62cad8ee522;hb=11fb8bd77dea03ccda9a977c0ac7938abc938f6c;hp=7e435cd22eb3aa073002ca5ba33baa901aa9322e;hpb=1da49038168a651a3ef239e33f7566f4d7cde83c;p=kiibohd-controller.git diff --git a/Output/pjrcUSB/arm/usb_keyboard.c b/Output/pjrcUSB/arm/usb_keyboard.c index 7e435cd..722ae8d 100644 --- a/Output/pjrcUSB/arm/usb_keyboard.c +++ b/Output/pjrcUSB/arm/usb_keyboard.c @@ -162,9 +162,9 @@ void usb_keyboard_send() { *tx_buf++ = 0x04; // ID - // 51-164 (Middle 15 bytes) - memcpy( tx_buf, USBKeys_Keys + 6, 15 ); - tx_packet->len = 16; + // 51-155 (Middle 14 bytes) + memcpy( tx_buf, USBKeys_Keys + 6, 14 ); + tx_packet->len = 15; // Send USB Packet usb_tx( NKRO_KEYBOARD_ENDPOINT, tx_packet ); @@ -175,18 +175,31 @@ void usb_keyboard_send() { *tx_buf++ = 0x05; // ID + // 157-164 (Next byte) + memcpy( tx_buf, USBKeys_Keys + 20, 1 ); + tx_packet->len = 2; + + // Send USB Packet + usb_tx( NKRO_KEYBOARD_ENDPOINT, tx_packet ); + USBKeys_Changed &= ~USBKeyChangeState_TertiaryKeys; // Mark sent + } + // Check quartiary key section + else if ( USBKeys_Changed & USBKeyChangeState_QuartiaryKeys ) + { + *tx_buf++ = 0x06; // ID + // 176-221 (last 6 bytes) memcpy( tx_buf, USBKeys_Keys + 21, 6 ); tx_packet->len = 7; // Send USB Packet usb_tx( NKRO_KEYBOARD_ENDPOINT, tx_packet ); - USBKeys_Changed &= ~USBKeyChangeState_TertiaryKeys; // Mark sent + USBKeys_Changed &= ~USBKeyChangeState_QuartiaryKeys; // Mark sent } // Check system control keys else if ( USBKeys_Changed & USBKeyChangeState_System ) { - *tx_buf++ = 0x06; // ID + *tx_buf++ = 0x07; // ID *tx_buf = USBKeys_SysCtrl; tx_packet->len = 2; @@ -197,7 +210,7 @@ void usb_keyboard_send() // Check consumer control keys else if ( USBKeys_Changed & USBKeyChangeState_Consumer ) { - *tx_buf++ = 0x07; // ID + *tx_buf++ = 0x08; // ID *tx_buf++ = (uint8_t)(USBKeys_ConsCtrl & 0x00FF); *tx_buf = (uint8_t)(USBKeys_ConsCtrl >> 8); tx_packet->len = 3;