From 6c1fc983b7ca60f8582f4aa39c330ab15988eb01 Mon Sep 17 00:00:00 2001 From: adustm Date: Thu, 27 Apr 2017 14:30:39 +0200 Subject: [PATCH] RENESAS: add call to can_frequency and use hz parameter of can_init_freq --- targets/TARGET_RENESAS/TARGET_RZ_A1H/can_api.c | 5 ++++- targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/can_api.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1H/can_api.c b/targets/TARGET_RENESAS/TARGET_RZ_A1H/can_api.c index 4a6e86033c..6a727b8497 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1H/can_api.c +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1H/can_api.c @@ -573,10 +573,13 @@ void can_init_freq(can_t *obj, PinName rd, PinName td, int hz) { /* pin out the can pins */ pinmap_pinout(rd, PinMap_CAN_RD); pinmap_pinout(td, PinMap_CAN_TD); + + /* set can frequency */ + can_frequency(obj, hz); } void can_init(can_t *obj, PinName rd, PinName td) { - can_init_freq(obj, rd, td, 0); + can_init_freq(obj, rd, td, 100000); } void can_free(can_t *obj) { diff --git a/targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/can_api.c b/targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/can_api.c index 3e431cb4b5..7192cf1ce6 100644 --- a/targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/can_api.c +++ b/targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/can_api.c @@ -590,10 +590,13 @@ void can_init_freq(can_t *obj, PinName rd, PinName td, int hz) { /* pin out the can pins */ pinmap_pinout(rd, PinMap_CAN_RD); pinmap_pinout(td, PinMap_CAN_TD); + + /* set can frequency */ + can_frequency(obj, hz); } void can_init(can_t *obj, PinName rd, PinName td) { - can_init_freq(obj, rd, td, 0); + can_init_freq(obj, rd, td, 100000); } void can_free(can_t *obj) {