Additional CAN example

Revision:
2:d6cbcdb04ada
Parent:
1:5791101761f9
--- a/main.cpp	Fri Jan 20 11:39:47 2017 -0600
+++ b/main.cpp	Thu Oct 11 16:02:16 2018 +0000
@@ -1,8 +1,13 @@
 #include "mbed.h"
 
+#if defined (DEVICE_CAN) || defined(DOXYGEN_ONLY)
+
 Ticker ticker;
 DigitalOut led1(LED1);
 DigitalOut led2(LED2);
+/** The constructor takes in RX, and TX pin respectively.
+  * These pins, for this example, are defined in mbed_app.json
+  */
 CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD);
 CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD);
 char counter = 0;
@@ -30,3 +35,8 @@
         wait(0.2);
     }
 }
+
+#else
+  #error CAN NOT SUPPORTED
+  
+#endif