Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing CAN RTR condition #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

movhdi
Copy link

@movhdi movhdi commented Jun 9, 2023

HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]) RTR is assigned as following:

pHeader->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR);

while, CAN_RI0R_RTR = 0x1UL << 1UL
Therefore if RTR in RIR register is set, the resulting value stored in pHeader->RTR evaluates to 2.

HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, CAN_RxHeaderTypeDef *pHeader, uint8_t aData[])
RTR is assigned as following:

pHeader->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR);

while, CAN_RI0R_RTR = 0x1UL << 1UL
Therefore if RTR is set, the resulting value stored in pHeader->RTR evaluated to 2.

Signed-off-by: Mahdi Movahedi <[email protected]>
@movhdi movhdi changed the title in the function Changing CAN RTR condition Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant