mbed library sources
Dependents: Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more
Superseded
This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.
Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.
If you are looking for a stable and tested release, please import one of the official mbed library releases:
Import librarymbed
The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Diff: common/CAN.cpp
- 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