Skip to content
Permalink
Browse files

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>
  • Loading branch information...
henrikbrixandersen authored and jukkar committed Jul 28, 2019
1 parent 9923cf2 commit 9a7734abf58411a794e24be1600cd5753e4bde59
Showing with 4 additions and 1 deletion.
  1. +1 −1 drivers/can/Kconfig
  2. +3 −0 drivers/can/can_mcux_flexcan.c
@@ -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
@@ -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,

0 comments on commit 9a7734a

Please sign in to comment.
You can’t perform that action at this time.