enable eq
This commit is contained in:
@@ -38,6 +38,8 @@ typedef struct hidEvent_t {
|
||||
#endif
|
||||
#define HID_EVENT_INVALID_ID ( 0x100 )
|
||||
|
||||
#define HID_MAX_OUT_BYTES ( 65 )
|
||||
|
||||
/**
|
||||
* \brief Get the data for the next HID Report
|
||||
*
|
||||
|
||||
@@ -20,6 +20,8 @@ static unsigned HidFindSetIdleActivationPoint( const unsigned currentPeriod,
|
||||
static XUD_Result_t HidProcessSetIdleRequest( XUD_ep c_ep0_out, XUD_ep c_ep0_in, USB_SetupPacket_t &sp );
|
||||
static unsigned HidTimeDiff( const unsigned earlierTime, const unsigned laterTime );
|
||||
|
||||
extern unsigned char process_send_params(uint8_t data[], uint16_t len);
|
||||
extern unsigned char process_read_params(uint8_t response[]);
|
||||
XUD_Result_t HidInterfaceClassRequests(
|
||||
XUD_ep c_ep0_out,
|
||||
XUD_ep c_ep0_in,
|
||||
@@ -28,14 +30,37 @@ XUD_Result_t HidInterfaceClassRequests(
|
||||
#endif
|
||||
USB_SetupPacket_t &sp )
|
||||
{
|
||||
#if (USE_EX3D == 1)
|
||||
#if ((USE_EX3D == 1) || (EQ_EN == 1))
|
||||
unsigned datalength;
|
||||
unsigned char buffer[64] = {0};
|
||||
unsigned char buffer[65] = {0};
|
||||
#endif
|
||||
XUD_Result_t result = XUD_RES_ERR;
|
||||
|
||||
switch ( sp.bRequest ) {
|
||||
#if (USE_EX3D == 1)
|
||||
case HID_GET_REPORT:
|
||||
unsigned ret_len = 65;
|
||||
|
||||
buffer[0] = 0x1;
|
||||
process_read_params(&buffer[1]);
|
||||
#if 0
|
||||
debug_printf("%d:\n", ret_len);
|
||||
for(int i=0; i < ret_len; i++)
|
||||
{
|
||||
printhex((buffer, unsigned char[])[i]);
|
||||
printstr("-");
|
||||
}
|
||||
printstrln("\n");
|
||||
#endif
|
||||
return XUD_DoGetRequest(c_ep0_out, c_ep0_in, (buffer, unsigned char []), ret_len, sp.wLength);
|
||||
break;
|
||||
case HID_GET_IDLE:
|
||||
/* Do nothing - i.e. STALL */
|
||||
break;
|
||||
case HID_GET_PROTOCOL:
|
||||
/* Do nothing - i.e. STALL */
|
||||
break;
|
||||
|
||||
#if ((USE_EX3D == 1) || (EQ_EN == 1))
|
||||
case HID_SET_REPORT:
|
||||
result = XUD_GetBuffer(c_ep0_out, (buffer, unsigned char[]), datalength);
|
||||
if(result == XUD_RES_OKAY) {
|
||||
@@ -49,6 +74,11 @@ XUD_Result_t HidInterfaceClassRequests(
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer[1] == 0x77 && buffer[2] >= 0x8A)
|
||||
{
|
||||
process_send_params(&buffer[1], datalength - 1);
|
||||
}
|
||||
|
||||
result = XUD_DoSetRequestStatus(c_ep0_in);
|
||||
}
|
||||
break;
|
||||
@@ -58,6 +88,9 @@ XUD_Result_t HidInterfaceClassRequests(
|
||||
result = HidProcessSetIdleRequest( c_ep0_out, c_ep0_in, sp );
|
||||
break;
|
||||
|
||||
case HID_SET_PROTOCOL:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user