update modes
This commit is contained in:
@@ -377,7 +377,10 @@ void XUA_Buffer_Ep(
|
||||
|
||||
|
||||
unsigned hid_ready_flag = 0U;
|
||||
unsigned hid_ready_id = 1U;
|
||||
/* 改动原因:记录最近一次通过 HID IN 发出的 Report ID;主机读走 IN 包后只清除该 ID 的 change pending。
|
||||
* 原先 hid_ready_id 固定为 1,但上电首包是 Button Report(ID=2),主机读走后误清除了 ID=1 的 pending,
|
||||
* 导致 DFU/EQ 等通过 hidSetChangePending(0x1) 触发的 64 字节主动上报永远发不出去。 */
|
||||
unsigned hid_last_in_report_id = HID_BUTTON_REPORT_ID;
|
||||
XUD_SetReady_In(ep_hid, g_hidData, HID_BUTTON_REPORT_BYTES); // DFU_CONTROL_USB_HID related
|
||||
|
||||
#endif
|
||||
@@ -989,9 +992,9 @@ void XUA_Buffer_Ep(
|
||||
unsigned reportTime;
|
||||
timer tmr;
|
||||
tmr :> reportTime;
|
||||
hidCaptureReportTime(hid_ready_id, reportTime);
|
||||
hidCalcNextReportTime(hid_ready_id);
|
||||
hidClearChangePending(hid_ready_id);
|
||||
hidCaptureReportTime(hid_last_in_report_id, reportTime);
|
||||
hidCalcNextReportTime(hid_last_in_report_id);
|
||||
hidClearChangePending(hid_last_in_report_id);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -1244,11 +1247,13 @@ void XUA_Buffer_Ep(
|
||||
{
|
||||
// UserReadHIDButtons(&g_hidData[1]);
|
||||
btn_start_time = now;
|
||||
hid_last_in_report_id = HID_BUTTON_REPORT_ID;
|
||||
XUD_SetReady_In(ep_hid, g_hidData, HID_BUTTON_REPORT_BYTES);
|
||||
}
|
||||
if (timeafter(now, btn_start_time + 2000000))
|
||||
{
|
||||
g_hidData[1] = 0;
|
||||
hid_last_in_report_id = HID_BUTTON_REPORT_ID;
|
||||
XUD_SetReady_In(ep_hid, g_hidData, HID_BUTTON_REPORT_BYTES);
|
||||
hidClearChangePending(id);
|
||||
btn_start_time = 0;
|
||||
@@ -1259,6 +1264,7 @@ void XUA_Buffer_Ep(
|
||||
unsafe {
|
||||
user_read_hidpass(&g_hidPassData[1]);
|
||||
}
|
||||
hid_last_in_report_id = HID_PASS_REPORT_ID;
|
||||
XUD_SetReady_In(ep_hid, g_hidPassData, HID_PASS_REPORT_BYTES);
|
||||
hidClearChangePending(id);
|
||||
}
|
||||
|
||||
@@ -80,6 +80,13 @@ XUD_Result_t HidInterfaceClassRequests(
|
||||
case HID_SET_REPORT:
|
||||
result = XUD_GetBuffer(c_ep0_out, (buffer, unsigned char[]), datalength);
|
||||
if(result == XUD_RES_OKAY) {
|
||||
|
||||
if (buffer[1] == 0x77 && ((buffer[2] >= 0x70) || (buffer[2] == 0x5b)))
|
||||
{
|
||||
process_send_params(&buffer[1], datalength - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0// USE_EX3D == 1
|
||||
if(datalength > 0) {
|
||||
unsafe
|
||||
@@ -91,11 +98,6 @@ XUD_Result_t HidInterfaceClassRequests(
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (buffer[1] == 0x77 && ((buffer[2] >= 0x70) || (buffer[2] == 0x5b)))
|
||||
{
|
||||
process_send_params(&buffer[1], datalength - 1);
|
||||
}
|
||||
|
||||
result = XUD_DoSetRequestStatus(c_ep0_in);
|
||||
|
||||
Reference in New Issue
Block a user