Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
afd1ce0c
Commit
afd1ce0c
authored
Nov 28, 2018
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/powerctrl: Disable IRQs during stop mode to allow reconfig on wake
parent
66ca8e9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
ports/stm32/powerctrl.c
ports/stm32/powerctrl.c
+7
-0
No files found.
ports/stm32/powerctrl.c
View file @
afd1ce0c
...
...
@@ -260,6 +260,10 @@ set_clk:
#endif
void
powerctrl_enter_stop_mode
(
void
)
{
// Disable IRQs so that the IRQ that wakes the device from stop mode is not
// executed until after the clocks are reconfigured
uint32_t
irq_state
=
disable_irq
();
#if defined(STM32L4)
// Configure the MSI as the clock source after waking up
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG
(
RCC_STOP_WAKEUPCLOCK_MSI
);
...
...
@@ -331,6 +335,9 @@ void powerctrl_enter_stop_mode(void) {
#endif
#endif
// Enable IRQs now that all clocks are reconfigured
enable_irq
(
irq_state
);
}
#if !defined(STM32L4)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment