stm32f7: Add the option to include RTR in CAN header

Signed-off-by: Claudio Micheli <claudio@auterion.com>
This commit is contained in:
Claudio Micheli 2020-05-25 10:29:42 +02:00 committed by Alan Carvalho de Assis
parent f6039bbfa7
commit 7a346bee26
2 changed files with 11 additions and 2 deletions

View File

@ -1288,8 +1288,11 @@ static int stm32can_send(FAR struct can_dev_s *dev,
}
#else
regval &= ~CAN_TIR_STID_MASK;
regval |= (uint32_t)msg->cm_hdr.ch_id << CAN_TIR_STID_SHIFT;
regval |= ( ( (uint32_t) msg->cm_hdr.ch_id << CAN_TIR_STID_SHIFT) & CAN_TIR_STID_MASK );
#ifdef CONFIG_CAN_USE_RTR
regval |= (msg->cm_hdr.ch_rtr ? CAN_TIR_RTR : 0);
#endif
#endif
stm32can_putreg(priv, STM32_CAN_TIR_OFFSET(txmb), regval);

View File

@ -128,6 +128,12 @@ config CAN_NPOLLWAITERS
---help---
The maximum number of threads that may be waiting on the
poll method.
config CAN_USE_RTR
bool "Include RTR in CAN header"
default n
---help---
This selection includes RTR bitfield in the CAN header.
comment "CAN Bus Controllers:"