Explorar o código

[DeviceDriver][pm] Update pm driver.

armink %!s(int64=6) %!d(string=hai) anos
pai
achega
f05baecc5a
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      components/drivers/pm/pm.c

+ 8 - 0
components/drivers/pm/pm.c

@@ -238,7 +238,15 @@ void rt_pm_request(rt_ubase_t mode)
          * if not, it has already called in rt_pm_exit()
          */
         if (pm->current_mode < PM_SLEEP_MODE_START)
+        {
             pm->ops->exit(pm);
+        }
+        else if (pm->exit_count)
+        {
+            /* call exeit when global interrupt is disable */
+            pm->ops->exit(pm);
+            pm->exit_count = 0;
+        }
 
         /* update current mode */
         pm->current_mode = mode;