Skip to content

Commit

Permalink
rc_input: move to uORB::PublicationMulti<>
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Sep 30, 2019
1 parent 6941077 commit 2989ce9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/drivers/rc_input/RCInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ RCInput::RCInput(bool run_as_task, char *device) :

RCInput::~RCInput()
{
orb_unadvertise(_to_input_rc);

#ifdef RC_SERIAL_PORT
dsm_deinit();
#endif
Expand Down Expand Up @@ -674,8 +672,7 @@ RCInput::cycle()
if (rc_updated) {
perf_count(_publish_interval_perf);

int instance;
orb_publish_auto(ORB_ID(input_rc), &_to_input_rc, &_rc_in, &instance, ORB_PRIO_DEFAULT);
_to_input_rc.publish(_rc_in);

} else if (!rc_updated && ((hrt_absolute_time() - _rc_in.timestamp_last_signal) > 1_s)) {
_rc_scan_locked = false;
Expand Down
4 changes: 3 additions & 1 deletion src/drivers/rc_input/RCInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include <px4_log.h>
#include <px4_module.h>
#include <px4_workqueue.h>
#include <uORB/Subscription.hpp>
#include <uORB/PublicationMulti.hpp>
#include <uORB/topics/adc_report.h>
#include <uORB/topics/input_rc.h>
#include <uORB/topics/vehicle_command.h>
Expand Down Expand Up @@ -129,7 +131,7 @@ class RCInput : public ModuleBase<RCInput>
float _analog_rc_rssi_volt{-1.0f};
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};
char _device[20] {}; ///< device / serial port path
Expand Down

0 comments on commit 2989ce9

Please sign in to comment.