helpfor studient

Dependents:   STM32_F103-C8T6basecanblink_led

Fork of mbed-dev by mbed official

Revision:
167:e84263d55307
Parent:
161:2cc1468da177
--- a/targets/TARGET_NUVOTON/TARGET_NUC472/can_api.c	Thu Jun 08 15:02:37 2017 +0100
+++ b/targets/TARGET_NUVOTON/TARGET_NUC472/can_api.c	Wed Jun 21 17:46:44 2017 +0100
@@ -43,8 +43,8 @@
     {NC, 0, 0, 0, 0, (IRQn_Type) 0, NULL}
 };
 
- 
- void can_init(can_t *obj, PinName rd, PinName td)
+
+ void can_init_freq(can_t *obj, PinName rd, PinName td, int hz)
  {
     uint32_t can_td = (CANName)pinmap_peripheral(td, PinMap_CAN_TD);
     uint32_t can_rd = (CANName)pinmap_peripheral(rd, PinMap_CAN_RD);
@@ -75,12 +75,18 @@
     PA2 = 0x00;
     PA3 = 0x00; 
 
-    CAN_Open((CAN_T *)NU_MODBASE(obj->can), 500000, CAN_NORMAL_MODE);
+    CAN_Open((CAN_T *)NU_MODBASE(obj->can), hz, CAN_NORMAL_MODE);
     
     can_filter(obj, 0, 0, CANStandard, 0);
  }
- 
- 
+
+
+void can_init(can_t *obj, PinName rd, PinName td)
+{
+    can_init_freq(obj, rd, td, 500000);
+}
+
+
 void can_free(can_t *obj)
 {