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

Function cpu_thread_entry

bsp/fujitsu/mb9x/mb9bf500r/cpuusage.c:91–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89extern struct rt_messagequeue mq;
90extern rt_thread_t info_tid;
91static void cpu_thread_entry(void *parameter)
92{
93#ifdef RT_USING_RTGUI
94 struct rtgui_event_command ecmd;
95
96 RTGUI_EVENT_COMMAND_INIT(&ecmd);
97 ecmd.type = RTGUI_CMD_USER_INT;
98 ecmd.command_id = CPU_UPDATE;
99#else
100 struct lcd_msg msg;
101#endif
102
103 while (1)
104 {
105#ifdef RT_USING_RTGUI
106 rtgui_thread_send(info_tid, &ecmd.parent, sizeof(ecmd));
107#else
108 msg.type = CPU_MSG;
109 msg.major = cpu_usage_major;
110 msg.minor = cpu_usage_minor;
111 rt_mq_send(&mq, &msg, sizeof(msg));
112#endif
113 rt_thread_delay(20);
114 }
115}
116
117static rt_thread_t cpu_thread;
118void rt_hw_cpu_init(void)

Callers

nothing calls this directly

Calls 2

rt_mq_sendFunction · 0.85
rt_thread_delayFunction · 0.85

Tested by

no test coverage detected