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
e2d84e10
Commit
e2d84e10
authored
12 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
APM_OBC: cope with half frames on failsafe board
parent
1877bf50
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/APM_OBC/Failsafe_Board/Failsafe_Board.pde
+12
-4
12 additions, 4 deletions
libraries/APM_OBC/Failsafe_Board/Failsafe_Board.pde
with
12 additions
and
4 deletions
libraries/APM_OBC/Failsafe_Board/Failsafe_Board.pde
+
12
−
4
View file @
e2d84e10
...
...
@@ -125,7 +125,7 @@ static void set_servos_terminate(uint8_t obc_mode)
{
set_mux_mode
(
MUX_MODE_MICRO
);
if
(
obc_mode
)
{
set_servos
(
1
0
00
,
2000
,
10
0
0
,
1
000
);
set_servos
(
1
1
00
,
1824
,
10
4
0
,
1
131
);
}
else
{
set_servos
(
1500
,
1500
,
1200
,
1500
);
}
...
...
@@ -165,6 +165,7 @@ void loop()
static
uint8_t
led_state
;
static
bool
has_terminated
=
false
;
static
uint8_t
termination_counter
;
static
uint8_t
max_termination_counter
;
static
uint16_t
loop_counter
;
loop_counter
++
;
...
...
@@ -185,11 +186,11 @@ void loop()
static
uint8_t
last_mode_manual
;
if
(
!
receiver_fail
)
{
if
(
manual_mode
)
{
if
(
last_mode_manual
<
2
55
)
{
if
(
last_mode_manual
<
3
2
)
{
last_mode_manual
++
;
}
}
else
{
last_mode_manual
=
0
;
}
else
if
(
last_mode_manual
>
0
)
{
last_mode_manual
--
;
}
}
...
...
@@ -210,6 +211,9 @@ void loop()
Serial
.
print
(
" TERM1:"
);
Serial
.
print
(
terminate_primary
);
Serial
.
print
(
" TERM2:"
);
Serial
.
print
(
terminate_backup
);
Serial
.
print
(
" RFAIL:"
);
Serial
.
print
(
receiver_fail
);
Serial
.
print
(
" TC:"
);
Serial
.
print
(
termination_counter
);
Serial
.
print
(
" MTC:"
);
Serial
.
print
(
max_termination_counter
);
Serial
.
print
(
" LMM:"
);
Serial
.
print
(
last_mode_manual
);
Serial
.
print
(
" TERMINATED:"
);
Serial
.
print
(
has_terminated
);
Serial
.
print
(
" LOOP:"
);
Serial
.
print
(
loop_counter
);
Serial
.
println
();
...
...
@@ -229,6 +233,7 @@ void loop()
has_terminated
=
false
;
termination_counter
=
0
;
last_mode_manual
=
0
;
max_termination_counter
=
0
;
}
}
...
...
@@ -260,6 +265,9 @@ void loop()
}
else
{
termination_counter
=
0
;
}
if
(
termination_counter
>
max_termination_counter
)
{
max_termination_counter
=
termination_counter
;
}
// use the termination counter to debounce the termination
// pins
...
...
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