Added alignment checks to the SDIO/SDMMC drivers.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9711 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-07-16 10:31:24 +00:00
parent c7c6f26484
commit 5dfd79b059
2 changed files with 12 additions and 4 deletions

View File

@ -813,7 +813,9 @@ bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
}
return HAL_SUCCESS;
}
#endif /* STM32_SDC_SDIO_UNALIGNED_SUPPORT */
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
return sdc_lld_read_aligned(sdcp, startblk, buf, blocks);
}
@ -846,7 +848,9 @@ bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
}
return HAL_SUCCESS;
}
#endif /* STM32_SDC_SDIO_UNALIGNED_SUPPORT */
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
return sdc_lld_write_aligned(sdcp, startblk, buf, blocks);
}

View File

@ -904,7 +904,9 @@ bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
}
return HAL_SUCCESS;
}
#endif /* STM32_SDC_SDMMC_UNALIGNED_SUPPORT */
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
return sdc_lld_read_aligned(sdcp, startblk, buf, blocks);
}
@ -937,7 +939,9 @@ bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
}
return HAL_SUCCESS;
}
#endif /* STM32_SDC_SDMMC_UNALIGNED_SUPPORT */
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
return sdc_lld_write_aligned(sdcp, startblk, buf, blocks);
}