mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 05:11:35 +08:00
uavcan use the specified architecture driver
This commit is contained in:
committed by
Daniel Agar
parent
caa0700ca3
commit
78fcf1dc28
@@ -560,7 +560,7 @@ int UavcanNode::start(uavcan::NodeID node_id, uint32_t bitrate)
|
|||||||
/*
|
/*
|
||||||
* Node init
|
* Node init
|
||||||
*/
|
*/
|
||||||
_instance = new UavcanNode(can->driver, uavcan_stm32::SystemClock::instance());
|
_instance = new UavcanNode(can->driver, UAVCAN_DRIVER::SystemClock::instance());
|
||||||
|
|
||||||
if (_instance == nullptr) {
|
if (_instance == nullptr) {
|
||||||
PX4_ERR("Out of memory");
|
PX4_ERR("Out of memory");
|
||||||
@@ -773,20 +773,20 @@ int UavcanNode::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* When we have a system wide notion of time update (i.e the transition from the initial
|
/* When we have a system wide notion of time update (i.e the transition from the initial
|
||||||
* System RTC setting to the GPS) we would call uavcan_stm32::clock::setUtc() when that
|
* System RTC setting to the GPS) we would call UAVCAN_DRIVER::clock::setUtc() when that
|
||||||
* happens, but for now we use adjustUtc with a correction of the hrt so that the
|
* happens, but for now we use adjustUtc with a correction of the hrt so that the
|
||||||
* time bases are the same
|
* time bases are the same
|
||||||
*/
|
*/
|
||||||
uavcan_stm32::clock::adjustUtc(uavcan::UtcDuration::fromUSec(hrt_absolute_time()));
|
UAVCAN_DRIVER::clock::adjustUtc(uavcan::UtcDuration::fromUSec(hrt_absolute_time()));
|
||||||
_master_timer.setCallback(TimerCallback(this, &UavcanNode::handle_time_sync));
|
_master_timer.setCallback(TimerCallback(this, &UavcanNode::handle_time_sync));
|
||||||
_master_timer.startPeriodic(uavcan::MonotonicDuration::fromMSec(1000));
|
_master_timer.startPeriodic(uavcan::MonotonicDuration::fromMSec(1000));
|
||||||
|
|
||||||
_node_status_monitor.start();
|
_node_status_monitor.start();
|
||||||
|
|
||||||
const int busevent_fd = ::open(uavcan_stm32::BusEvent::DevName, 0);
|
const int busevent_fd = ::open(UAVCAN_DRIVER::BusEvent::DevName, 0);
|
||||||
|
|
||||||
if (busevent_fd < 0) {
|
if (busevent_fd < 0) {
|
||||||
PX4_ERR("Failed to open %s", uavcan_stm32::BusEvent::DevName);
|
PX4_ERR("Failed to open %s", UAVCAN_DRIVER::BusEvent::DevName);
|
||||||
_task_should_exit = true;
|
_task_should_exit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class UavcanNode : public device::CDev
|
|||||||
static constexpr unsigned StackSize = 2400;
|
static constexpr unsigned StackSize = 2400;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef uavcan_stm32::CanInitHelper<RxQueueLenPerIface> CanInitHelper;
|
typedef UAVCAN_DRIVER::CanInitHelper<RxQueueLenPerIface> CanInitHelper;
|
||||||
enum eServerAction {None, Start, Stop, CheckFW, Busy};
|
enum eServerAction {None, Start, Stop, CheckFW, Busy};
|
||||||
|
|
||||||
UavcanNode(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &system_clock);
|
UavcanNode(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &system_clock);
|
||||||
|
|||||||
@@ -80,8 +80,8 @@
|
|||||||
UavcanServers *UavcanServers::_instance;
|
UavcanServers *UavcanServers::_instance;
|
||||||
UavcanServers::UavcanServers(uavcan::INode &main_node) :
|
UavcanServers::UavcanServers(uavcan::INode &main_node) :
|
||||||
_subnode_thread(-1),
|
_subnode_thread(-1),
|
||||||
_vdriver(NumIfaces, uavcan_stm32::SystemClock::instance(), main_node.getAllocator(), VirtualIfaceBlockAllocationQuota),
|
_vdriver(NumIfaces, UAVCAN_DRIVER::SystemClock::instance(), main_node.getAllocator(), VirtualIfaceBlockAllocationQuota),
|
||||||
_subnode(_vdriver, uavcan_stm32::SystemClock::instance(), main_node.getAllocator()),
|
_subnode(_vdriver, UAVCAN_DRIVER::SystemClock::instance(), main_node.getAllocator()),
|
||||||
_main_node(main_node),
|
_main_node(main_node),
|
||||||
_server_instance(_subnode, _storage_backend, _tracer),
|
_server_instance(_subnode, _storage_backend, _tracer),
|
||||||
_fileserver_backend(_subnode),
|
_fileserver_backend(_subnode),
|
||||||
|
|||||||
Reference in New Issue
Block a user