You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using rt_pm_device_register API at components initialization context
the API would be hang at RT_KERNEL_REALLOC calling
Solution:
put the RT_KERNEL_REALLOC calling out of critical region, just like as below:
device_pm = (struct rt_device_pm *)RT_KERNEL_REALLOC(_pm.device_pm,
(_pm.device_pm_number + 1) * sizeof(struct rt_device_pm));
if (device_pm != RT_NULL)
{
level = rt_hw_interrupt_disable();
_pm.device_pm = device_pm;
_pm.device_pm[_pm.device_pm_number].device = device;
_pm.device_pm[_pm.device_pm_number].ops = ops;
_pm.device_pm_number += 1;
rt_hw_interrupt_enable(level);
}