Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Hobbyking_Cheetah_Compact Hobbyking_Cheetah_Compact_DRV8323_14bit Hobbyking_Cheetah_Compact_DRV8323_V51_201907 HKC_MiniCheetah ... more
Fork of mbed-dev by
Diff: targets/TARGET_NUVOTON/TARGET_NUC472/can_api.c
- Revision:
- 167:e84263d55307
- Parent:
- 161:2cc1468da177
diff -r c97ed07ec1a8 -r e84263d55307 targets/TARGET_NUVOTON/TARGET_NUC472/can_api.c
--- 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)
{
