forked from PAWPAW-Mirror/lib_xua
Use a variable large enough to hold the Set Idle duration in ms without overflow.
This commit is contained in:
@@ -146,7 +146,7 @@ XUD_Result_t HidInterfaceClassRequests(
|
|||||||
|
|
||||||
The Set Idle request xIndex field contains the interface number.
|
The Set Idle request xIndex field contains the interface number.
|
||||||
*/
|
*/
|
||||||
uint8_t duration = ( sp.wValue & 0xFF00 ) >> 6; // Transform into units of 1ms.
|
uint16_t duration = ( sp.wValue & 0xFF00 ) >> 6; // Transform from units of 4ms into units of 1ms.
|
||||||
uint8_t reportId = sp.wValue & 0x00FF;
|
uint8_t reportId = sp.wValue & 0x00FF;
|
||||||
uint16_t interfaceNum = sp.wIndex;
|
uint16_t interfaceNum = sp.wIndex;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user