Browse Source

Removing NKRO Mode requirement for System Control and Consumer Control Keys (Media Keys)

- In general this shouldn't cause any issues
- BIOSs should ignore
- OSs should happily use

Still, this masks the EHCI hand-off that Windows and Linux are starting to do.
A better solution is needed to force devices to re-negotiate their mode.
blockKey
Jacob Alexander 7 years ago
parent
commit
9309889fad
1 changed files with 24 additions and 16 deletions
  1. 24
    16
      Output/pjrcUSB/output_com.c

+ 24
- 16
Output/pjrcUSB/output_com.c View File

@@ -267,13 +267,6 @@ void Output_consCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *
return;
}

// Not implemented in Boot Mode
if ( USBKeys_Protocol == 0 )
{
warn_print("Consumer Control is not implemented for Boot Mode");
return;
}

// TODO Analog inputs
// Only indicate USB has changed if either a press or release has occured
if ( state == 0x01 || state == 0x03 )
@@ -318,13 +311,6 @@ void Output_sysCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *a
return;
}

// Not implemented in Boot Mode
if ( USBKeys_Protocol == 0 )
{
warn_print("System Control is not implemented for Boot Mode");
return;
}

// TODO Analog inputs
// Only indicate USB has changed if either a press or release has occured
if ( state == 0x01 || state == 0x03 )
@@ -891,8 +877,30 @@ unsigned int Output_current_available()
void cliFunc_kbdProtocol( char* args )
{
print( NL );
info_msg("Keyboard Protocol: ");
printInt8( USBKeys_Protocol );

// Parse number from argument
// NOTE: Only first argument is used
char* arg1Ptr;
char* arg2Ptr;
CLI_argumentIsolation( args, &arg1Ptr, &arg2Ptr );

if ( arg1Ptr[0] != '\0' )
{
uint8_t mode = (uint8_t)numToInt( arg1Ptr );

// Do nothing if the argument was wrong
if ( mode == 0 || mode == 1 )
{
USBKeys_Protocol = mode;
info_msg("Setting Keyboard Protocol to: ");
printInt8( USBKeys_Protocol );
}
}
else
{
info_msg("Keyboard Protocol: ");
printInt8( USBKeys_Protocol );
}
}