summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJiaojinxing <jiaojinxing1987@gmail.com>2017-09-20 09:04:19 (GMT)
committer Jiaojinxing <jiaojinxing1987@gmail.com>2017-09-20 09:04:19 (GMT)
commit71a01c55fa73d9660f320fc41034f26f9d2fdae8 (patch)
treee94e3d13813e9226de615633dab12d72a975d2e7
parentb70f30b909beb8010f338b3729e57d6d67cea1b5 (diff)
downloadbspam335x-71a01c55fa73d9660f320fc41034f26f9d2fdae8.zip
bspam335x-71a01c55fa73d9660f320fc41034f26f9d2fdae8.tar.gz
bspam335x-71a01c55fa73d9660f320fc41034f26f9d2fdae8.tar.bz2
Fixed sdcard mount wait bug.
-rw-r--r--SylixOS/bsp/bspInit.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/SylixOS/bsp/bspInit.c b/SylixOS/bsp/bspInit.c
index 5dc2c23..32e1337 100644
--- a/SylixOS/bsp/bspInit.c
+++ b/SylixOS/bsp/bspInit.c
@@ -134,7 +134,7 @@ static VOID halCacheInit (VOID)
/*********************************************************************************************************
** 函数名称: halFpuInit
** 功能描述: 目标系统 FPU 浮点运算单元初始化
-** 输 入: NONE
+** 输 入: NONE
** 输 出: NONE
** 全局变量:
** 调用模块:
@@ -175,7 +175,7 @@ static VOID halPmInit (VOID)
/*********************************************************************************************************
** 函数名称: halBusInit
** 功能描述: 初始化目标系统总线系统
-** 输 入: NONE
+** 输 入: NONE
** 输 出: NONE
** 全局变量:
** 调用模块:
@@ -512,6 +512,9 @@ static VOID halLoaderInit (VOID)
static PVOID halBootThread (PVOID pvBootArg)
{
LW_CLASS_THREADATTR threakattr = API_ThreadAttrGetDefault(); /* 使用默认属性 */
+#if BSP_CFG_SD_ROOTFS_EN > 0
+ INT i;
+#endif
(VOID)pvBootArg;
@@ -555,11 +558,18 @@ static PVOID halBootThread (PVOID pvBootArg)
#endif
#if BSP_CFG_SD_ROOTFS_EN > 0
- while (access("/media/sdcard0", R_OK) < 0) {
+ for (i = 0; i < 3; i++) {
+ if (access("/media/sdcard0", R_OK) == 0) {
+ break;
+ }
printk(KERN_WARNING "halStdDirInit(): wait for sdcard insert!\n");
sleep(1);
}
- while (access("/media/sdcard1", R_OK) < 0) {
+
+ for (i = 0; i < 3; i++) {
+ if (access("/media/sdcard1", R_OK) == 0) {
+ break;
+ }
printk(KERN_WARNING "halStdDirInit(): wait for sdcard insert!\n");
sleep(1);
}