Fixed bug #1238.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15814 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
25f4c4c371
commit
becfb8ae06
|
@ -906,7 +906,6 @@ bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
|
||||||
uint8_t *buf, uint32_t blocks) {
|
uint8_t *buf, uint32_t blocks) {
|
||||||
|
|
||||||
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
||||||
if (((unsigned)buf & 3) != 0) {
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < blocks; i++) {
|
for (i = 0; i < blocks; i++) {
|
||||||
if (sdc_lld_read_aligned(sdcp, startblk, sdcp->buf, 1))
|
if (sdc_lld_read_aligned(sdcp, startblk, sdcp->buf, 1))
|
||||||
|
@ -916,11 +915,11 @@ bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
|
||||||
startblk++;
|
startblk++;
|
||||||
}
|
}
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
|
||||||
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
||||||
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
|
||||||
return sdc_lld_read_aligned(sdcp, startblk, buf, blocks);
|
return sdc_lld_read_aligned(sdcp, startblk, buf, blocks);
|
||||||
|
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -941,7 +940,6 @@ bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
|
||||||
const uint8_t *buf, uint32_t blocks) {
|
const uint8_t *buf, uint32_t blocks) {
|
||||||
|
|
||||||
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
||||||
if (((unsigned)buf & 3) != 0) {
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < blocks; i++) {
|
for (i = 0; i < blocks; i++) {
|
||||||
memcpy(sdcp->buf, buf, MMCSD_BLOCK_SIZE);
|
memcpy(sdcp->buf, buf, MMCSD_BLOCK_SIZE);
|
||||||
|
@ -951,11 +949,11 @@ bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
|
||||||
startblk++;
|
startblk++;
|
||||||
}
|
}
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
|
||||||
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
||||||
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
|
||||||
return sdc_lld_write_aligned(sdcp, startblk, buf, blocks);
|
return sdc_lld_write_aligned(sdcp, startblk, buf, blocks);
|
||||||
|
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -785,7 +785,6 @@ bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
|
||||||
uint8_t *buf, uint32_t blocks) {
|
uint8_t *buf, uint32_t blocks) {
|
||||||
|
|
||||||
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
||||||
if (((unsigned)buf & 3) != 0) {
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < blocks; i++) {
|
for (i = 0; i < blocks; i++) {
|
||||||
if (sdc_lld_read_aligned(sdcp, startblk, sdcp->buf, 1))
|
if (sdc_lld_read_aligned(sdcp, startblk, sdcp->buf, 1))
|
||||||
|
@ -795,11 +794,11 @@ bool sdc_lld_read(SDCDriver *sdcp, uint32_t startblk,
|
||||||
startblk++;
|
startblk++;
|
||||||
}
|
}
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
|
||||||
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
||||||
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
|
||||||
return sdc_lld_read_aligned(sdcp, startblk, buf, blocks);
|
return sdc_lld_read_aligned(sdcp, startblk, buf, blocks);
|
||||||
|
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -820,7 +819,6 @@ bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
|
||||||
const uint8_t *buf, uint32_t blocks) {
|
const uint8_t *buf, uint32_t blocks) {
|
||||||
|
|
||||||
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
#if STM32_SDC_SDMMC_UNALIGNED_SUPPORT
|
||||||
if (((unsigned)buf & 3) != 0) {
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < blocks; i++) {
|
for (i = 0; i < blocks; i++) {
|
||||||
memcpy(sdcp->buf, buf, MMCSD_BLOCK_SIZE);
|
memcpy(sdcp->buf, buf, MMCSD_BLOCK_SIZE);
|
||||||
|
@ -830,11 +828,11 @@ bool sdc_lld_write(SDCDriver *sdcp, uint32_t startblk,
|
||||||
startblk++;
|
startblk++;
|
||||||
}
|
}
|
||||||
return HAL_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
|
||||||
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
#else /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
osalDbgAssert((((unsigned)buf & 3) == 0), "unaligned buffer");
|
||||||
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
|
||||||
return sdc_lld_write_aligned(sdcp, startblk, buf, blocks);
|
return sdc_lld_write_aligned(sdcp, startblk, buf, blocks);
|
||||||
|
#endif /* !STM32_SDC_SDIO_UNALIGNED_SUPPORT */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -127,6 +127,7 @@
|
||||||
- NEW: Increased stacks size in RT test suite from 128 to 192. added an
|
- NEW: Increased stacks size in RT test suite from 128 to 192. added an
|
||||||
option to override the stack size by defining THREADS_STACK_SIZE
|
option to override the stack size by defining THREADS_STACK_SIZE
|
||||||
in the makefile.
|
in the makefile.
|
||||||
|
- FIX: Fixed problems with cache in STM32 SDMMC drivers (bug #1238)(***********TODO*********** backported to 21.11.3).
|
||||||
- FIX: Fixed missing clock enables for some GPIOS on some STM32L4s (bug #1237)
|
- FIX: Fixed missing clock enables for some GPIOS on some STM32L4s (bug #1237)
|
||||||
(backported to 20.3.5)(backported to 21.11.3).
|
(backported to 20.3.5)(backported to 21.11.3).
|
||||||
- FIX: Fixed old bugs in serial driver header (bug #1236)
|
- FIX: Fixed old bugs in serial driver header (bug #1236)
|
||||||
|
|
Loading…
Reference in New Issue