MBED code for Xbee module running on solar car
Dependencies: XBeeLib mbed CUER_CAN
Fork of XBee802_Send_Data by
CAN_Parser_Telemetry.h@14:e625e467e257, 2017-10-07 (annotated)
- Committer:
- ItsJustZi
- Date:
- Sat Oct 07 02:49:23 2017 +0000
- Revision:
- 14:e625e467e257
- Parent:
- 12:13762b16b300
Final working implementation of send data before modifying to meet MDH requirements
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ItsJustZi | 12:13762b16b300 | 1 | #include "CAN_Data.h" |
ItsJustZi | 12:13762b16b300 | 2 | #include "CAN_IDs.h" |
ItsJustZi | 12:13762b16b300 | 3 | #include "mbed.h" |
ItsJustZi | 12:13762b16b300 | 4 | #include "PINNAMES_mbed.h" |
ItsJustZi | 12:13762b16b300 | 5 | |
ItsJustZi | 12:13762b16b300 | 6 | #define CAN_TIMEOUT_MS 100 |
ItsJustZi | 12:13762b16b300 | 7 | #define CAN_BUFFER_SIZE 255 |
ItsJustZi | 12:13762b16b300 | 8 | |
ItsJustZi | 12:13762b16b300 | 9 | void interruptHandler(); |
ItsJustZi | 12:13762b16b300 | 10 | bool idAccepted(int id); |
ItsJustZi | 12:13762b16b300 | 11 | void CAN_Init(); |
ItsJustZi | 12:13762b16b300 | 12 | bool can_send(CANMessage msg); |
ItsJustZi | 12:13762b16b300 | 13 | void CANDataSentCallback(void); |
ItsJustZi | 12:13762b16b300 | 14 | void CANIDsListUpdater(void); |
ItsJustZi | 12:13762b16b300 | 15 | |
ItsJustZi | 12:13762b16b300 | 16 | extern CAN can; //Create a CAN object to handle CAN comms |
ItsJustZi | 12:13762b16b300 | 17 | |
ItsJustZi | 12:13762b16b300 | 18 | //Software buffer for receiving CAN messages |
ItsJustZi | 12:13762b16b300 | 19 | extern CANMessage buffer[CAN_BUFFER_SIZE]; //CAN receive buffer |
ItsJustZi | 12:13762b16b300 | 20 | extern bool safe_to_write[CAN_BUFFER_SIZE]; //Semaphore bit indicating that it's safe to write to the software buffer |
ItsJustZi | 12:13762b16b300 | 21 | extern bool CAN_data_sent; |
ItsJustZi | 12:13762b16b300 | 22 | extern int acceptedCANIDs[CAN_BUFFER_SIZE]; |