Skip to content

Commit 8d5a066

Browse files
henrikbrixandersencarlescufi
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 2cc3fab commit 8d5a066

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
@@ -860,7 +860,7 @@ __deprecated static inline int can_configure(const struct device *dev, enum can_
860860
uint32_t bitrate)
861861
{
862862
if (bitrate > 0) {
863-
int err = can_set_bitrate(dev, bitrate, 0);
863+
int err = can_set_bitrate(dev, bitrate, bitrate);
864864
if (err != 0) {
865865
return err;
866866
}
@@ -869,7 +869,6 @@ __deprecated static inline int can_configure(const struct device *dev, enum can_
869869
return can_set_mode(dev, mode);
870870
}
871871

872-
873872
/**
874873
* @brief Get current state
875874
*

0 commit comments

Comments
 (0)