论坛元老
 
- 积分
- 6662
- 金钱
- 6662
- 注册时间
- 2016-5-29
- 在线时间
- 910 小时
|

楼主 |
发表于 2017-2-11 20:14:28
|
显示全部楼层
void Joystick_Reset(void)
{
/* Set Joystick_DEVICE as not configured */
pInformation->Current_Configuration = 0;
pInformation->Current_Interface = 0;/*the default Interface*/
/* Current Feature initialization */
pInformation->Current_Feature = Joystick_ConfigDescriptor[7];
SetBTABLE(BTABLE_ADDRESS);
/* Initialize Endpoint 0 */
SetEPType(ENDP0, EP_CONTROL);
SetEPTxStatus(ENDP0, EP_TX_STALL);
SetEPRxAddr(ENDP0, ENDP0_RXADDR);
SetEPTxAddr(ENDP0, ENDP0_TXADDR);
Clear_Status_Out(ENDP0);
SetEPRxCount(ENDP0, Device_Property.MaxPacketSize);
SetEPRxValid(ENDP0);
/* Initialize Endpoint 1 */
SetEPType(ENDP1, EP_INTERRUPT);
SetEPTxAddr(ENDP1, ENDP1_TXADDR);
SetEPTxCount(ENDP1, 10);
//SetEPRxStatus(ENDP1, EP_RX_DIS);
SetEPTxStatus(ENDP1, EP_TX_NAK);
SetEPRxAddr(ENDP1,ENDP1_RXADDR);
SetEPRxCount(ENDP1,1);
SetEPRxStatus(ENDP1, EP_TX_VALID);
bDeviceState = ATTACHED;
/* Set this device to response on default address */
SetDeviceAddress(0);
} |
|