mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
uavcan: fix driver init after stop/start (#25511)
This commit is contained in:
parent
ce207837cf
commit
9015001b42
@ -644,7 +644,7 @@ uavcan::int16_t CanIface::configureFilters(const uavcan::CanFilterConfig *filter
|
||||
|
||||
bool CanIface::waitCCCRBitStateChange(uint32_t mask, bool target_state)
|
||||
{
|
||||
#if UAVCAN_STM32_NUTTX
|
||||
#if UAVCAN_STM32H7_NUTTX
|
||||
const unsigned Timeout = 1000;
|
||||
#else
|
||||
const unsigned Timeout = 2000000;
|
||||
@ -657,7 +657,7 @@ bool CanIface::waitCCCRBitStateChange(uint32_t mask, bool target_state)
|
||||
return true;
|
||||
}
|
||||
|
||||
#if UAVCAN_STM32_NUTTX
|
||||
#if UAVCAN_STM32H7_NUTTX
|
||||
::usleep(1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -505,12 +505,16 @@ void UavcanNode::Run()
|
||||
|
||||
if (can_init_res < 0) {
|
||||
PX4_ERR("CAN driver init failed %i", can_init_res);
|
||||
ScheduleClear();
|
||||
return;
|
||||
}
|
||||
|
||||
int rv = _node.start();
|
||||
|
||||
if (rv < 0) {
|
||||
PX4_ERR("Failed to start the node");
|
||||
ScheduleClear();
|
||||
return;
|
||||
}
|
||||
|
||||
// If the node_id was not supplied by the bootloader do Dynamic Node ID allocation
|
||||
@ -528,6 +532,8 @@ void UavcanNode::Run()
|
||||
|
||||
if (client_start_res < 0) {
|
||||
PX4_ERR("Failed to start the dynamic node ID client");
|
||||
ScheduleClear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user