MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _pm_device_suspend

Function _pm_device_suspend

components/drivers/pm/pm.c:111–131  ·  view source on GitHub ↗

* This function will suspend all registered devices */

Source from the content-addressed store, hash-verified

109 * This function will suspend all registered devices
110 */
111static rt_err_t _pm_device_suspend(rt_uint8_t mode)
112{
113 rt_err_t ret = RT_EOK;
114 struct rt_device_pm *device_pm = RT_NULL;
115 rt_slist_t *node = RT_NULL;
116
117 for (node = rt_slist_first(&_pm.device_list); node; node = rt_slist_next(node))
118 {
119 device_pm = rt_slist_entry(node, struct rt_device_pm, list);
120 if (device_pm->ops != RT_NULL && device_pm->ops->suspend != RT_NULL)
121 {
122 ret = device_pm->ops->suspend(device_pm->device, mode);
123 if(ret != RT_EOK)
124 {
125 break;
126 }
127 }
128 }
129
130 return ret;
131}
132
133/**
134 * This function will resume all registered devices

Callers 1

_pm_change_sleep_modeFunction · 0.85

Calls 2

rt_slist_firstFunction · 0.85
rt_slist_nextFunction · 0.85

Tested by

no test coverage detected