[其他ST产品] 调试时如何查看类中成员的表达式信息

[复制链接]
319|0
HomeKit 发表于 2025-11-13 15:12 | 显示全部楼层 |阅读模式

在使用调试器有时会通过鼠标悬停在对象上查看其值。
69483691577113f2cc.png 206976915773413fff.png

但对于很多表达式,无法展开查看详细信息。尽管我确定其中包含更多数据。例如 pClassDataCmsit:
569456915773c96281.png
在当前界面中,这个类成员没有可展开的详细内容;但在另一处代码中,却能看到它的更多信息。
不知道如何才能始终查看这类成员的详细信息,以下是相关代码:

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;
}


您需要登录后才可以回帖 登录 | 注册

本版积分规则

72

主题

72

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部
0