mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-20 12:03:52 +01:00
Merge pull request #18222 from benpicco/sam0_sdhc-align
cpu/sam0_common: mtd_sdhc: ensure source address alignment
This commit is contained in:
commit
24f7cbf9bb
@ -69,7 +69,7 @@ static int _read_page(mtd_dev_t *dev, void *buff, uint32_t page,
|
|||||||
DEBUG("%s(%lu, %lu, %lu)\n", __func__, page, offset, size);
|
DEBUG("%s(%lu, %lu, %lu)\n", __func__, page, offset, size);
|
||||||
|
|
||||||
/* emulate unaligned / sub-page read */
|
/* emulate unaligned / sub-page read */
|
||||||
if (pages == 0 || offset) {
|
if (pages == 0 || offset || ((uintptr_t)buff & 0x3)) {
|
||||||
#if IS_USED(MODULE_MTD_WRITE_PAGE)
|
#if IS_USED(MODULE_MTD_WRITE_PAGE)
|
||||||
if (dev->work_area == NULL) {
|
if (dev->work_area == NULL) {
|
||||||
DEBUG("mtd_sdhc: no work area\n");
|
DEBUG("mtd_sdhc: no work area\n");
|
||||||
@ -105,7 +105,7 @@ static int _write_page(mtd_dev_t *dev, const void *buff, uint32_t page,
|
|||||||
DEBUG("%s(%lu, %lu, %lu)\n", __func__, page, offset, size);
|
DEBUG("%s(%lu, %lu, %lu)\n", __func__, page, offset, size);
|
||||||
|
|
||||||
/* emulate unaligned / sub-page write */
|
/* emulate unaligned / sub-page write */
|
||||||
if (pages == 0 || offset) {
|
if (pages == 0 || offset || ((uintptr_t)buff & 0x3)) {
|
||||||
#if IS_USED(MODULE_MTD_WRITE_PAGE)
|
#if IS_USED(MODULE_MTD_WRITE_PAGE)
|
||||||
if (dev->work_area == NULL) {
|
if (dev->work_area == NULL) {
|
||||||
DEBUG("mtd_sdhc: no work area\n");
|
DEBUG("mtd_sdhc: no work area\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user