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
53acb324
Commit
53acb324
authored
12 years ago
by
Jason Short
Browse files
Options
Downloads
Patches
Plain Diff
ACM: Restore Multi-mode support
parent
e13cea03
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
ArduCopter/control_modes.pde
+16
-1
16 additions, 1 deletion
ArduCopter/control_modes.pde
ArduCopter/defines.h
+5
-1
5 additions, 1 deletion
ArduCopter/defines.h
with
21 additions
and
2 deletions
ArduCopter/control_modes.pde
+
16
−
1
View file @
53acb324
...
...
@@ -60,7 +60,22 @@ static void read_trim_switch()
// set the ch7 flag
ap_system
.
CH7_flag
=
(
g
.
rc_7
.
radio_in
>=
CH7_PWM_TRIGGER
);
switch
(
g
.
ch7_option
)
{
// multi-mode
int8_t
option
;
if
(
g
.
ch7_option
==
CH7_MULTI_MODE
)
{
if
(
g
.
rc_6
.
radio_in
<
CH6_PWM_TRIGGER_LOW
)
{
option
=
CH7_FLIP
;
}
else
if
(
g
.
rc_6
.
radio_in
>
CH6_PWM_TRIGGER_HIGH
)
{
option
=
CH7_SAVE_WP
;
}
else
{
option
=
CH7_RTL
;
}
}
else
{
option
=
g
.
ch7_option
;
}
switch
(
option
)
{
case
CH7_FLIP
:
// flip if switch is on, positive throttle and we're actually flying
if
(
ap_system
.
CH7_flag
&&
g
.
rc_3
.
control_in
>=
0
&&
ap
.
takeoff_complete
)
{
...
...
This diff is collapsed.
Click to expand it.
ArduCopter/defines.h
+
5
−
1
View file @
53acb324
...
...
@@ -51,6 +51,9 @@
// CH 7 control
#define CH7_PWM_TRIGGER 1800 // pwm value above which the channel 7 option will be invoked
#define CH6_PWM_TRIGGER_HIGH 1800
#define CH6_PWM_TRIGGER_LOW 1200
#define CH7_DO_NOTHING 0
#define CH7_SET_HOVER 1 // deprecated
#define CH7_FLIP 2
...
...
@@ -59,10 +62,11 @@
#define CH7_SAVE_TRIM 5
#define CH7_ADC_FILTER 6 // deprecated
#define CH7_SAVE_WP 7
#define CH7_MULTI_MODE 8
// deprecated
#define CH7_MULTI_MODE 8
#define CH7_CAMERA_TRIGGER 9
// Frame types
#define QUAD_FRAME 0
#define TRI_FRAME 1
...
...
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