mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 13:18:52 +08:00
rc_input: move to uORB::PublicationMulti<>
This commit is contained in:
@@ -71,8 +71,6 @@ RCInput::RCInput(bool run_as_task, char *device) :
|
|||||||
|
|
||||||
RCInput::~RCInput()
|
RCInput::~RCInput()
|
||||||
{
|
{
|
||||||
orb_unadvertise(_to_input_rc);
|
|
||||||
|
|
||||||
#ifdef RC_SERIAL_PORT
|
#ifdef RC_SERIAL_PORT
|
||||||
dsm_deinit();
|
dsm_deinit();
|
||||||
#endif
|
#endif
|
||||||
@@ -674,8 +672,7 @@ RCInput::cycle()
|
|||||||
if (rc_updated) {
|
if (rc_updated) {
|
||||||
perf_count(_publish_interval_perf);
|
perf_count(_publish_interval_perf);
|
||||||
|
|
||||||
int instance;
|
_to_input_rc.publish(_rc_in);
|
||||||
orb_publish_auto(ORB_ID(input_rc), &_to_input_rc, &_rc_in, &instance, ORB_PRIO_DEFAULT);
|
|
||||||
|
|
||||||
} else if (!rc_updated && ((hrt_absolute_time() - _rc_in.timestamp_last_signal) > 1_s)) {
|
} else if (!rc_updated && ((hrt_absolute_time() - _rc_in.timestamp_last_signal) > 1_s)) {
|
||||||
_rc_scan_locked = false;
|
_rc_scan_locked = false;
|
||||||
|
|||||||
@@ -49,6 +49,8 @@
|
|||||||
#include <px4_log.h>
|
#include <px4_log.h>
|
||||||
#include <px4_module.h>
|
#include <px4_module.h>
|
||||||
#include <px4_workqueue.h>
|
#include <px4_workqueue.h>
|
||||||
|
#include <uORB/Subscription.hpp>
|
||||||
|
#include <uORB/PublicationMulti.hpp>
|
||||||
#include <uORB/topics/adc_report.h>
|
#include <uORB/topics/adc_report.h>
|
||||||
#include <uORB/topics/input_rc.h>
|
#include <uORB/topics/input_rc.h>
|
||||||
#include <uORB/topics/vehicle_command.h>
|
#include <uORB/topics/vehicle_command.h>
|
||||||
@@ -129,7 +131,7 @@ private:
|
|||||||
float _analog_rc_rssi_volt{-1.0f};
|
float _analog_rc_rssi_volt{-1.0f};
|
||||||
bool _analog_rc_rssi_stable{false};
|
bool _analog_rc_rssi_stable{false};
|
||||||
|
|
||||||
orb_advert_t _to_input_rc{nullptr};
|
uORB::PublicationMulti<input_rc_s> _to_input_rc{ORB_ID(input_rc)};
|
||||||
|
|
||||||
int _rcs_fd{-1};
|
int _rcs_fd{-1};
|
||||||
char _device[20] {}; ///< device / serial port path
|
char _device[20] {}; ///< device / serial port path
|
||||||
|
|||||||
Reference in New Issue
Block a user