Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
90ba80dc
Commit
90ba80dc
authored
Jul 06, 2014
by
Dave Hylands
Browse files
Disable IRQs around sdcard reads.
Once the code switches to using DMA, this can be removed.
parent
5fa5ca40
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/sdcard.c
View file @
90ba80dc
...
...
@@ -144,7 +144,13 @@ bool sdcard_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks)
return
false
;
}
if
(
HAL_SD_ReadBlocks
(
&
sd_handle
,
(
uint32_t
*
)
dest
,
block_num
*
SDCARD_BLOCK_SIZE
,
SDCARD_BLOCK_SIZE
,
num_blocks
)
!=
SD_OK
)
{
HAL_SD_ErrorTypedef
err
;
__disable_irq
();
err
=
HAL_SD_ReadBlocks
(
&
sd_handle
,
(
uint32_t
*
)
dest
,
block_num
*
SDCARD_BLOCK_SIZE
,
SDCARD_BLOCK_SIZE
,
num_blocks
);
__enable_irq
();
if
(
err
!=
SD_OK
)
{
return
false
;
}
...
...
Write
Preview
Supports
Markdown
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