在使用调试器有时会通过鼠标悬停在对象上查看其值。
但对于很多表达式,无法展开查看详细信息。尽管我确定其中包含更多数据。例如 pClassDataCmsit:
在当前界面中,这个类成员没有可展开的详细内容;但在另一处代码中,却能看到它的更多信息。
不知道如何才能始终查看这类成员的详细信息,以下是相关代码:
uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len)
{
uint8_t result = USBD_OK;
/* USER CODE BEGIN 7 */
USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; //hcdc is given the data of pClassData. What is pClassData?
if (hcdc->TxState != 0){ //If TxState in hcdc is not 0, return USBD_BUSY.
return USBD_BUSY;
}
USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); //SetTxBuffer sets the size of the buffer, as well as the buffer itself.
result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); //USBD_CDC_TransmitPacket(&hUsbDeviceFS) transmits
/* USER CODE END 7 */
return result;
}
#ifdef USE_USBD_COMPOSITE //If USE_USBD_COMPOSITE is defined, hcdc will take ClassID.
uint8_t USBD_CDC_SetTxBuffer(USBD_HandleTypeDef *pdev,
uint8_t *pbuff, uint32_t length, uint8_t ClassId)
{
USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef *)pdev->pClassDataCmsit[ClassId];
#else //Else, hcdc will take pdev->ClassID. I have no idea what these things respectively are.
uint8_t USBD_CDC_SetTxBuffer(USBD_HandleTypeDef *pdev,
uint8_t *pbuff, uint32_t length)
{
USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
#endif /* USE_USBD_COMPOSITE */
if (hcdc == NULL) //hcdc is part of the input of USBD_CDC_SetTxBuffer related to pClass
{
return (uint8_t)USBD_FAIL;
}
hcdc->TxBuffer = pbuff;
hcdc->TxLength = length;
return (uint8_t)USBD_OK;
}
|
|