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
27e3f0c0
Commit
27e3f0c0
authored
12 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
SITL: fixed a interrupt recursion bug
this can be triggered by the timer scheduler re-enabling interrupts
parent
5002be9a
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
libraries/Desktop/support/sitl.cpp
+8
-6
8 additions, 6 deletions
libraries/Desktop/support/sitl.cpp
with
8 additions
and
6 deletions
libraries/Desktop/support/sitl.cpp
+
8
−
6
View file @
27e3f0c0
...
...
@@ -232,6 +232,7 @@ static void timer_handler(int signum)
if
(
_interrupts_are_blocked
())
{
return
;
}
uint8_t
oldSREG
=
SREG
;
cli
();
#ifndef __CYGWIN__
...
...
@@ -255,9 +256,6 @@ static void timer_handler(int signum)
/* check for packet from flight sim */
sitl_fdm_input
();
// trigger all timers
timer_scheduler
.
run
();
// trigger RC input
if
(
isr_registry
.
_registry
[
ISR_REGISTRY_TIMER4_CAPT
])
{
isr_registry
.
_registry
[
ISR_REGISTRY_TIMER4_CAPT
]();
...
...
@@ -268,12 +266,12 @@ static void timer_handler(int signum)
if
(
update_count
==
0
)
{
sitl_update_gps
(
0
,
0
,
0
,
0
,
0
,
false
);
sei
()
;
SREG
=
oldSREG
;
return
;
}
if
(
update_count
==
last_update_count
)
{
sei
()
;
SREG
=
oldSREG
;
return
;
}
last_update_count
=
update_count
;
...
...
@@ -292,7 +290,11 @@ static void timer_handler(int signum)
// so the ADC code doesn't get stuck
ADCSRA
&=
~
_BV
(
ADSC
);
sei
();
// trigger all APM timers. We do this last as it can re-enable
// interrupts, which can lead to recursion
timer_scheduler
.
run
();
SREG
=
oldSREG
;
}
...
...
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