CAN library containing a CAN controller object handling a FIFO, and CAN peripherals attached to it.

Revision:
4:0ed21bbd917b
Parent:
2:c81dff9c8a93
Child:
5:d1920eb1d63e
--- a/ControllerCAN.cpp	Thu Feb 18 15:43:52 2016 +0000
+++ b/ControllerCAN.cpp	Sat May 05 13:46:16 2018 +0000
@@ -25,9 +25,11 @@
 #include "mbed.h"
 #include "ControllerCAN.h"
 
-ControllerCAN::ControllerCAN() : can(p30, p29) {
+CAN ControllerCAN::can(PA_8, PA_9);
+
+ControllerCAN::ControllerCAN(){
     can.frequency(250000);              // Baud rate : kbits/s
-    can.attach(this, &ControllerCAN::can_ISR_Reader);        // CAN ISR
+    can.attach(callback(this, &ControllerCAN::can_ISR_Reader));        // CAN ISR
     FIFO_ecriture = 0;
     FIFO_lecture = 0;
     FIFO_occupation = 0;
@@ -85,4 +87,4 @@
       // FIFO gestion
        FIFO_ecriture=(FIFO_ecriture+1)%SIZE_FIFO;
     }
-}
\ No newline at end of file
+}