From 791c142c94a40908af72d334f10279aa1bdb0132 Mon Sep 17 00:00:00 2001 From: Virgil_lai <414785686@qq.com> Date: Mon, 11 Dec 2023 15:03:16 +0800 Subject: [PATCH] add pawpaw user_hid_ctrl api --- lib_xua/src/core/buffer/ep/ep_buffer.xc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib_xua/src/core/buffer/ep/ep_buffer.xc b/lib_xua/src/core/buffer/ep/ep_buffer.xc index de9c134b..2f83ba8f 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -18,6 +18,7 @@ unsigned char g_hidData[HID_MAX_DATA_BYTES] = {0U}; #endif #ifdef PAWPAW_INOUTHID +#include "user_hid_ctrl.h" #include "stdio.h" unsigned char g_hidData_in[PAWPAW_CFG_HID_IN_BUFSIZE] = {0}; unsigned char g_hidData_out[PAWPAW_CFG_HID_OUT_BUFSIZE] = {0}; @@ -946,14 +947,8 @@ void XUA_Buffer_Ep(register chanend c_aud_out, case XUD_SetData_Select(c_hid, ep_hid, result): { // debug_printf("HID IN\n"); - g_hidData_in[0]=0x01; - g_hidData_in[1]=0xc1; - g_hidData_in[2]=0xd2; - g_hidData_in[3]=0xe3; - g_hidData_in[4]=0xf4; - g_hidData_in[5]=0x05; - g_hidData_in[6]=0x06; - g_hidData_in[7]=0x07; + hid_Buffer_exchange(BUF_XMOS_PC,g_hidData_in); + XUD_SetReady_In(ep_hid, g_hidData_in, PAWPAW_CFG_HID_IN_BUFSIZE); } @@ -963,7 +958,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out, case XUD_GetData_Select(c_hid_out, ep_hid_out,length, result): { XUD_SetReady_Out(ep_hid_out,g_hidData_out); - + hid_Buffer_exchange(BUF_PC_XMOS,g_hidData_out); // XMOS 获取到的HID数据 // g_hidData_out[0]...g_hidData_out[7] // printf("g_hidData_out %d\n",length);