Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
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
Baitboat
Commits
da6f6f3e
Commit
da6f6f3e
authored
12 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
PeriodicProcess: switch to SREG = oldSREG pattern for interrupt mask/restore
parent
3646b4b8
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/AP_PeriodicProcess/AP_TimerProcess.cpp
+4
-2
4 additions, 2 deletions
libraries/AP_PeriodicProcess/AP_TimerProcess.cpp
with
4 additions
and
2 deletions
libraries/AP_PeriodicProcess/AP_TimerProcess.cpp
+
4
−
2
View file @
da6f6f3e
...
...
@@ -56,10 +56,11 @@ void AP_TimerProcess::register_process(ap_procedure proc)
for
(
uint8_t
i
=
0
;
i
<
_pidx
;
i
++
)
{
if
(
_proc
[
i
]
==
proc
)
return
;
}
uint8_t
oldSREG
=
SREG
;
cli
();
if
(
_pidx
<
AP_TIMERPROCESS_MAX_PROCS
)
_proc
[
_pidx
++
]
=
proc
;
sei
()
;
SREG
=
oldSREG
;
}
void
AP_TimerProcess
::
set_failsafe
(
ap_procedure
proc
)
...
...
@@ -140,10 +141,11 @@ void AP_TimerProcess::run(void)
}
// run any queued processes
uint8_t
oldSREG
=
SREG
;
cli
();
ap_procedure
qp
=
_queued_proc
;
_queued_proc
=
NULL
;
sei
()
;
SREG
=
oldSREG
;
if
(
qp
!=
NULL
)
{
_suspended
=
true
;
qp
(
tnow
);
...
...
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