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: SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more
Fork of mbed-dev-f303 by
Diff: drivers/CAN.cpp
- Revision:
- 163:74e0ce7f98e8
- Parent:
- 149:156823d33999
- Child:
- 167:e84263d55307
--- a/drivers/CAN.cpp Wed Apr 12 16:21:43 2017 +0100
+++ b/drivers/CAN.cpp Fri Apr 28 14:04:18 2017 +0100
@@ -27,7 +27,7 @@
// No lock needed in constructor
for (int i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
- _irq[i].attach(donothing);
+ _irq[i] = callback(donothing);
}
can_init(&_can, rd, td);
@@ -104,10 +104,10 @@
void CAN::attach(Callback<void()> func, IrqType type) {
lock();
if (func) {
- _irq[(CanIrqType)type].attach(func);
+ _irq[(CanIrqType)type] = func;
can_irq_set(&_can, (CanIrqType)type, 1);
} else {
- _irq[(CanIrqType)type].attach(donothing);
+ _irq[(CanIrqType)type] = callback(donothing);
can_irq_set(&_can, (CanIrqType)type, 0);
}
unlock();
