From f7054acf4652ce7742b77ab3296094f89495996a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20M=C3=BAdry?= Date: Mon, 25 Nov 2024 22:15:29 +0100 Subject: [PATCH] feat(fatfs/diskio): Remove const from PARTITION VolToPart Closes https://github.com/espressif/esp-idf/issues/14148 --- components/fatfs/diskio/diskio.c | 6 +++--- components/fatfs/src/ff.h | 2 +- .../peripherals/usb/device/tusb_msc/main/tusb_msc_main.c | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/fatfs/diskio/diskio.c b/components/fatfs/diskio/diskio.c index b50f34b853..7d39835fb7 100644 --- a/components/fatfs/diskio/diskio.c +++ b/components/fatfs/diskio/diskio.c @@ -1,10 +1,10 @@ /*-----------------------------------------------------------------------*/ /* Low level disk I/O module skeleton for FatFs (C)ChaN, 2016 */ -/* ESP-IDF port Copyright 2016 Espressif Systems (Shanghai) PTE LTD */ +/* ESP-IDF port Copyright 2016-2025 Espressif Systems (Shanghai) PTE LTD */ /*-----------------------------------------------------------------------*/ /* If a working storage control module is available, it should be */ /* attached to the FatFs via a glue function rather than modifying it. */ -/* This is an example of glue functions to attach various existing */ +/* This is an example of glue functions to attach various existing */ /* storage control modules to the FatFs module with a defined API. */ /*-----------------------------------------------------------------------*/ @@ -19,7 +19,7 @@ static ff_diskio_impl_t * s_impls[FF_VOLUMES] = { NULL }; #if FF_MULTI_PARTITION /* Multiple partition configuration */ -const PARTITION VolToPart[FF_VOLUMES] = { +PARTITION VolToPart[FF_VOLUMES] = { {0, 0}, /* Logical drive 0 ==> Physical drive 0, auto detection */ #if FF_VOLUMES > 1 {1, 0}, /* Logical drive 1 ==> Physical drive 1, auto detection */ diff --git a/components/fatfs/src/ff.h b/components/fatfs/src/ff.h index 55f6526c37..f4493e031a 100644 --- a/components/fatfs/src/ff.h +++ b/components/fatfs/src/ff.h @@ -116,7 +116,7 @@ typedef struct { BYTE pd; /* Physical drive number */ BYTE pt; /* Partition: 0:Auto detect, 1-4:Forced partition) */ } PARTITION; -extern const PARTITION VolToPart[]; /* Volume - Partition mapping table */ +extern PARTITION VolToPart[]; /* Volume - Partition mapping table */ #endif #if FF_STR_VOLUME_ID diff --git a/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c b/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c index c40b04e1f1..dfc29c6209 100644 --- a/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c +++ b/examples/peripherals/usb/device/tusb_msc/main/tusb_msc_main.c @@ -22,6 +22,7 @@ #include "tinyusb.h" #include "tusb_msc_storage.h" #ifdef CONFIG_EXAMPLE_STORAGE_MEDIA_SDMMC +#include "sdmmc_cmd.h" #include "diskio_impl.h" #include "diskio_sdmmc.h" #if CONFIG_EXAMPLE_SD_PWR_CTRL_LDO_INTERNAL_IO