Skip to content

Commit 05318b5

Browse files
henrikbrixandersencfriedt
authored andcommitted
drivers: can: fix can_configure() when CAN-FD is enabled
Currently, can_configure() pass a hard-coded 0 for the data bitrate (which is only used for CAN-FD), breaking this API for CAN-FD enabled applications. Instead pass in the provided bitrate for both arbitration phase and data phase. Fixes: #34375 Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent a14b830 commit 05318b5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/drivers/can.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ static inline int can_configure(const struct device *dev, enum can_mode mode,
817817
uint32_t bitrate)
818818
{
819819
if (bitrate > 0) {
820-
int err = can_set_bitrate(dev, bitrate, 0);
820+
int err = can_set_bitrate(dev, bitrate, bitrate);
821821
if (err != 0) {
822822
return err;
823823
}
@@ -826,7 +826,6 @@ static inline int can_configure(const struct device *dev, enum can_mode mode,
826826
return can_set_mode(dev, mode);
827827
}
828828

829-
830829
/**
831830
* @brief Get current state
832831
*

0 commit comments

Comments
 (0)