Skip to content

Commit

Permalink
CAN: Use thingset,can chosen node if existing
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjaeger committed Jul 7, 2023
1 parent 8fdf8e0 commit 3d9f3e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/can.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,13 @@ int thingset_can_set_report_rx_callback_inst(struct thingset_can *ts_can,

#ifndef CONFIG_THINGSET_CAN_MULTIPLE_INSTANCES

static const struct device *can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
#if DT_NODE_EXISTS(DT_CHOSEN(thingset_can))
#define CAN_DEVICE_NODE DT_CHOSEN(thingset_can)
#else
#define CAN_DEVICE_NODE DT_CHOSEN(zephyr_canbus)
#endif

static const struct device *can_dev = DEVICE_DT_GET(CAN_DEVICE_NODE);
static struct thingset_can ts_can_single;

int thingset_can_send(uint8_t *tx_buf, size_t tx_len, uint8_t target_addr)
Expand Down

0 comments on commit 3d9f3e4

Please sign in to comment.