File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
boards/emlid/navio2/navio_sysfs_rc_in Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 47
47
48
48
#include < drivers/drv_hrt.h>
49
49
50
- #include < uORB/uORB.h >
50
+ #include < uORB/PublicationMulti.hpp >
51
51
#include < uORB/topics/input_rc.h>
52
52
53
53
namespace navio_sysfs_rc_in
@@ -96,7 +96,7 @@ class RcInput
96
96
bool _isRunning;
97
97
struct work_s _work;
98
98
99
- orb_advert_t _rcinput_pub;
99
+ uORB::PublicationMulti<input_rc_s> _rcinput_pub{ ORB_ID (input_rc)} ;
100
100
101
101
int _channels;
102
102
int _ch_fd[input_rc_s::RC_INPUT_MAX_CHANNELS] {};
@@ -126,13 +126,6 @@ int RcInput::navio_rc_init()
126
126
_data.values [i] = UINT16_MAX;
127
127
}
128
128
129
- _rcinput_pub = orb_advertise (ORB_ID (input_rc), &_data);
130
-
131
- if (_rcinput_pub == nullptr ) {
132
- PX4_WARN (" error: advertise failed" );
133
- return -1 ;
134
- }
135
-
136
129
return 0 ;
137
130
}
138
131
@@ -208,7 +201,7 @@ void RcInput::_measure(void)
208
201
_data.rc_lost = false ;
209
202
_data.input_source = input_rc_s::RC_INPUT_SOURCE_PX4IO_PPM;
210
203
211
- orb_publish ( ORB_ID (input_rc), _rcinput_pub, & _data);
204
+ _rcinput_pub. publish ( _data);
212
205
}
213
206
214
207
/* *
You can’t perform that action at this time.
0 commit comments