forked from PAWPAW-Mirror/lib_xua
Add explicit initialization of static variables in hid_report.c
This commit is contained in:
@@ -525,6 +525,7 @@ void XUA_Endpoint0_init(chanend c_ep0_out, chanend c_ep0_in, NULLABLE_RESOURCE(c
|
||||
#endif
|
||||
|
||||
#if( 0 < HID_CONTROLS )
|
||||
hidReportInit();
|
||||
hidPrepareReportDescriptor();
|
||||
|
||||
size_t hidReportDescriptorLength = hidGetReportDescriptorLength();
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
/*
|
||||
* Each element in s_hidChangePending corresponds to an element in hidReports.
|
||||
*/
|
||||
static unsigned s_hidChangePending[ HID_REPORT_COUNT ] = { 0U };
|
||||
static unsigned s_hidChangePending[ HID_REPORT_COUNT ];
|
||||
static unsigned char s_hidReportDescriptor[ HID_REPORT_DESCRIPTOR_MAX_LENGTH ];
|
||||
static size_t s_hidReportDescriptorLength = 0U;
|
||||
static unsigned s_hidReportDescriptorPrepared = 0U;
|
||||
static size_t s_hidReportDescriptorLength;
|
||||
static unsigned s_hidReportDescriptorPrepared;
|
||||
|
||||
static unsigned s_hidCurrentPeriod[ HID_REPORT_COUNT ] = { ENDPOINT_INT_INTERVAL_IN_HID * MS_IN_TICKS };
|
||||
static unsigned s_hidIdleActive[ HID_REPORT_COUNT ] = { 0U };
|
||||
static unsigned s_hidNextReportTime[ HID_REPORT_COUNT ] = { 0U };
|
||||
static unsigned s_hidReportTime[ HID_REPORT_COUNT ] = { 0U };
|
||||
static unsigned s_hidCurrentPeriod[ HID_REPORT_COUNT ];
|
||||
static unsigned s_hidIdleActive[ HID_REPORT_COUNT ];
|
||||
static unsigned s_hidNextReportTime[ HID_REPORT_COUNT ];
|
||||
static unsigned s_hidReportTime[ HID_REPORT_COUNT ];
|
||||
|
||||
/**
|
||||
* @brief Get the bit position from the location of a report element
|
||||
@@ -362,6 +362,13 @@ void hidPrepareReportDescriptor( void )
|
||||
}
|
||||
}
|
||||
|
||||
void hidReportInit( void )
|
||||
{
|
||||
for( unsigned idx = 0U; idx < HID_REPORT_COUNT; ++idx ) {
|
||||
s_hidCurrentPeriod[ idx ] = ENDPOINT_INT_INTERVAL_IN_HID * MS_IN_TICKS;
|
||||
}
|
||||
}
|
||||
|
||||
void hidResetReportDescriptor( void )
|
||||
{
|
||||
s_hidReportDescriptorPrepared = 0U;
|
||||
|
||||
@@ -350,6 +350,13 @@ unsigned hidIsIdleActive( const unsigned id );
|
||||
*/
|
||||
void hidPrepareReportDescriptor( void );
|
||||
|
||||
/**
|
||||
* @brief Initialise the USB HID Report functionality
|
||||
*
|
||||
* Call this function before using any other functions in this API.
|
||||
*/
|
||||
void hidReportInit( void );
|
||||
|
||||
/**
|
||||
* @brief Reset the USB HID Report descriptor
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user