我使用CH376连接扫描枪,代码是通过修改论坛提供的“376操作鼠标键盘”例程得到的。 现在调试的枚举已经通过(其中各个步骤均通过,扫描枪也进入了工作状态),但使用CH37X_Get_int_in获取数据一直获取不到,CH37X_Get_int_in()里的代码如下: uint8_t CH37X_Get_int_in(uint8_t tog, uint8_t endp_int) { uint8_t s; tog = tog ? 0x80 : 0x00; CH37X_IssueTkn(0x80, (0 << 4) | DEF_USB_PID_IN); s = CH37X_Wait_inter(); if(s == USB_INT_SUCCESS) { CH37X_RD_USBData(data_buf); //键盘中断端点数据长度一般为8字节,鼠标为4字节 /*for(j = 0; j != t; j ++) printf("%02x ",(unsigned short)data_buf[j]);*/ if( endp_int == Device_Atti.Device[0].Device_endp) Device_Atti.Device[0].tog = Device_Atti.Device[0].tog ? FALSE : TRUE; else Device_Atti.Device[1].tog = Device_Atti.Device[1].tog ? FALSE : TRUE; } return s; } 其中s = CH37X_Wait_inter();在有扫描数据和没扫描数据均返回错误代码0x28;
我应该如何操作才能正确取到扫描枪数据?