STMicroelectronics / stm32g4xx_hal_driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32G4 series.
BSD 3-Clause "New" or "Revised" License
14 stars 9 forks source link

Struct member DataLength name and discription misleading #5

Closed Chris-Idema-WizzDev closed 6 months ago

Chris-Idema-WizzDev commented 2 years ago

https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/19bed7c9f84aa74aba98c6d1ea54bed39bd8e61a/Inc/stm32g4xx_hal_fdcan.h#L212

The struct member DataLength (found in multiple structs) has a misleading name and description. It is neither data length in bytes nor a CAN Data Length Code (DLC). It is a shifted DLC value. No conversion function/macro is provided (DLCtoBytes is static).

ASELSTM commented 2 years ago

ST Internal Reference: 167320

ALABSTM commented 6 months ago

Hi @Chris-Idema-WizzDev,

Best wishes for the new year 2024. Thank you again for your report. The following fix has been implemented in version 1.2.3 which has been released a couple of weeks ago:

https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/1e886abc2c0005b402941edde93a77530861a532/Inc/stm32g4xx_hal_fdcan.h#L610-L625

https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/1e886abc2c0005b402941edde93a77530861a532/Src/stm32g4xx_hal_fdcan.c#L2318-L2319

With regards,