|
发表于 2019-4-27 11:50:28
|
显示全部楼层
- if(BSP_SD_ReadBlocks_DMA((uint32_t*)buff,
- (uint32_t) (sector),
- count) == MSD_OK)
- {
- /* Wait that the reading process is completed or a timeout occurs */
- timeout = HAL_GetTick();
- while((ReadStatus == 0) && ((HAL_GetTick() - timeout) < SD_TIMEOUT))
- {
- }
- /* incase of a timeout return error */
- if (ReadStatus == 0)
- {
- res = RES_ERROR;
- }
- else
- {
- ReadStatus = 0;
- timeout = HAL_GetTick();
- while((HAL_GetTick() - timeout) < SD_TIMEOUT)
- {
- if (BSP_SD_GetCardState() == SD_TRANSFER_OK)
- {
- res = RES_OK;
- #if (ENABLE_SD_DMA_CACHE_MAINTENANCE_READ == 1)
- /*
- the SCB_InvalidateDCache_by_Addr() requires a 32-Byte aligned address,
- adjust the address and the D-Cache size to invalidate accordingly.
- */
- alignedAddr = (uint32_t)buff & ~0x1F;
- SCB_InvalidateDCache_by_Addr((uint32_t*)alignedAddr, count*BLOCKSIZE + ((uint32_t)buff - alignedAddr));
- #endif
- break;
复制代码
请问一下;前面您说到要读之前进行无效化操作,为什么代码实现是读之后进行的无效化操作
|
|