From 2be0d1393bbcb52bde9462a0b17a9e548316a8a2 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Mon, 27 Oct 2014 00:26:17 -0700 Subject: [PATCH] USB Macro Output sequences now working! - Tested both with Boot and NKRO modes --- Output/pjrcUSB/output_com.c | 11 +++++++++++ Output/pjrcUSB/output_com.h | 1 + 2 files changed, 12 insertions(+) diff --git a/Output/pjrcUSB/output_com.c b/Output/pjrcUSB/output_com.c index 21e2f0b..a0ce24d 100644 --- a/Output/pjrcUSB/output_com.c +++ b/Output/pjrcUSB/output_com.c @@ -401,6 +401,17 @@ void Output_usbCodeSend_capability( uint8_t state, uint8_t stateType, uint8_t *a USBKeys_Changed |= USBKeyChangeState_TertiaryKeys; } + // Received 0x00 + // This is a special USB Code that internally indicates a "break" + // It is used to send "nothing" in order to break up sequences of USB Codes + else if ( key == 0x00 ) + { + USBKeys_Changed |= USBKeyChangeState_All; + + // Also flush out buffers just in case + Output_flushBuffers(); + break; + } // Invalid key else { diff --git a/Output/pjrcUSB/output_com.h b/Output/pjrcUSB/output_com.h index a1658f7..1daaf02 100644 --- a/Output/pjrcUSB/output_com.h +++ b/Output/pjrcUSB/output_com.h @@ -53,6 +53,7 @@ typedef enum USBKeyChangeState { USBKeyChangeState_TertiaryKeys = 0x08, USBKeyChangeState_System = 0x10, USBKeyChangeState_Consumer = 0x20, + USBKeyChangeState_All = 0x3F, } USBKeyChangeState;