4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-21 00:27:19 +08:00

Merge pull request #1935 from armink/add_pm

[DeviceDriver][pm] Update pm driver.
This commit is contained in:
Bernard Xiong 2018-10-29 19:44:20 +08:00 committed by GitHub
commit 7fd434e2f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;