CANPort provides a higher level interface to a CAN communication channel, and provides timestamping, servicing additional hardware interfaces (optional activity LED, CAN transceiver slope control)
Diff: CANPort.cpp
- Revision:
- 1:f0b4e47d948d
- Parent:
- 0:7b81b19d9b10
- Child:
- 3:4c780c641125
diff -r 7b81b19d9b10 -r f0b4e47d948d CANPort.cpp --- a/CANPort.cpp Sun Jul 15 15:15:19 2012 +0000 +++ b/CANPort.cpp Wed Aug 28 22:02:49 2019 +0000 @@ -107,7 +107,11 @@ void CANPort::Flash(CANDIR_T tx) { if (activityPin) { *activityPin = (tx == xmt) ? FLASH_TX_LEVEL : FLASH_RX_LEVEL; // dim for transmit, bright for receive + #if (MBED_MAJOR_VERSION >= 5) || (MBED_LIBRARY_VERSION > 127) + activityTimeout.attach(callback(this, &CANPort::Extinguish), FLASH_PERIOD); + #else activityTimeout.attach(this, &CANPort::Extinguish, FLASH_PERIOD); + #endif } }