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 272272 * @brief Define this to use the CAN wired transport for sensor network communication.
273273 */
274274//#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
275317
276318/**
277319 * @def MY_RS485_BAUD_RATE
24502492#define MY_PJON
24512493#define MY_DEBUG_VERBOSE_PJON
24522494// CAN
2453- //TODO add more.
24542495#define MY_CAN
2496+ #define MY_DEBUG_VERBOSE_CAN
24552497// RF24
24562498#define MY_RADIO_RF24
24572499#define MY_RADIO_NRF24 //deprecated
Original file line number Diff line number Diff line change 1616#else
1717#define CAN_DEBUG (x,...) // !< DEBUG null
1818#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);
2620bool canInitialized=false ;
2721
2822// input buffer for raw data (from library).
You can’t perform that action at this time.
0 commit comments