File tree Expand file tree Collapse file tree 2 files changed +44
-8
lines changed Expand file tree Collapse file tree 2 files changed +44
-8
lines changed Original file line number Diff line number Diff line change 272
272
* @brief Define this to use the CAN wired transport for sensor network communication.
273
273
*/
274
274
//#define MY_CAN
275
+ #if defined(MY_CAN )
276
+ /**
277
+ * @def MY_DEBUG_VERBOSE_CAN
278
+ * @brief Define this for verbose debug prints related to the %CAN driver.
279
+ */
280
+ //#define MY_DEBUG_VERBOSE_CAN
281
+ /**
282
+ * @def CAN_INT
283
+ * @brief Message arrived interrupt pin.
284
+ */
285
+ #ifndef CAN_INT
286
+ #define CAN_INT (2u)
287
+ #endif
288
+ /**
289
+ * @def CAN_CS
290
+ * @brief Chip select pin.
291
+ */
292
+ #ifndef CAN_CS
293
+ #define CAN_CS (10u)
294
+ #endif
295
+ /**
296
+ * @def CAN_SPEED
297
+ * @brief Baud rate. Allowed values can be found in mcp_can_dfs.h
298
+ */
299
+ #ifndef CAN_SPEED
300
+ #define CAN_SPEED CAN_250KBPS
301
+ #endif
302
+ /**
303
+ * @def CAN_CLOCK
304
+ * @brief can clock. Allowed values can be found in mcp_can_dfs.h
305
+ */
306
+ #ifndef CAN_CLOCK
307
+ #define CAN_CLOCK MCP_8MHZ
308
+ #endif
309
+ /**
310
+ * @def CAN_BUF_SIZE
311
+ * @brief assemble buffer size. Since long messages can be sliced and arrive mixed with other messages, assemble buffer is required.
312
+ */
313
+ #ifndef CAN_BUF_SIZE
314
+ #define CAN_BUF_SIZE (8u)
315
+ #endif
316
+ #endif
275
317
276
318
/**
277
319
* @def MY_RS485_BAUD_RATE
2450
2492
#define MY_PJON
2451
2493
#define MY_DEBUG_VERBOSE_PJON
2452
2494
// CAN
2453
- //TODO add more.
2454
2495
#define MY_CAN
2496
+ #define MY_DEBUG_VERBOSE_CAN
2455
2497
// RF24
2456
2498
#define MY_RADIO_RF24
2457
2499
#define MY_RADIO_NRF24 //deprecated
Original file line number Diff line number Diff line change 16
16
#else
17
17
#define CAN_DEBUG (x,...) // !< DEBUG null
18
18
#endif
19
- #define CAN_INT 2 // TODO make configurable
20
- #define CAN_CS 10
21
- #define CAN_SPEED CAN_250KBPS
22
- #define CAN_CLOCK MCP_8MHZ
23
- MCP_CAN CAN0 (CAN_CS); // TODO make configurable
24
- // since long messages can be sliced and arrive mixed with other messages assemble buffer is required
25
- #define CAN_BUF_SIZE 8 // TODO make configurable
19
+ MCP_CAN CAN0 (CAN_CS);
26
20
bool canInitialized=false ;
27
21
28
22
// input buffer for raw data (from library).
You can’t perform that action at this time.
0 commit comments