aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c8
-rw-r--r--os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c b/os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c
index 73e8483e0..8982d45b4 100644
--- a/os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c
+++ b/os/hal/ports/STM32/LLD/SDIOv1/hal_sdc_lld.c
@@ -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);
}
diff --git a/os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c b/os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c
index b545634b6..257ae6f24 100644
--- a/os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c
+++ b/os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c
@@ -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);
}