|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Not implemented in Boot Mode |
|
|
|
|
|
if ( USBKeys_Protocol == 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
warn_print("Consumer Control is not implemented for Boot Mode"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO Analog inputs |
|
|
// TODO Analog inputs |
|
|
// Only indicate USB has changed if either a press or release has occured |
|
|
// Only indicate USB has changed if either a press or release has occured |
|
|
if ( state == 0x01 || state == 0x03 ) |
|
|
if ( state == 0x01 || state == 0x03 ) |
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Not implemented in Boot Mode |
|
|
|
|
|
if ( USBKeys_Protocol == 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
warn_print("System Control is not implemented for Boot Mode"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO Analog inputs |
|
|
// TODO Analog inputs |
|
|
// Only indicate USB has changed if either a press or release has occured |
|
|
// Only indicate USB has changed if either a press or release has occured |
|
|
if ( state == 0x01 || state == 0x03 ) |
|
|
if ( state == 0x01 || state == 0x03 ) |
|
|
|
|
|
|
|
|
void cliFunc_kbdProtocol( char* args ) |
|
|
void cliFunc_kbdProtocol( char* args ) |
|
|
{ |
|
|
{ |
|
|
print( NL ); |
|
|
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 ); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|