diff --git a/lib_xua/src/hid/hid_report.c b/lib_xua/src/hid/hid_report.c index 1607d7b1..b45f18f2 100644 --- a/lib_xua/src/hid/hid_report.c +++ b/lib_xua/src/hid/hid_report.c @@ -228,14 +228,6 @@ unsigned hidGetNextReportTime( const unsigned id ) return retVal; } -unsigned hidIsReportDescriptorPrepared( void ) -{ - swlock_acquire(hidStaticVarLock); - unsigned retVal = s_hidReportDescriptorPrepared; - swlock_release(hidStaticVarLock); - return retVal; -} - unsigned char* hidGetReportDescriptor( void ) { unsigned char* retVal = NULL; @@ -271,32 +263,6 @@ unsigned hidGetReportIdLimit ( void ) { return retVal; } -unsigned hidIsReportIdInUse ( void ) { - swlock_acquire(hidStaticVarLock); - if ( hidGetElementReportId( hidReports[ 0 ]->location ) ) { - swlock_release(hidStaticVarLock); - return 1; - } - swlock_release(hidStaticVarLock); - return 0; -} - -unsigned hidIsReportIdValid ( unsigned id ) { - size_t retVal = 0; - - swlock_acquire(hidStaticVarLock); - for( size_t idx = 0U; idx < HID_REPORT_COUNT; ++idx ) { - unsigned reportId = hidGetElementReportId( hidReports[ idx ]->location ); - if( reportId == id ) { - retVal = 1; - break; - } - } - - swlock_release(hidStaticVarLock); - return retVal; -} - unsigned hidGetNextValidReportId ( unsigned idPrev ) { size_t retIndex = 0; @@ -451,6 +417,40 @@ unsigned hidIsIdleActive( const unsigned id ) return retVal; } +unsigned hidIsReportDescriptorPrepared( void ) +{ + swlock_acquire(hidStaticVarLock); + unsigned retVal = s_hidReportDescriptorPrepared; + swlock_release(hidStaticVarLock); + return retVal; +} + +unsigned hidIsReportIdInUse ( void ) { + swlock_acquire(hidStaticVarLock); + if ( hidGetElementReportId( hidReports[ 0 ]->location ) ) { + swlock_release(hidStaticVarLock); + return 1; + } + swlock_release(hidStaticVarLock); + return 0; +} + +unsigned hidIsReportIdValid ( unsigned id ) { + size_t retVal = 0; + + swlock_acquire(hidStaticVarLock); + for( size_t idx = 0U; idx < HID_REPORT_COUNT; ++idx ) { + unsigned reportId = hidGetElementReportId( hidReports[ idx ]->location ); + if( reportId == id ) { + retVal = 1; + break; + } + } + + swlock_release(hidStaticVarLock); + return retVal; +} + void hidPrepareReportDescriptor( void ) { swlock_acquire(hidStaticVarLock);