1

Dependents:   yezhong_main_controller_copy yezhong_main_controller_copy_1 yezhong_main_controller_copy yezhong_main_controller_copy-

Revision:
9:a35b78afe3e3
Parent:
7:2abb9b7eec25
--- a/CAN3.cpp	Mon Oct 18 13:40:02 2010 +0000
+++ b/CAN3.cpp	Tue Jan 11 02:18:01 2022 +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();