From 11a31d5ecbdb8155c994ae987bf71a6b2e9fbeeb Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 2 Feb 2016 01:55:42 +0300 Subject: [PATCH] ESC command transfer priority assigned a high value. This change is not directly related to the current PR, but this change seems minor enough to be pulled in with it. --- src/modules/uavcan/actuators/esc.cpp | 2 ++ src/modules/uavcan/actuators/esc.hpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/modules/uavcan/actuators/esc.cpp b/src/modules/uavcan/actuators/esc.cpp index 15f2f5c854..b8856fb357 100644 --- a/src/modules/uavcan/actuators/esc.cpp +++ b/src/modules/uavcan/actuators/esc.cpp @@ -49,6 +49,8 @@ UavcanEscController::UavcanEscController(uavcan::INode &node) : _uavcan_sub_status(node), _orb_timer(node) { + _uavcan_pub_raw_cmd.setPriority(UAVCAN_COMMAND_TRANSFER_PRIORITY); + if (_perfcnt_invalid_input == nullptr) { errx(1, "uavcan: couldn't allocate _perfcnt_invalid_input"); } diff --git a/src/modules/uavcan/actuators/esc.hpp b/src/modules/uavcan/actuators/esc.hpp index 77f0f1d610..2cbc23ec9d 100644 --- a/src/modules/uavcan/actuators/esc.hpp +++ b/src/modules/uavcan/actuators/esc.hpp @@ -78,6 +78,7 @@ private: static constexpr unsigned MAX_RATE_HZ = 200; ///< XXX make this configurable static constexpr unsigned ESC_STATUS_UPDATE_RATE_HZ = 10; + static constexpr unsigned UAVCAN_COMMAND_TRANSFER_PRIORITY = 5; ///< 0..31, inclusive, 0 - highest, 31 - lowest typedef uavcan::MethodBinder&)>