fix epout connection
This commit is contained in:
parent
ba581db49c
commit
a51417bf61
@ -32,7 +32,7 @@ USBD_ClassTypeDef USBD_CCID =
|
|||||||
NULL, /* EP0_TxSent, */
|
NULL, /* EP0_TxSent, */
|
||||||
USBD_CCID_EP0_RxReady,
|
USBD_CCID_EP0_RxReady,
|
||||||
USBD_CCID_DataIn,
|
USBD_CCID_DataIn,
|
||||||
USBD_CCID_DataOut,
|
usb_ccid_recieve_callback,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
@ -259,7 +259,7 @@ void ccid_send_status(CCID_HEADER * c)
|
|||||||
memset(msg,0,sizeof(msg));
|
memset(msg,0,sizeof(msg));
|
||||||
|
|
||||||
msg[0] = CCID_SLOT_STATUS_RES;
|
msg[0] = CCID_SLOT_STATUS_RES;
|
||||||
msg[6] = c->seq;
|
msg[6] = 1;
|
||||||
|
|
||||||
USBD_CCID_TransmitPacket(msg, sizeof(msg));
|
USBD_CCID_TransmitPacket(msg, sizeof(msg));
|
||||||
|
|
||||||
@ -277,6 +277,12 @@ void handle_ccid(uint8_t * msg, int len)
|
|||||||
ccid_send_status(h);
|
ccid_send_status(h);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
// while(1)
|
||||||
|
// {
|
||||||
|
// led_rgb(0xff3520);
|
||||||
|
// }
|
||||||
|
//Y
|
||||||
|
ccid_send_status(h);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,12 +294,9 @@ void handle_ccid(uint8_t * msg, int len)
|
|||||||
* @param epnum: endpoint number
|
* @param epnum: endpoint number
|
||||||
* @retval status
|
* @retval status
|
||||||
*/
|
*/
|
||||||
static uint8_t USBD_CCID_DataOut (USBD_HandleTypeDef *pdev, uint8_t epnum)
|
uint8_t usb_ccid_recieve_callback(USBD_HandleTypeDef *pdev, uint8_t epnum)
|
||||||
{
|
{
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
led_rgb(0xff3520);
|
|
||||||
}
|
|
||||||
USBD_CCID_HandleTypeDef *hcdc = (USBD_CCID_HandleTypeDef*) pdev->pClassData;
|
USBD_CCID_HandleTypeDef *hcdc = (USBD_CCID_HandleTypeDef*) pdev->pClassData;
|
||||||
|
|
||||||
/* Get the received data length */
|
/* Get the received data length */
|
||||||
@ -312,10 +315,18 @@ static uint8_t USBD_CCID_DataOut (USBD_HandleTypeDef *pdev, uint8_t epnum)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
led_rgb(0xff3520);
|
||||||
|
}
|
||||||
|
|
||||||
return USBD_FAIL;
|
return USBD_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief USBD_CDC_EP0_RxReady
|
* @brief USBD_CDC_EP0_RxReady
|
||||||
* Handle EP0 Rx Ready event
|
* Handle EP0 Rx Ready event
|
||||||
@ -326,9 +337,9 @@ static uint8_t USBD_CCID_EP0_RxReady (USBD_HandleTypeDef *pdev)
|
|||||||
{
|
{
|
||||||
USBD_CCID_HandleTypeDef *hcdc = (USBD_CCID_HandleTypeDef*) pdev->pClassData;
|
USBD_CCID_HandleTypeDef *hcdc = (USBD_CCID_HandleTypeDef*) pdev->pClassData;
|
||||||
|
|
||||||
if((pdev->pUserData != NULL) && (hcdc->CmdOpCode != 0xFFU))
|
// if((pdev->pUserData != NULL) && (hcdc->CmdOpCode != 0xFFU))
|
||||||
{
|
// {
|
||||||
hcdc->CmdOpCode = 0xFFU;
|
// hcdc->CmdOpCode = 0xFFU;
|
||||||
}
|
// }
|
||||||
return USBD_OK;
|
return USBD_OK;
|
||||||
}
|
}
|
||||||
|
@ -38,4 +38,6 @@ typedef struct
|
|||||||
}
|
}
|
||||||
USBD_CCID_HandleTypeDef;
|
USBD_CCID_HandleTypeDef;
|
||||||
|
|
||||||
|
uint8_t usb_ccid_recieve_callback(USBD_HandleTypeDef *pdev, uint8_t epnum);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -119,9 +119,12 @@ void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
|
|||||||
USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff);
|
USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff);
|
||||||
switch(epnum)
|
switch(epnum)
|
||||||
{
|
{
|
||||||
case HID_ENDPOINT:
|
case HID_EPOUT_ADDR:
|
||||||
usb_hid_recieve_callback(epnum);
|
usb_hid_recieve_callback(epnum);
|
||||||
break;
|
break;
|
||||||
|
case CCID_OUT_EP:
|
||||||
|
usb_ccid_recieve_callback((USBD_HandleTypeDef*)hpcd->pData, epnum);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user