mbed library sources

Fork of mbed-src by mbed official

Revision:
41:e8b66477f5bf
Parent:
15:4892fe388435
Child:
49:a1af374b4197
--- a/common/CAN.cpp	Fri Oct 25 13:45:04 2013 +0100
+++ b/common/CAN.cpp	Fri Oct 25 15:00:04 2013 +0100
@@ -39,8 +39,8 @@
     return can_write(&_can, msg, 0);
 }
 
-int CAN::read(CANMessage &msg) {
-    return can_read(&_can, &msg);
+int CAN::read(CANMessage &msg, int handle) {
+    return can_read(&_can, &msg, handle);
 }
 
 void CAN::reset() {
@@ -63,19 +63,23 @@
     return can_mode(&_can, (CanMode)mode);
 }
 
-    void CAN::attach(void (*fptr)(void), IrqType type) {
-        if (fptr) {
-            _irq[(CanIrqType)type].attach(fptr);
-            can_irq_set(&_can, (CanIrqType)type, 1);
-        } else {
-            can_irq_set(&_can, (CanIrqType)type, 0);
-        }
+int CAN::filter(unsigned int id, unsigned int mask, CANFormat format, int handle) {
+    return can_filter(&_can, id, mask, format, handle);
+}
+
+void CAN::attach(void (*fptr)(void), IrqType type) {
+    if (fptr) {
+        _irq[(CanIrqType)type].attach(fptr);
+        can_irq_set(&_can, (CanIrqType)type, 1);
+    } else {
+        can_irq_set(&_can, (CanIrqType)type, 0);
     }
+}
 
-    void CAN::_irq_handler(uint32_t id, CanIrqType type) {
-        CAN *handler = (CAN*)id;
-        handler->_irq[type].call();
-    }
+void CAN::_irq_handler(uint32_t id, CanIrqType type) {
+    CAN *handler = (CAN*)id;
+    handler->_irq[type].call();
+}
 
 } // namespace mbed