4545

Dependents:   LSS_Rev_1

Fork of mbed-dev by Umar Naeem

Revision:
163:74e0ce7f98e8
Parent:
149:156823d33999
diff -r e13f6fdb2ac4 -r 74e0ce7f98e8 drivers/CAN.cpp
--- 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();