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: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: drivers/CAN.cpp
- Revision:
- 167:e84263d55307
- Parent:
- 163:74e0ce7f98e8
- Child:
- 169:e3b6fe271b81
--- a/drivers/CAN.cpp Thu Jun 08 15:02:37 2017 +0100
+++ b/drivers/CAN.cpp Wed Jun 21 17:46:44 2017 +0100
@@ -34,6 +34,17 @@
can_irq_init(&_can, (&CAN::_irq_handler), (uint32_t)this);
}
+CAN::CAN(PinName rd, PinName td, int hz) : _can(), _irq() {
+ // No lock needed in constructor
+
+ for (int i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
+ _irq[i].attach(donothing);
+ }
+
+ can_init_freq(&_can, rd, td, hz);
+ can_irq_init(&_can, (&CAN::_irq_handler), (uint32_t)this);
+}
+
CAN::~CAN() {
// No lock needed in destructor
can_irq_free(&_can);


