Alfred Lind-Anderton
/
CAN_Hello_XAVIER
Using CAN bus with (not just NUCLEO) mbed boards
Diff: main.cpp
- Revision:
- 7:883da97339ab
- Parent:
- 6:c893b98fc2b5
- Child:
- 8:c65afde7f7f5
diff -r c893b98fc2b5 -r 883da97339ab main.cpp --- a/main.cpp Tue Feb 05 14:58:54 2019 +0000 +++ b/main.cpp Tue Feb 05 15:01:00 2019 +0000 @@ -24,23 +24,25 @@ #define BOARD1 1 // comment out this line when compiling for board #2 #if defined(TARGET_STM32F103C8T6) -#define LED_PIN PC_13 -#define USBTX PA_2 -#define USBRX PA_3 -const int OFF = 1; -const int ON = 0; + #define LED_PIN PC_13 + #define USBTX PA_2 + #define USBRX PA_3 + const int OFF = 1; + const int ON = 0; #else -#define LED_PIN LED1 -const int OFF = 0; -const int ON = 1; + #define LED_PIN LED1 + const int OFF = 0; + const int ON = 1; #endif + #if defined(BOARD1) -const unsigned int RX_ID = 0x100; -const unsigned int TX_ID = 0x101; + const unsigned int RX_ID = 0x100; + const unsigned int TX_ID = 0x101; #else -const unsigned int RX_ID = 0x101; -const unsigned int TX_ID = 0x100; + const unsigned int RX_ID = 0x101; + const unsigned int TX_ID = 0x100; #endif + #include "mbed.h" #include "CANMsg.h"