Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
f05b87bd
Commit
f05b87bd
authored
Aug 26, 2014
by
Damien George
Browse files
Merge pull request #824 from dhylands/sdcard-power
Fix sdcard_power_on to not do anything if the card is already powered on...
parents
3b72da67
994bb4a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/sdcard.c
View file @
f05b87bd
...
...
@@ -90,6 +90,9 @@ bool sdcard_power_on(void) {
if
(
!
sdcard_is_present
())
{
return
false
;
}
if
(
sd_handle
.
Instance
)
{
return
true
;
}
// SD device interface configuration
sd_handle
.
Instance
=
SDIO
;
...
...
@@ -120,7 +123,10 @@ error:
}
void
sdcard_power_off
(
void
)
{
HAL_SD_DeInit
(
&
sd_handle
);
if
(
!
sd_handle
.
Instance
)
{
return
;
}
HAL_SD_DeInit
(
&
sd_handle
);
sd_handle
.
Instance
=
NULL
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment