From 5c74203b1048644dbfbd3b6ce033e08fc312e758 Mon Sep 17 00:00:00 2001 From: Brad Perry Date: Wed, 28 Jun 2017 12:07:14 -0700 Subject: [PATCH] Fixing the problem where the CAN is initialized to the wrong frequency at startup regardless of the value set in the constructor. Issue #3863 --- targets/TARGET_STM/can_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_STM/can_api.c b/targets/TARGET_STM/can_api.c index 332211e04a..744f369c1a 100644 --- a/targets/TARGET_STM/can_api.c +++ b/targets/TARGET_STM/can_api.c @@ -85,8 +85,8 @@ void can_init_freq (can_t *obj, PinName rd, PinName td, int hz) error("Cannot initialize CAN"); } - // Set initial CAN frequency to 100 kb/s - if (can_frequency(obj, 100000) != 1) { + // Set initial CAN frequency to specified frequency + if (can_frequency(obj, hz) != 1) { error("Can frequency could not be set\n"); }