Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Ardupilot
Commits
0d6b8479
Commit
0d6b8479
authored
11 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
AP_Notify: grab initial flags state in init()
this prevents annoying tones on startup of APM:Plane
parent
95a696ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/AP_Notify/ToneAlarm_PX4.cpp
+6
-1
6 additions, 1 deletion
libraries/AP_Notify/ToneAlarm_PX4.cpp
libraries/AP_Notify/ToneAlarm_PX4.h
+3
-3
3 additions, 3 deletions
libraries/AP_Notify/ToneAlarm_PX4.h
with
9 additions
and
4 deletions
libraries/AP_Notify/ToneAlarm_PX4.cpp
+
6
−
1
View file @
0d6b8479
...
...
@@ -41,6 +41,11 @@ bool ToneAlarm_PX4::init()
hal
.
console
->
printf
(
"Unable to open "
TONEALARM_DEVICE_PATH
);
return
false
;
}
// set initial boot states. This prevents us issueing a arming
// warning in plane and rover on every boot
flags
.
armed
=
AP_Notify
::
flags
.
armed
;
flags
.
failsafe_battery
=
AP_Notify
::
flags
.
failsafe_battery
;
return
true
;
}
...
...
@@ -56,7 +61,7 @@ bool ToneAlarm_PX4::play_tune(const uint8_t tune_number)
void
ToneAlarm_PX4
::
update
()
{
// exit immediately if we haven't initialised successfully
if
(
_tonealarm_fd
<=
0
)
{
if
(
_tonealarm_fd
==
-
1
)
{
return
;
}
...
...
This diff is collapsed.
Click to expand it.
libraries/AP_Notify/ToneAlarm_PX4.h
+
3
−
3
View file @
0d6b8479
...
...
@@ -26,13 +26,13 @@ public:
/// init - initialised the tone alarm
bool
init
(
void
);
/// play_tune - play one of the pre-defined tunes
bool
play_tune
(
const
uint8_t
tune_number
);
/// update - updates led according to timed_updated. Should be called at 50Hz
void
update
();
private:
/// play_tune - play one of the pre-defined tunes
bool
play_tune
(
const
uint8_t
tune_number
);
int
_tonealarm_fd
;
// file descriptor for the tone alarm
/// tonealarm_type - bitmask of states we track
...
...
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