forked from PAWPAW-Mirror/lib_xua
Avoid unnecessary preparation
This commit is contained in:
@@ -267,12 +267,14 @@ unsigned char* hidGetReportDescriptor( void )
|
|||||||
|
|
||||||
void hidPrepareReportDescriptor( void )
|
void hidPrepareReportDescriptor( void )
|
||||||
{
|
{
|
||||||
|
if( !hidReportDescriptorPrepared ) {
|
||||||
unsigned char* ptr = hidReportDescriptor;
|
unsigned char* ptr = hidReportDescriptor;
|
||||||
for( unsigned idx = 0; idx < sizeof hidReportDescriptorItems / sizeof( USB_HID_Short_Item_t ); ++idx ) {
|
for( unsigned idx = 0; idx < sizeof hidReportDescriptorItems / sizeof( USB_HID_Short_Item_t ); ++idx ) {
|
||||||
ptr = hidTranslateItem( hidReportDescriptorItems[ idx ], ptr );
|
ptr = hidTranslateItem( hidReportDescriptorItems[ idx ], ptr );
|
||||||
}
|
}
|
||||||
|
|
||||||
hidReportDescriptorPrepared = 1;
|
hidReportDescriptorPrepared = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned hidSetReportItem( const unsigned byte, const unsigned bit, const unsigned char header, const unsigned char data[] )
|
unsigned hidSetReportItem( const unsigned byte, const unsigned bit, const unsigned char header, const unsigned char data[] )
|
||||||
|
|||||||
Reference in New Issue
Block a user