mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
rpi_rc_in update orb usage
This commit is contained in:
@@ -125,13 +125,7 @@ void RcInput::_measure(void)
|
|||||||
_data.rc_lost = false;
|
_data.rc_lost = false;
|
||||||
_data.input_source = input_rc_s::RC_INPUT_SOURCE_PX4IO_PPM;
|
_data.input_source = input_rc_s::RC_INPUT_SOURCE_PX4IO_PPM;
|
||||||
|
|
||||||
if (nullptr == _rcinput_pub) {
|
_rcinput_pub.publish(_data);
|
||||||
int instance;
|
|
||||||
_rcinput_pub = orb_advertise_multi(ORB_ID(input_rc), &_data, &instance, ORB_PRIO_DEFAULT);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
orb_publish(ORB_ID(input_rc), _rcinput_pub, &_data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rpi_rc_in::usage(const char *reason)
|
static void rpi_rc_in::usage(const char *reason)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#include <drivers/drv_hrt.h>
|
#include <drivers/drv_hrt.h>
|
||||||
|
|
||||||
#include <uORB/uORB.h>
|
#include <uORB/PublicationMulti.hpp>
|
||||||
#include <uORB/topics/input_rc.h>
|
#include <uORB/topics/input_rc.h>
|
||||||
|
|
||||||
#define RCINPUT_MEASURE_INTERVAL_US 20000
|
#define RCINPUT_MEASURE_INTERVAL_US 20000
|
||||||
@@ -87,9 +87,9 @@ private:
|
|||||||
|
|
||||||
bool _should_exit = false;
|
bool _should_exit = false;
|
||||||
bool _is_running = false;
|
bool _is_running = false;
|
||||||
orb_advert_t _rcinput_pub = nullptr;
|
uORB::PublicationMulti<input_rc_s> _rcinput_pub{ORB_ID(input_rc)};
|
||||||
int _channels = 8; //D8R-II plus
|
int _channels = 8; //D8R-II plus
|
||||||
struct input_rc_s _data = {};
|
input_rc_s _data{};
|
||||||
|
|
||||||
int *_mem = nullptr;
|
int *_mem = nullptr;
|
||||||
key_t _key = 4096; ///< shared memory key (matches the ppmdecode program's key)
|
key_t _key = 4096; ///< shared memory key (matches the ppmdecode program's key)
|
||||||
|
|||||||
Reference in New Issue
Block a user