X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Output%2FpjrcUSB%2Favr%2Fusb_keyboard_serial.c;h=9c2324ee3437e6722556e11de9e70ae0cb0d30c2;hb=0cbfe53794e579109b413f2bd599f8a898812f58;hp=63a8f7288cb51e9a35f71a9f9a08671c0780c830;hpb=fc84d454707aa77f6d7fd88bb88d05df81f1a04c;p=kiibohd-controller.git diff --git a/Output/pjrcUSB/avr/usb_keyboard_serial.c b/Output/pjrcUSB/avr/usb_keyboard_serial.c index 63a8f72..9c2324e 100644 --- a/Output/pjrcUSB/avr/usb_keyboard_serial.c +++ b/Output/pjrcUSB/avr/usb_keyboard_serial.c @@ -118,8 +118,8 @@ inline void usb_keyboard_send() { UEDATX = 0x03; // ID - // 4-164 (first 20 bytes) - for ( uint8_t byte = 0; byte < 20; byte++ ) + // 4-49 (first 6 bytes) + for ( uint8_t byte = 0; byte < 6; byte++ ) UEDATX = USBKeys_Keys[ byte ]; UEINTX = 0; // Finished with ID @@ -131,18 +131,31 @@ inline void usb_keyboard_send() { UEDATX = 0x04; // ID - // 176-221 (last 6 bytes) - for ( uint8_t byte = 20; byte < 26; byte++ ) + // 51-164 (Middle 15 bytes) + for ( uint8_t byte = 6; byte < 21; byte++ ) UEDATX = USBKeys_Keys[ byte ]; UEINTX = 0; // Finished with ID USBKeys_Changed &= ~USBKeyChangeState_SecondaryKeys; // Mark sent } + // Check tertiary key section + else if ( USBKeys_Changed & USBKeyChangeState_TertiaryKeys ) + { + UEDATX = 0x05; // ID + + // 176-221 (last 6 bytes) + for ( uint8_t byte = 21; byte < 27; byte++ ) + UEDATX = USBKeys_Keys[ byte ]; + + UEINTX = 0; // Finished with ID + + USBKeys_Changed &= ~USBKeyChangeState_TertiaryKeys; // Mark sent + } // Check system control keys else if ( USBKeys_Changed & USBKeyChangeState_System ) { - UEDATX = 0x05; // ID + UEDATX = 0x06; // ID UEDATX = USBKeys_SysCtrl; UEINTX = 0; // Finished with ID @@ -151,7 +164,7 @@ inline void usb_keyboard_send() // Check consumer control keys else if ( USBKeys_Changed & USBKeyChangeState_Consumer ) { - UEDATX = 0x06; // ID + UEDATX = 0x07; // ID UEDATX = (uint8_t)(USBKeys_ConsCtrl & 0x00FF); UEDATX = (uint8_t)(USBKeys_ConsCtrl >> 8); UEINTX = 0; // Finished with ID