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

Function idle_thread_entry

src/idle.c:120–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118#endif /* RT_USING_IDLE_HOOK */
119
120static void idle_thread_entry(void *parameter)
121{
122 RT_UNUSED(parameter);
123#ifdef RT_USING_SMP
124 if (rt_cpu_get_id() != 0)
125 {
126 while (1)
127 {
128 rt_hw_secondary_cpu_idle_exec();
129 }
130 }
131#endif /* RT_USING_SMP */
132
133 while (1)
134 {
135#ifdef RT_USING_IDLE_HOOK
136 rt_size_t i;
137 void (*idle_hook)(void);
138
139 for (i = 0; i < RT_IDLE_HOOK_LIST_SIZE; i++)
140 {
141 idle_hook = idle_hook_list[i];
142 if (idle_hook != RT_NULL)
143 {
144 idle_hook();
145 }
146 }
147#endif /* RT_USING_IDLE_HOOK */
148
149#if !defined(RT_USING_SMP) && !defined(RT_USING_SMART)
150 rt_defunct_execute();
151#endif
152
153#ifdef RT_USING_PM
154 void rt_system_power_manager(void);
155 rt_system_power_manager();
156#endif /* RT_USING_PM */
157 }
158}
159
160/**
161 * @brief This function will initialize idle thread, then start it.

Callers

nothing calls this directly

Calls 5

rt_cpu_get_idFunction · 0.85
rt_defunct_executeFunction · 0.85
rt_system_power_managerFunction · 0.85
idle_hookFunction · 0.50

Tested by

no test coverage detected