MCP2515 CAN library
Fork of mcp2515 by
Diff: CAN3.cpp
- Revision:
- 13:ff12c7f532f9
- Parent:
- 7:2abb9b7eec25
- Child:
- 14:cf76652389be
diff -r b364adad6f08 -r ff12c7f532f9 CAN3.cpp --- a/CAN3.cpp Mon Jun 05 01:03:51 2017 +0000 +++ b/CAN3.cpp Mon Jul 24 18:12:55 2017 +0000 @@ -6,8 +6,8 @@ #include "mcp2515_defs.h" -CAN3::CAN3(SPI& _spi, PinName ncs, PinName itr) - : spi(_spi), _mcp(spi, ncs), _itr(itr) { +CAN3::CAN3(SPI& _spi, PinName ncs)//, PinName itr) + : spi(_spi), _mcp(spi, ncs) {//, _itr(itr) { printf("\n\rcan = %d",this); } @@ -53,11 +53,11 @@ } void CAN3::rise(void (*fptr)(void)) { - _itr.rise(fptr); +// _itr.rise(fptr); } void CAN3::fall(void (*fptr2)(void)) { - _itr.fall(fptr2); +// _itr.fall(fptr2); } int CAN3::frequency(int canSpeed) { @@ -81,7 +81,8 @@ if ( _mcp.setCANCTRL_Mode(MODE_NORMAL) == MCP2515_OK) { //MODE_NORMAL MODE_LOOPBACK // printf("OK\n\r"); } else { - error("failed\n\r"); + printf("failed\n\r"); + return -1; } _mcp.dumpExtendedStatus();