Skip to content

Commit be92ace

Browse files
Fix: format the codes and fix return value
1 parent e0e620d commit be92ace

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* 2018-12-13 balanceTWK add sdcard port file
99
* 2021-05-10 Meco Man fix a bug that cannot use fatfs in the main thread at starting up
1010
* 2021-07-28 Meco Man implement romfs as the root filesystem
11-
* 2026-01-12 LinuxMint-User add sdcard mount retries in case SDIO init done after mount
11+
* 2026-01-13 LinuxMint-User add sdcard detect before mount in case auto mount failed
1212
*/
1313

1414
#include <rtthread.h>
@@ -38,9 +38,10 @@ static int onboard_sdcard_mount(void)
3838
{
3939
mmcsd_wait_cd_changed(0);
4040
stm32_mmcsd_change();
41-
mmcsd_wait_cd_changed(500);
41+
mmcsd_wait_cd_changed(rt_tick_from_millisecond(500));
4242
device = rt_device_find("sd0");
4343
}
44+
4445
if (device != RT_NULL)
4546
{
4647
if (dfs_mount("sd0", "/sdcard", "elm", 0, 0) == RT_EOK)
@@ -52,6 +53,7 @@ static int onboard_sdcard_mount(void)
5253
LOG_W("SD card mount to '/sdcard' failed!");
5354
}
5455
}
56+
return RT_EOK;
5557
}
5658
#endif /* BSP_USING_SDCARD_FATFS */
5759

0 commit comments

Comments
 (0)