mirror of
https://github.com/STMicroelectronics/STM32CubeF1.git
synced 2025-04-26 13:49:04 +08:00
I found that the HAL implementation of a test for the CAN_FMR register is wrong.
In dm00031020, chapter 32.9.4, it is said that the register can take values up to 28 in order to have all filters assigned to can1. However, in stm32F1XX_hal_can.h, the define IS_CAN_FILTER_BANK_DUAL tests it to be <=27. I do believe this test is wrong and will fail a valid call to set filters if asserts are enabled.
This commit is contained in:
parent
218b5100dd
commit
8556b11125
@ -795,7 +795,7 @@ HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan);
|
||||
#define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 1024U))
|
||||
#define IS_CAN_FILTER_ID_HALFWORD(HALFWORD) ((HALFWORD) <= 0xFFFFU)
|
||||
#if defined(CAN2)
|
||||
#define IS_CAN_FILTER_BANK_DUAL(BANK) ((BANK) <= 27U)
|
||||
#define IS_CAN_FILTER_BANK_DUAL(BANK) ((BANK) <= 28U)
|
||||
#endif
|
||||
#define IS_CAN_FILTER_BANK_SINGLE(BANK) ((BANK) <= 13U)
|
||||
#define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \
|
||||
|
Loading…
x
Reference in New Issue
Block a user