UINT8 get_int_in(UINT8 tog,UINT8 endp_int)
{
UINT8 s,t,j;
tog = tog ? 0x80 : 0x00;
issue_token(tog,( endp_int << 4 ) | DEF_USB_PID_IN);
s = wait_interrupt( ); ////这是返回的是0x20
printf("get_int_in data: s=%02x\n",(unsigned short)s);
if(s == USB_INT_SUCCESS )
{
t = RD_USB_DATA(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;
}
查询手册,发现数这个操作是失败的。也就是issue_token是有问题的,请问如上的代码,问题出在哪里呢?
多谢