Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multipass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
derf
multipass
Commits
ed1ab107
Unverified
Commit
ed1ab107
authored
1 year ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
msp430fr5969: sleep: restore interrupt state
parent
d326c7e5
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/arch/msp430fr5969lp/arch.cc
+11
-1
11 additions, 1 deletion
src/arch/msp430fr5969lp/arch.cc
with
11 additions
and
1 deletion
src/arch/msp430fr5969lp/arch.cc
+
11
−
1
View file @
ed1ab107
...
...
@@ -86,6 +86,13 @@ extern void loop();
volatile
char
run_loop
=
0
;
#endif
inline
static
unsigned
int
irq_enabled
()
{
unsigned
int
sr
;
__asm__
__volatile__
(
"mov SR, %0"
:
"=r"
(
sr
)
:
);
return
sr
&
GIE
;
}
volatile
bool
sleep_done
=
false
;
// max delay: 262 ms @ 16 MHz
...
...
@@ -95,6 +102,7 @@ void Arch::sleep_ms(unsigned int const ms)
if
(
ms
==
0
)
{
return
;
}
int
int_enabled
=
irq_enabled
();
sleep_done
=
false
;
#if F_CPU == 16000000UL
TA3CTL
=
TASSEL__SMCLK
|
ID__8
;
// /8
...
...
@@ -121,7 +129,9 @@ void Arch::sleep_ms(unsigned int const ms)
asm
volatile
(
"nop"
);
__bis_SR_register
(
GIE
|
LPM2_bits
);
asm
volatile
(
"nop"
);
__dint
();
if
(
!
int_enabled
)
{
__dint
();
}
}
TA3CTL
=
TASSEL__SMCLK
;
}
...
...
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