Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
a644ed90
Commit
a644ed90
authored
7 years ago
by
Beat Küng
Committed by
Lorenz Meier
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mavlink: use orb_unsubscribe() instead of close() for orb subscription
parent
acaf7cd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/mavlink/mavlink_main.cpp
+6
-5
6 additions, 5 deletions
src/modules/mavlink/mavlink_main.cpp
with
6 additions
and
5 deletions
src/modules/mavlink/mavlink_main.cpp
+
6
−
5
View file @
a644ed90
...
...
@@ -739,7 +739,7 @@ int Mavlink::mavlink_open_uart(int baud, const char *uart_name)
/* if this is a config link, stay here and wait for it to open */
if
(
_uart_fd
<
0
&&
_mode
==
MAVLINK_MODE_CONFIG
)
{
int
armed_
fd
=
orb_subscribe
(
ORB_ID
(
actuator_armed
));
int
armed_
sub
=
orb_subscribe
(
ORB_ID
(
actuator_armed
));
struct
actuator_armed_s
armed
;
/* get the system arming state and abort on arming */
...
...
@@ -747,26 +747,27 @@ int Mavlink::mavlink_open_uart(int baud, const char *uart_name)
/* abort if an arming topic is published and system is armed */
bool
updated
=
false
;
orb_check
(
armed_
fd
,
&
updated
);
orb_check
(
armed_
sub
,
&
updated
);
if
(
updated
)
{
/* the system is now providing arming status feedback.
* instead of timing out, we resort to abort bringing
* up the terminal.
*/
orb_copy
(
ORB_ID
(
actuator_armed
),
armed_
fd
,
&
armed
);
orb_copy
(
ORB_ID
(
actuator_armed
),
armed_
sub
,
&
armed
);
if
(
armed
.
armed
)
{
/* this is not an error, but we are done */
orb_unsubscribe
(
armed_sub
);
return
-
1
;
}
}
usleep
(
100000
);
_uart_fd
=
::
open
(
uart_name
,
O_RDWR
|
O_NOCTTY
);
}
;
}
::
clos
e
(
armed_
fd
);
orb_unsubscrib
e
(
armed_
sub
);
}
if
(
_uart_fd
<
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment