Disable IRQs around sdcard reads.

Once the code switches to using DMA, this can be removed.
pull/744/head
Dave Hylands 2014-07-06 09:49:20 -07:00
rodzic 5fa5ca40e6
commit 90ba80dc36
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -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;
}