Explorar o código

Merge pull request #9 from enkiller/master

【更新】支持低功耗组件
朱天龙 (Armink) %!s(int64=7) %!d(string=hai) anos
pai
achega
f2794cc232
Modificáronse 1 ficheiros con 7 adicións e 3 borrados
  1. 7 3
      stm32_sdio.c

+ 7 - 3
stm32_sdio.c

@@ -366,7 +366,9 @@ static void rthw_sdio_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
     struct rt_mmcsd_data *data;
 
     RTHW_SDIO_LOCK(sdio);
-
+#ifdef RT_USING_PM
+    rt_pm_request(PM_RUN_MODE_NORMAL);
+#endif
     if (req->cmd != RT_NULL)
     {
         memset(&pkg, 0, sizeof(pkg));
@@ -404,7 +406,9 @@ static void rthw_sdio_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
         pkg.cmd = req->stop;
         rthw_sdio_send_command(sdio, &pkg);
     }
-
+#ifdef RT_USING_PM
+    rt_pm_release(PM_RUN_MODE_NORMAL);
+#endif
     RTHW_SDIO_UNLOCK(sdio);
 
     mmcsd_req_complete(sdio->host);
@@ -479,7 +483,7 @@ static void rthw_sdio_iocfg(struct rt_mmcsd_host *host, struct rt_mmcsd_io_cfg *
         clkcr |= HW_SDIO_BUSWIDE_1B;
     }
 
-    hw_sdio->clkcr = clkcr;
+    hw_sdio->clkcr = clkcr | HW_SDIO_IDLE_ENABLE;
 
     switch (io_cfg->power_mode)
     {