Add new hid page ID constant

This commit is contained in:
Ciaran Woodward
2021-12-21 11:21:06 +00:00
parent e7f9428731
commit b88342ab2b
2 changed files with 7 additions and 0 deletions

View File

@@ -152,12 +152,17 @@ void hidCaptureReportTime( const unsigned id, const unsigned time )
void hidClearChangePending( const unsigned id )
{
printf("ccp%d", id);
for( size_t idx = 0U; idx < HID_REPORT_COUNT; ++idx) {
if(( id == 0U ) || ( id == hidGetElementReportId( hidReports[ idx ]->location ))) {
if( !s_hidChangePending[ idx ] )
printf("<already>");
s_hidChangePending[ idx ] = 0U;
printf("y");
break;
}
}
printf("\n");
}
static unsigned hidGetElementBitLocation( const unsigned short location )
@@ -416,6 +421,7 @@ void hidSetChangePending( const unsigned id )
{
for( size_t idx = 0U; idx < HID_REPORT_COUNT; ++idx) {
if( id == hidGetElementReportId( hidReports[ idx ]->location )) {
printf("Set cp idx %d\n", idx);
s_hidChangePending[ idx ] = 1U;
break;
}

View File

@@ -58,6 +58,7 @@
// Constants from HID Usage Tables
// Usage page IDs (incomplete)
#define USB_HID_USAGE_PAGE_ID_GENERIC_DESKTOP ( 0x01 )
#define USB_HID_USAGE_PAGE_ID_KEYBOARD ( 0x07 )
#define USB_HID_USAGE_PAGE_ID_TELEPHONY_DEVICE ( 0x0B )
#define USB_HID_USAGE_PAGE_ID_CONSUMER ( 0x0C )