Skip to content

Commit a75f935

Browse files
Merge pull request #4664 from bperry730/fix/st_can_api_freq
STM32: Fix the CAN initializing to the wrong frequency
2 parents adfed0f + f7d76b5 commit a75f935

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/TARGET_STM/can_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ void can_init_freq (can_t *obj, PinName rd, PinName td, int hz)
8585
error("Cannot initialize CAN");
8686
}
8787

88-
// Set initial CAN frequency to 100 kb/s
89-
if (can_frequency(obj, 100000) != 1) {
88+
// Set initial CAN frequency to specified frequency
89+
if (can_frequency(obj, hz) != 1) {
9090
error("Can frequency could not be set\n");
9191
}
9292

0 commit comments

Comments
 (0)