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;
}
查詢手冊(cè),發(fā)現(xiàn)數(shù)這個(gè)操作是失敗的。也就是issue_token是有問題的,請(qǐng)問如上的代碼,問題出在哪里呢?
多謝