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.
Fork of mbed-dev by
Diff: targets/TARGET_NXP/TARGET_LPC15XX/can_api.c
- Revision:
- 167:e84263d55307
- Parent:
- 156:95d6b41a828b
--- a/targets/TARGET_NXP/TARGET_LPC15XX/can_api.c Thu Jun 08 15:02:37 2017 +0100 +++ b/targets/TARGET_NXP/TARGET_LPC15XX/can_api.c Wed Jun 21 17:46:44 2017 +0100 @@ -415,8 +415,7 @@ return 1; } - -void can_init(can_t *obj, PinName rd, PinName td) { +void can_init_freq(can_t *obj, PinName rd, PinName td, int hz) { // Enable power and clock LPC_SYSCON->SYSAHBCLKCTRL1 |= (1UL << 7); LPC_SYSCON->PRESETCTRL1 |= (1UL << 7); @@ -430,7 +429,7 @@ LPC_SWM->PINASSIGN[6] &= ~(0x00FFFF00L); LPC_SWM->PINASSIGN[6] |= (rd << 16) | (td << 8); - can_frequency(obj, 100000); + can_frequency(obj, hz); // Resume operation LPC_C_CAN0->CANCNTL &= ~(1UL << 0); @@ -442,6 +441,10 @@ can_config_txmsgobj(obj); } +void can_init(can_t *obj, PinName rd, PinName td) { + can_init_freq(obj, rd, td, 100000); +} + void can_free(can_t *obj) { LPC_SYSCON->SYSAHBCLKCTRL1 &= ~(1UL << 7); LPC_SYSCON->PRESETCTRL1 &= ~(1UL << 7);