rt-thread icon indicating copy to clipboard operation
rt-thread copied to clipboard

stm32 hal can库问题

Open Simon-Leung opened this issue 7 years ago • 2 comments

CanTxMsgTypeDef在"rt-thread/bsp/stm32"里的hal库里,已经不支持。所用的新库的CAN_HandleTypeDef已经没有了成员CanTxMsgTypeDef和CanRxMsgTypeDef

新库的

typedef struct __CAN_HandleTypeDef
{
  CAN_TypeDef                 *Instance;                 /*!< Register base address */

  CAN_InitTypeDef             Init;                      /*!< CAN required parameters */

  __IO HAL_CAN_StateTypeDef   State;                     /*!< CAN communication state */

  __IO uint32_t               ErrorCode;                 /*!< CAN Error code.
                                                              This parameter can be a value of @ref CAN_Error_Code */

} CAN_HandleTypeDef;

旧库的

typedef struct
{
  CAN_TypeDef                 *Instance;  /*!< Register base address          */

  CAN_InitTypeDef             Init;       /*!< CAN required parameters        */

  CanTxMsgTypeDef*            pTxMsg;     /*!< Pointer to transmit structure  */

  CanRxMsgTypeDef*            pRxMsg;     /*!< Pointer to reception structure */

  __IO HAL_CAN_StateTypeDef   State;      /*!< CAN communication state        */

  HAL_LockTypeDef             Lock;       /*!< CAN locking object             */

  __IO uint32_t               ErrorCode;  /*!< CAN Error code                 */

}CAN_HandleTypeDef;

Simon-Leung avatar May 23 '19 08:05 Simon-Leung

欢迎发一个PR补丁出来

BernardXiong avatar May 23 '19 12:05 BernardXiong

已经修复过了,这个议题也可以关了

zhangjun1996 avatar Jun 28 '19 01:06 zhangjun1996