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

Function _pm_frequency_scaling

components/drivers/pm/pm.c:172–189  ·  view source on GitHub ↗

* This function will update the system clock frequency when idle */

Source from the content-addressed store, hash-verified

170 * This function will update the system clock frequency when idle
171 */
172static void _pm_frequency_scaling(struct rt_pm *pm)
173{
174 rt_base_t level = 0;
175
176 if (pm->flags & RT_PM_FREQUENCY_PENDING)
177 {
178 level = rt_hw_interrupt_disable();
179 /* change system runing mode */
180 if(pm->ops->run != RT_NULL)
181 {
182 pm->ops->run(pm, pm->run_mode);
183 }
184 /* changer device frequency */
185 _pm_device_frequency_change(pm->run_mode);
186 pm->flags &= ~RT_PM_FREQUENCY_PENDING;
187 rt_hw_interrupt_enable(level);
188 }
189}
190
191/**
192 * judge sleep mode from sleep request

Callers 1

rt_system_power_managerFunction · 0.85

Calls 4

rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected