mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 06:03:34 +08:00
Fix an architectural issue with the ORB that prevented publication from interrupt context.
ORB topic advertisements are now global handles that can be used in any context. It is still possible to open a topic node as a publisher, but it's not the default. As a consequence, the type of the handle returned from orb_advertise has changed; all other API remains the same.
This commit is contained in:
@@ -81,4 +81,7 @@
|
||||
/** Set the minimum interval at which the topic can be seen to be updated for this subscription */
|
||||
#define ORBIOCSETINTERVAL _ORBIOC(12)
|
||||
|
||||
/** Get the global advertiser handle for the topic */
|
||||
#define ORBIOCGADVERTISER _ORBIOC(13)
|
||||
|
||||
#endif /* _DRV_UORB_H */
|
||||
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
mag_scale _scale;
|
||||
bool _collect_phase;
|
||||
|
||||
int _mag_topic;
|
||||
orb_advert_t _mag_topic;
|
||||
|
||||
unsigned _reads;
|
||||
unsigned _measure_errors;
|
||||
|
||||
@@ -181,12 +181,12 @@ private:
|
||||
struct accel_report _accel_report;
|
||||
struct accel_scale _accel_scale;
|
||||
float _accel_range_scale;
|
||||
int _accel_topic;
|
||||
orb_advert_t _accel_topic;
|
||||
|
||||
struct gyro_report _gyro_report;
|
||||
struct gyro_scale _gyro_scale;
|
||||
float _gyro_range_scale;
|
||||
int _gyro_topic;
|
||||
orb_advert_t _gyro_topic;
|
||||
|
||||
unsigned _reads;
|
||||
perf_counter_t _sample_perf;
|
||||
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
int32_t _dT;
|
||||
int64_t _temp64;
|
||||
|
||||
int _baro_topic;
|
||||
orb_advert_t _baro_topic;
|
||||
|
||||
unsigned _reads;
|
||||
unsigned _measure_errors;
|
||||
|
||||
Reference in New Issue
Block a user