Skip to content

Commit

Permalink
dronecan: don't init if can interface fails to init
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKlimaj authored and dagar committed Jan 8, 2025
1 parent 585e5d1 commit 2625c52
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/drivers/uavcan/uavcan_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,12 @@ UavcanNode::Run()

if (can_init_res < 0) {
PX4_ERR("CAN driver init failed %i", can_init_res);
}

_instance->init(node_id, can->driver.updateEvent());
} else {
_instance->init(node_id, can->driver.updateEvent());

_node_init = true;
_node_init = true;
}
}

pthread_mutex_lock(&_node_mutex);
Expand Down

0 comments on commit 2625c52

Please sign in to comment.