drivers: can: flexcan: implement timestamp for RX frames

This commit implements timestamps for receiving frames on the
NXP MCUX FlexCAN CAN driver.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
Henrik Brix Andersen 2019-07-28 21:40:39 +02:00 committed by Jukka Rissanen
commit 9a7734abf5
2 changed files with 4 additions and 1 deletions

View file

@ -44,7 +44,7 @@ config CAN_WORKQ_FRAMES_BUF_CNT
config CAN_RX_TIMESTAMP
bool "Enable receiving timestamps"
depends on CAN_STM32
depends on CAN_STM32 || CAN_MCUX_FLEXCAN
help
This option enables a timestamp value of the CAN free running timer.
The value is incremented every bit time and starts when the controller

View file

@ -167,6 +167,9 @@ static void mcux_flexcan_copy_frame_to_zframe(const flexcan_frame_t *src,
dest->dlc = src->length;
dest->data_32[0] = sys_be32_to_cpu(src->dataWord0);
dest->data_32[1] = sys_be32_to_cpu(src->dataWord1);
#ifdef CONFIG_CAN_RX_TIMESTAMP
dest->timestamp = src->timestamp;
#endif /* CAN_RX_TIMESTAMP */
}
static void mcux_flexcan_copy_zfilter_to_mbconfig(const struct zcan_filter *src,