mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 06:00:27 +08:00
Merge pull request #4819 from whj4674672/pm
[pm] index should be less than PM_MODLUE_MAX_ID
This commit is contained in:
commit
fcb0a47328
@ -836,12 +836,10 @@ rt_uint32_t rt_pm_module_get_status(void)
|
|||||||
rt_uint32_t req_status = 0x00;
|
rt_uint32_t req_status = 0x00;
|
||||||
pm = &_pm;
|
pm = &_pm;
|
||||||
|
|
||||||
for (index = 0; index < 32; index ++)
|
for (index = 0; index < PM_MODULE_MAX_ID; index ++)
|
||||||
{
|
{
|
||||||
if (pm->module_status[index].req_status == 0x01)
|
if (pm->module_status[index].req_status == 0x01)
|
||||||
req_status |= 1<<index;
|
req_status |= 1<<index;
|
||||||
if (index >= PM_MODULE_MAX_ID)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return req_status;
|
return req_status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user