mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 14:41:35 +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:
+1
-1
@@ -311,7 +311,7 @@ void *mtk_loop(void *arg)
|
||||
/* advertise GPS topic */
|
||||
struct vehicle_gps_position_s mtk_gps_d;
|
||||
mtk_gps = &mtk_gps_d;
|
||||
int gps_handle = orb_advertise(ORB_ID(vehicle_gps_position), &mtk_gps);
|
||||
orb_advert_t gps_handle = orb_advertise(ORB_ID(vehicle_gps_position), &mtk_gps);
|
||||
|
||||
while (1) {
|
||||
/* Parse a message from the gps receiver */
|
||||
|
||||
@@ -176,7 +176,7 @@ void *nmea_loop(void *arg)
|
||||
/* advertise GPS topic */
|
||||
struct vehicle_gps_position_s nmea_gps_d = {0};
|
||||
nmea_gps = &nmea_gps_d;
|
||||
int gps_handle = orb_advertise(ORB_ID(vehicle_gps_position), nmea_gps);
|
||||
orb_advert_t gps_handle = orb_advertise(ORB_ID(vehicle_gps_position), nmea_gps);
|
||||
|
||||
while (1) {
|
||||
/* Parse a message from the gps receiver */
|
||||
|
||||
+1
-1
@@ -842,7 +842,7 @@ void *ubx_loop(void *arg)
|
||||
|
||||
ubx_gps = &ubx_gps_d;
|
||||
|
||||
int gps_pub = orb_advertise(ORB_ID(vehicle_gps_position), &ubx_gps);
|
||||
orb_advert_t gps_pub = orb_advertise(ORB_ID(vehicle_gps_position), &ubx_gps);
|
||||
|
||||
while (1) {
|
||||
/* Parse a message from the gps receiver */
|
||||
|
||||
Reference in New Issue
Block a user