Skip to content

Commit b0aac12

Browse files
committed
Merge branch 'fix/fatfs_diskio_static_func' into 'master'
fix(fatfs): make the diskio functions static See merge request espressif/esp-idf!36694
2 parents 82f558b + 50dc84c commit b0aac12

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

components/fatfs/diskio/diskio_rawflash.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -25,7 +25,7 @@ static uint8_t s_initialized[FF_VOLUMES];
2525
#define BPB_TotSec32 32
2626

2727

28-
DSTATUS ff_raw_initialize (BYTE pdrv)
28+
static DSTATUS ff_raw_initialize (BYTE pdrv)
2929
{
3030

3131
uint16_t sector_size_tmp;
@@ -61,7 +61,7 @@ DSTATUS ff_raw_initialize (BYTE pdrv)
6161
return STA_PROTECT;
6262
}
6363

64-
DSTATUS ff_raw_status (BYTE pdrv)
64+
static DSTATUS ff_raw_status (BYTE pdrv)
6565
{
6666
DSTATUS status = STA_PROTECT;
6767
if (!s_initialized[pdrv]) {
@@ -70,7 +70,7 @@ DSTATUS ff_raw_status (BYTE pdrv)
7070
return status;
7171
}
7272

73-
DRESULT ff_raw_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
73+
static DRESULT ff_raw_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
7474
{
7575
ESP_LOGV(TAG, "ff_raw_read - pdrv=%i, sector=%i, count=%in", (unsigned int)pdrv, (unsigned int)sector, (unsigned int)count);
7676
const esp_partition_t* part = s_ff_raw_handles[pdrv];
@@ -84,12 +84,12 @@ DRESULT ff_raw_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
8484
}
8585

8686

87-
DRESULT ff_raw_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
87+
static DRESULT ff_raw_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
8888
{
8989
return RES_WRPRT;
9090
}
9191

92-
DRESULT ff_raw_ioctl (BYTE pdrv, BYTE cmd, void *buff)
92+
static DRESULT ff_raw_ioctl (BYTE pdrv, BYTE cmd, void *buff)
9393
{
9494
const esp_partition_t* part = s_ff_raw_handles[pdrv];
9595
ESP_LOGV(TAG, "ff_raw_ioctl: cmd=%in", cmd);

components/fatfs/diskio/diskio_sdmmc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -34,20 +34,20 @@ static DSTATUS ff_sdmmc_card_available(BYTE pdrv)
3434
* fails. This error value is checked throughout the FATFS code.
3535
* Both functions return 0 on success.
3636
*/
37-
DSTATUS ff_sdmmc_initialize (BYTE pdrv)
37+
static DSTATUS ff_sdmmc_initialize (BYTE pdrv)
3838
{
3939
return ff_sdmmc_card_available(pdrv);
4040
}
4141

42-
DSTATUS ff_sdmmc_status(BYTE pdrv)
42+
static DSTATUS ff_sdmmc_status(BYTE pdrv)
4343
{
4444
if (s_disk_status_check_en[pdrv]) {
4545
return ff_sdmmc_card_available(pdrv);
4646
}
4747
return 0;
4848
}
4949

50-
DRESULT ff_sdmmc_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count)
50+
static DRESULT ff_sdmmc_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count)
5151
{
5252
sdmmc_card_t* card = s_cards[pdrv];
5353
assert(card);
@@ -59,7 +59,7 @@ DRESULT ff_sdmmc_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count)
5959
return RES_OK;
6060
}
6161

62-
DRESULT ff_sdmmc_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count)
62+
static DRESULT ff_sdmmc_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count)
6363
{
6464
sdmmc_card_t* card = s_cards[pdrv];
6565
assert(card);
@@ -72,7 +72,7 @@ DRESULT ff_sdmmc_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count)
7272
}
7373

7474
#if FF_USE_TRIM
75-
DRESULT ff_sdmmc_trim (BYTE pdrv, DWORD start_sector, DWORD sector_count)
75+
static DRESULT ff_sdmmc_trim (BYTE pdrv, DWORD start_sector, DWORD sector_count)
7676
{
7777
sdmmc_card_t* card = s_cards[pdrv];
7878
assert(card);
@@ -88,7 +88,7 @@ DRESULT ff_sdmmc_trim (BYTE pdrv, DWORD start_sector, DWORD sector_count)
8888
}
8989
#endif //FF_USE_TRIM
9090

91-
DRESULT ff_sdmmc_ioctl (BYTE pdrv, BYTE cmd, void* buff)
91+
static DRESULT ff_sdmmc_ioctl (BYTE pdrv, BYTE cmd, void* buff)
9292
{
9393
sdmmc_card_t* card = s_cards[pdrv];
9494
assert(card);

components/fatfs/diskio/diskio_wl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -19,17 +19,17 @@ wl_handle_t ff_wl_handles[FF_VOLUMES] = {
1919
[0 ... FF_VOLUMES - 1] = WL_INVALID_HANDLE
2020
};
2121

22-
DSTATUS ff_wl_initialize (BYTE pdrv)
22+
static DSTATUS ff_wl_initialize (BYTE pdrv)
2323
{
2424
return 0;
2525
}
2626

27-
DSTATUS ff_wl_status (BYTE pdrv)
27+
static DSTATUS ff_wl_status (BYTE pdrv)
2828
{
2929
return 0;
3030
}
3131

32-
DRESULT ff_wl_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
32+
static DRESULT ff_wl_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
3333
{
3434
ESP_LOGV(TAG, "ff_wl_read - pdrv=%i, sector=%i, count=%i", (unsigned int)pdrv, (unsigned int)sector, (unsigned int)count);
3535
wl_handle_t wl_handle = ff_wl_handles[pdrv];
@@ -42,7 +42,7 @@ DRESULT ff_wl_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
4242
return RES_OK;
4343
}
4444

45-
DRESULT ff_wl_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
45+
static DRESULT ff_wl_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
4646
{
4747
ESP_LOGV(TAG, "ff_wl_write - pdrv=%i, sector=%i, count=%i", (unsigned int)pdrv, (unsigned int)sector, (unsigned int)count);
4848
wl_handle_t wl_handle = ff_wl_handles[pdrv];
@@ -60,7 +60,7 @@ DRESULT ff_wl_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
6060
return RES_OK;
6161
}
6262

63-
DRESULT ff_wl_ioctl (BYTE pdrv, BYTE cmd, void *buff)
63+
static DRESULT ff_wl_ioctl (BYTE pdrv, BYTE cmd, void *buff)
6464
{
6565
wl_handle_t wl_handle = ff_wl_handles[pdrv];
6666
ESP_LOGV(TAG, "ff_wl_ioctl: cmd=%i", cmd);

0 commit comments

Comments
 (0)